Skip to content

chore(trie): Overlay arguments for write trie changeset methods#18732

Merged
mediocregopher merged 3 commits into18460-trie-changesetsfrom
mediocregopher/write-trie-changesets-overlay
Sep 29, 2025
Merged

chore(trie): Overlay arguments for write trie changeset methods#18732
mediocregopher merged 3 commits into18460-trie-changesetsfrom
mediocregopher/write-trie-changesets-overlay

Conversation

@mediocregopher
Copy link
Copy Markdown
Member

This allows for passing optional overlays into the write_trie_changesets and write_storage_trie_changesets provider methods.

The overlay is a TrieUpdates which is used to augment the state of the trie db tables. Using the overlay we can write changesets as if the DB is at a previous block, which will be used during pipeline sync.

Implementing this change required refactoring the
StorageTrieCurrentValuesIter utility to accept a TrieCursor rather than a normal DbCursor. It also required implementing a TrieCursorIter which wraps a TrieCursor into an Iterator, for passing in to storage_trie_wiped_changeset_iter. Using both of these changes we could use an InMemoryTrieCursor instead of a direct db cursor.

This allows for passing optional overlays into the
`write_trie_changesets` and `write_storage_trie_changesets` provider
methods.

The overlay is a TrieUpdates which is used to augment the state of the
trie db tables. Using the overlay we can write changesets as if the DB
is at a previous block, which will be used during pipeline sync.

Implementing this change required refactoring the
StorageTrieCurrentValuesIter utility to accept a TrieCursor rather than
a normal DbCursor. It also required implementing a TrieCursorIter which
wraps a TrieCursor into an Iterator, for passing in to
`storage_trie_wiped_changeset_iter`. Using both of these changes we
could use an InMemoryTrieCursor instead of a direct db cursor.
Copy link
Copy Markdown
Contributor

@yongkangc yongkangc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, i dont have any nits and the pr makes sense to me overall

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Sep 29, 2025
Copy link
Copy Markdown
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

makes sense to me

@mediocregopher mediocregopher merged commit c9404ed into 18460-trie-changesets Sep 29, 2025
37 checks passed
@mediocregopher mediocregopher deleted the mediocregopher/write-trie-changesets-overlay branch September 29, 2025 11:40
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants