StateRootTask mode is counterproductive for RPC/Follower nodes #20065
louisliu2048
started this conversation in
Technical discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Reth defaults to
StateRootTaskmode for state root computation whenavailable_parallelism >= 5, but this mode is designed for Sequencer nodes and introduces significant overhead for RPC/Follower nodes that only validate blocks. Using--engine.state-root-fallback(Synchronous mode) provides much better performance for RPC nodes.Problem Description
The
plan_state_root_computation()function selects the state root strategy:On most modern machines (≥5 CPU cores), Reth defaults to StateRootTask mode.
Why StateRootTask is Counterproductive for RPC Nodes
StateRootTask is designed for Sequencer nodes, where:
For RPC/Follower nodes, the situation is completely different:
The overhead introduced by StateRootTask mode for RPC nodes includes:
All of this overhead provides zero benefit for RPC nodes since there's no parallel execution happening.
Performance Impact
In our local testing:
The RPC node was consistently falling behind the Sequencer until we enabled state_root_fallback.
Proposed Solution
Option 1: Auto-detect Node Role
Automatically detect whether the node is a Sequencer or RPC/Follower:
Option 2: Better Naming and Documentation
Option 3: Separate Configuration
Add a configuration option like
--engine.state-root-modewith values:Beta Was this translation helpful? Give feedback.
All reactions