-
Notifications
You must be signed in to change notification settings - Fork 563
use stack of contexts to implement snapshot revert #399
Conversation
the integration tests are verified manually, not sure if it's get picked up in CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach and PR. I think we should move the cached context struct into a new file and implement it as a stack. We should also add more comprehensive comments (especially on RevertToSnapshot
and Snapshot
) so that people know how this actually works and the motivation behind this approach.
Codecov Report
@@ Coverage Diff @@
## main #399 +/- ##
==========================================
- Coverage 50.74% 50.69% -0.05%
==========================================
Files 48 49 +1
Lines 4846 4872 +26
==========================================
+ Hits 2459 2470 +11
- Misses 2288 2298 +10
- Partials 99 104 +5
|
beside some naming convention, lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left another round of comments. I think we should explicitly test the cache stack by ensuring that creating a cacheCtx from another cacheCtx works fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A final round of comments, mostly test cases
13352da
to
92fabd1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. 2 Minor suggestions. can you add a breaking change entry on the changelog?
changelog added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Pending panic
on nil
commit function
Closes #338 add exception revert test case verify partial revert mutate state after the reverted subcall polish update comments name the module after the type name remove the unnecessary Snapshot in outer layer and add snapshot unit test assert context stack is clean after tx processing cleanups fix context revert fix comments update comments it's ok to commit in failed case too Update x/evm/keeper/context_stack.go Co-authored-by: Federico Kunze Küllmer <[email protected]> Update x/evm/keeper/context_stack.go Co-authored-by: Federico Kunze Küllmer <[email protected]> Update x/evm/keeper/context_stack.go Co-authored-by: Federico Kunze Küllmer <[email protected]> update comment and error message add comment to cacheContext k -> cs Update x/evm/keeper/context_stack.go Co-authored-by: Federico Kunze Küllmer <[email protected]> evm can handle state revert renames and unit tests
Closes: #338
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)