vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
236 stars 37 forks source link

Forward time_travel should create a new transaction #218

Open sajal opened 2 months ago

sajal commented 2 months ago

Currently all function calls to a contract happen within the scope of a single transaction, however when we time travel to the future using boa.env.time_travel, a new block(or transaction) should be created. I am specifically requesting this because we use transient storage to cache values that are expensive to generate and would be valid through the transaction (the block even), however in the future these values wont be valid specifically because time is a component of these computations(things like amount of yield being generated).

charles-cooper commented 2 months ago

from https://github.com/vyperlang/titanoboa/issues/216#issuecomment-2104627042

DanielSchiavini commented 1 month ago

Based on #216 I understand the real issue is that we want to clear transient storage when time travelling. Is that correct? Or is there more data that would need to change?

charles-cooper commented 1 month ago

i think we should have a function called reset_transaction_context which does whatever we need for resetting transaction context. this includes clearing transient storage and resetting access acounters i think.

DanielSchiavini commented 1 month ago

@sajal please confirm whether resetting the transient storage is enough for your purposes