Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

feat(statedb): Reintroduce and simplify StateDB #14

Merged
merged 95 commits into from
Jan 16, 2023
Merged

feat(statedb): Reintroduce and simplify StateDB #14

merged 95 commits into from
Jan 16, 2023

Conversation

itsdevbear
Copy link

@itsdevbear itsdevbear commented Jan 12, 2023

┆Issue is synchronized with this Asana task by Unito

// ==============================================================================

// `Revert` implements `journal.CacheEntry`.
func (ce *RefundChange) Revert() {
Copy link
Author

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.

Copy link
Contributor

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) ?

Copy link
Contributor

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

Copy link
Author

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.

@delete-merged-branch delete-merged-branch bot deleted the branch main January 13, 2023 23:03
@itsdevbear itsdevbear changed the base branch from upgrade-cachekv to main January 13, 2023 23:05
@itsdevbear itsdevbear added this to the Phase 1 - Core Foundations milestone Jan 16, 2023
@itsdevbear itsdevbear merged commit fbed0d1 into main Jan 16, 2023
@itsdevbear itsdevbear deleted the statedb branch January 16, 2023 19:48
@itsdevbear itsdevbear self-assigned this Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants