`DynArray[T, MAX_LEN]` gives you a growable array, but it is still capped at a compile-time maximum length, so worst-case gas remains bounded. Use `.append()` and `.pop()` to grow and shrink it.
history: public(DynArray[uint256, 100])
@external
def record(value: uint256):
self.history.append(value)
@external
def undo():
self.history.pop()Appending beyond `MAX_LEN` reverts, which is a deliberate safety valve rather than a bug — plan your maximum capacity up front.