vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
257 stars 51 forks source link

Forward time_travel should create a new transaction #218

Open sajal opened 6 months ago

sajal commented 6 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 6 months ago

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

DanielSchiavini commented 6 months 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 6 months 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 6 months ago

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