Last active
August 19, 2020 11:13
-
-
Save Thegaram/6b6a2e5a8297053e227bc9a6750c8aab to your computer and use it in GitHub Desktop.
state-db-checkpoint-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example-1: | |
---------- | |
cache: {} | |
> create checkpoint #0 | |
> write k=1 v=2 | |
cache: { 1: (original = 1, current = 2) } | |
> revert to checkpoint #0 | |
cache: | |
Parity implementation: { 1: (original = 1, current = 1) } | |
our (new) implementation: {} | |
example-2: | |
---------- | |
cache: { 1: (original = 1, current = 2) } | |
> create checkpoint #0 | |
> write k=1, v=1 | |
cache: { 1: (original = 1, current = 1) } | |
> create checkpoint #1 | |
> write k=1, v=3 | |
cache: { 1: (original = 1, current = 3) } | |
> revert to checkpoint #1 | |
cache: { 1: (original = 1, current = 1) } --> if we delete from cache here, we will need another db load in the next step | |
> revert to checkpoint #0 | |
cache: { 1: (original = 1, current = 2) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment