feat(flashblocks): add streaming state root calculation infrastructure#635
Open
feat(flashblocks): add streaming state root calculation infrastructure#635
Conversation
Implement a background task that incrementally computes state root during transaction execution to reduce finalization latency. - Add StateRootTask module for streaming state updates - Add --flashblocks.streaming-state-root CLI flag - Add finalize_payload_with_streaming and build_block_with_state_root - Pre-fetch trie nodes and build sparse trie incrementally Closes base#622
Collaborator
🟡 Heimdall Review Status
|
Contributor
|
@Farukest took a first pass at the code, for a complete implementation we'd need to have trie node prefetching implemented. |
…e root This implements trie node prefetching as part of the streaming state root calculation feature. When state updates arrive during transaction execution, background tasks are spawned to pre-warm the trie cache by computing storage roots for touched accounts. Key changes: - Add spawn_prefetch_tasks() to handle async prefetch spawning - Add prefetch_storage_root() for cache warming via storage root computation - Add max_prefetch_tasks config option (default: 64 concurrent tasks) - Use Arc-wrapped provider for sharing with prefetch tasks - Add atomic counter to track and limit active prefetch tasks - Add tests for prefetch enabled/disabled scenarios This reduces finalization latency by ensuring trie nodes are already in memory when the final state root computation happens, rather than waiting for disk I/O at that critical moment.
Contributor
Author
Resolve merge conflicts after op-rbuilder to builder-core refactoring: - Resolve config.rs content conflict - Move state_root_task.rs to new crates/builder/core/src/flashblocks/ location - Update flashblocks/mod.rs to include state_root_task module - Update lib.rs to export StateRootTask types
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.
Summary
StateRootTaskmodule for streaming state root calculation during transaction execution--flashblocks.streaming-state-rootCLI flag to enable the featureTest plan
--flashblocks.streaming-state-root=trueflagCloses #622