Conversation
…nd add benchmarks
Apply trie updates to FlashblocksState via a local cache instead of mutating through Option in the state-root block. Cache trie updates in trie_updates_to_cache and set prev_trie_updates when consuming fb_state later, so the signature can stay fb_state: Option<&mut FlashblocksState> without requiring mut on the parameter. Made-with: Cursor
akundaz
approved these changes
Mar 5, 2026
Vui-Chee
added a commit
to okx/xlayer-reth
that referenced
this pull request
Mar 9, 2026
Align with upstream flashbots/op-rbuilder#427: - Wrap trie_output in Arc once upfront instead of cloning then wrapping - Reuse same Arc allocation for both executed block and fb_state cache - Remove trie cache benchmark and related dev dependencies (criterion, reth-trie-db)
louisliu2048
pushed a commit
to okx/xlayer-reth
that referenced
this pull request
Mar 10, 2026
…ate root (#163) * feat(builder): port incremental trie cache optimization for flashblocks state root Port flashbots/op-rbuilder#385 - caches TrieUpdates after each flashblock state root calculation so subsequent flashblocks reuse cached trie nodes instead of recomputing from the database each time, achieving ~2.4-2.5x speedup in state root calculation. Changes: - Add `prev_trie_updates: Option<Arc<TrieUpdates>>` field to FlashblocksState - Use `state_root_from_nodes_with_updates` with cached trie on subsequent flashblocks - Cache trie updates after each calculation and propagate to next flashblock - Add criterion benchmark: bench_flashblocks_state_root - Add reth-trie-db and criterion workspace dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * perf: remove trie updates clone and allocation, remove benchmarks Align with upstream flashbots/op-rbuilder#427: - Wrap trie_output in Arc once upfront instead of cloning then wrapping - Reuse same Arc allocation for both executed block and fb_state cache - Remove trie cache benchmark and related dev dependencies (criterion, reth-trie-db) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Rebased from #385 with slight trie updates allocation improvements.
@cliff0412