Skip to content

Conversation

@Rjected
Copy link
Member

@Rjected Rjected commented May 12, 2025

This sends the accounts trie back to the payload processor whenever the sparse trie finishes.

depends on #16179

Previously reserve_nodes took ~30% of time in revealing
Screenshot 2025-05-12 at 8 56 05 PM

Main profile: https://share.firefox.dev/3S18zep

There are now almost no reserve_nodes calls in account revealing, and the only insertion-related calls take a very small percentage of time.
Screenshot 2025-05-12 at 8 50 22 PM

Branch profile: https://share.firefox.dev/456JBlv

@Rjected Rjected added the C-enhancement New feature or request label May 12, 2025
@Rjected Rjected requested a review from fgimenez as a code owner May 12, 2025 22:12
@Rjected Rjected added the C-perf A change motivated by improving speed, memory usage or disk footprint label May 12, 2025
@Rjected Rjected added the A-trie Related to Merkle Patricia Trie implementation label May 12, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker May 12, 2025
@Rjected Rjected marked this pull request as draft May 12, 2025 22:12
@Rjected Rjected force-pushed the dan/keep-trie-around branch 7 times, most recently from 648cd41 to 5bd4e41 Compare May 13, 2025 16:02
@Rjected Rjected self-assigned this May 13, 2025
@jenpaff jenpaff moved this from Backlog to In Progress in Reth Tracker May 13, 2025
@Rjected Rjected force-pushed the dan/keep-trie-around branch from 5bd4e41 to 613ea79 Compare May 14, 2025 16:59
@Rjected Rjected marked this pull request as ready for review May 14, 2025 16:59
@Rjected Rjected force-pushed the dan/keep-trie-around branch 2 times, most recently from 21b17c5 to 6043a1a Compare May 14, 2025 20:49
Comment on lines 73 to 78
Blind {
/// This is an optional field that can be used to store a previously allocated
/// trie. In these cases, the trie will still be treated as blind, but the allocated trie
/// will be reused if the trie becomes revealed.
allocated: Option<Box<RevealedSparseTrie<P>>>,
},
Copy link
Member

Choose a reason for hiding this comment

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

let's get rid of this pls. maybe make it a separate variant? e.g. AllocatedEmpty

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

/// This is an optional field that can be used to store a previously allocated
/// trie. In these cases, the trie will still be treated as blind, but the allocated trie
/// will be reused if the trie becomes revealed.
allocated: Option<Box<RevealedSparseTrie<P>>>,
Copy link
Member

Choose a reason for hiding this comment

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

it doesn't make sense to keep entire revealed sparse trie. let's only keep nodes and values hash maps and any other stuff that we are interested in. can be extracted into SparseTrieNodes or SparseTrieState struct or smth

Copy link
Member Author

Choose a reason for hiding this comment

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

made SparseTrieState and put nodes, values, and mask hashmaps

@Rjected Rjected force-pushed the dan/keep-trie-around branch 10 times, most recently from ea688fc to f0758aa Compare May 27, 2025 19:53
@Rjected Rjected force-pushed the dan/keep-trie-around branch from f0758aa to 5e65e9b Compare May 27, 2025 19:54
@Rjected Rjected requested a review from rkrasiuk May 28, 2025 01:55
Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

thanks, i like this much more

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@Rjected Rjected added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 3e0960c Jun 16, 2025
45 checks passed
@Rjected Rjected deleted the dan/keep-trie-around branch June 16, 2025 13:31
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jun 16, 2025
@jenpaff jenpaff added this to the v1.4.9 milestone Jun 16, 2025
Rjected added a commit that referenced this pull request Jun 16, 2025
@jenpaff jenpaff moved this from Done to Completed in Reth Tracker Jun 17, 2025
PeaStew pushed a commit to NeuraProtocol/reth-new-consensus that referenced this pull request Jun 24, 2025
Co-authored-by: Alexey Shekhirin <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
PeaStew pushed a commit to NeuraProtocol/reth-new-consensus that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-trie Related to Merkle Patricia Trie implementation C-enhancement New feature or request C-perf A change motivated by improving speed, memory usage or disk footprint

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

5 participants