Convex-Dev / convex

Convex Main Repository - Decentralised platform for the Internet of Value
https://convex.world
Other
90 stars 27 forks source link

Keep CVM log when forking context with a different address #399

Open helins opened 1 year ago

helins commented 1 year ago

Is there any reason not to keep the current CVM log when using Context.forkWithAddress()?

In the Convex Shell, forkWithAddress() would be useful for switching accounts while minimizing any other state.

mikera commented 1 year ago

I believe the only reason it doesn't do that currently is that it was originally intended for testing purposes where you want a new "fresh" context (i.e. just with the same state, otherwise similar to what you would have at the start of a transaction). It's very dangerous to change address otherwise so this isn't intended for production on-chain usage.

No reason why we can't have a separate version that keeps the log though. It's all fine for off-chain usage.