Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Nov 26, 2024

Why this should be merged

Allows for a drop-in replacement of snapshot.Tree (i.e. one that uses block hashes instead of state roots). This is intended as a temporary solution while we investigate having the state root affected by the block hash to remove path ambiguity.

How this works

Introduction of:

  1. state.SnapshotTree interface to match methods required on snapshot.Tree as used by state.StateDB; and
  2. stateconf package for variadic options plumbed by StateDB.Commit() through to SnapshotTree.Update().

Although variadic (to maintain function call-signature compatibility) only the stateconf.WithUpdatePayload(any) is expected to be used. Recipients of the options can access the payload with stateconf.ExtractUpdatePayload().

How this was tested

Unit test demonstrating propagation of stateconf.UpdateOption payload.

@ARR4N ARR4N marked this pull request as ready for review November 26, 2024 11:36
@ARR4N ARR4N merged commit 3a75409 into main Nov 26, 2024
3 checks passed
@ARR4N ARR4N deleted the arr4n/state-snapshot-interface branch November 26, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants