-
Notifications
You must be signed in to change notification settings - Fork 363
feat(statedb): Reintroduce and simplify StateDB #14
Conversation
Co-authored-by: Cal Bera <calbera@berachain.com> Signed-off-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: Cal Bera <calbera@berachain.com> Signed-off-by: Devon Bear <itsdevbear@berachain.com>
// ============================================================================== | ||
|
||
// `Revert` implements `journal.CacheEntry`. | ||
func (ce *RefundChange) Revert() { |
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.
Maybe for the revert in the SDB we store a mapping of reflect.Type(RefundChange) to revert function with the signature of
func (sdb *StateDB) {}
Then in sdb RevertToSnapshot we have a for loop which goes through the journal.
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.
why iterate over types (map keys) instead of iterating over journal indices (journal keys are just slice indices) ?
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.
cuz these are all journal entries so its already taken care of
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.
yeah was just a thought, evm.go updates probably nil this.
Co-authored-by: Cal Bera <calbera@berachain.com>
Signed-off-by: Devon Bear <itsdevbear@berachain.com>
Signed-off-by: Devon Bear <itsdevbear@berachain.com>
┆Issue is synchronized with this Asana task by Unito