snapshot + db backend modifications for use by coreth & subnet-evm #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
How this works
This pull request makes changes to the
core/stateandtriedbpackages to enhance the flexibility of the state management and database handling. The changes involve introducing new interfaces, updating function implementations.Changes to
core/state:snapshotTreeinterface to abstract the snapshot handling inStateDB(core/state/statedb.go).StateDBstruct to use the newsnapshotTreeinterface (core/state/statedb.go).Newfunction to handlesnapshotTreeand ensure proper handling ofnilpointers (core/state/statedb.go). <-- not sure if there is a better way to handle thisChanges to
triedb:Configstruct intriedb/database.goto use interfaces forHashDBandPathDB(triedb/database.go). -- Trying to keep changes minimal esp. to tests.Backend,HashBackend, andPathBackendto define methods for different state schemes (triedb/database/database.go).NewDatabasefunction to use the newBackendinterfaces and handlenilconfigurations (triedb/database.go).triedb/database.goto use the newBackendinterfaces (triedb/database.go) [1] [2] [3] [4] [5] [6] [7] [8] [9].Newmethods toConfigstructs intriedb/hashdb/database.goandtriedb/pathdb/database.goto instantiateHashBackendandPathBackendrespectively (triedb/hashdb/database.go) [1] (triedb/pathdb/database.go) [2].How this was tested
CI