You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we only have a StateRoot implementation for the BMPT (#36). However, in live sync mode, the engine uses a ParallelStateRoot object, which computes all storage tries in parallel. We should create a ParallelStateRoot type for the BMPT, introduce a ParallelStateRootProvider, and include it in the StateCommitment type.
Describe the feature
Currently, we only have a
StateRoot
implementation for the BMPT (#36). However, in live sync mode, the engine uses aParallelStateRoot
object, which computes all storage tries in parallel. We should create aParallelStateRoot
type for the BMPT, introduce aParallelStateRootProvider
, and include it in theStateCommitment
type.Implementation
First, we should review usage of the
ParallelStateRoot
object within the reth codebase and implement aDatabaseParallelStateRoot
trait in https://github.com/scroll-tech/reth/blob/scroll/crates/trie/db/src/state.rs. We should then introduce aParallelStateRoot
type for scroll in https://github.com/scroll-tech/reth/tree/scroll/crates/scroll/state-commitment/src/root. We should implementDatabaseParallelStateRoot
on both the scroll and nativeParallelStateRoot
types. We should addParallelStateRoot
GAT which is bound byDatabaseParallelStateRoot
inStateCommitment
. We should update the concrete implementations ofStateCommitment
for both BMPT and MPT. We should introduce aParallelStateRootProvider
in https://github.com/scroll-tech/reth/tree/scroll/crates/storage/provider. Alternatively, it may be sufficient to add additional methods toStateRootProviderExt
if we only use theParallelStateRoot
when calculating the state root for the most recent state (this should be investigated).reth/crates/storage/storage-api/src/trie.rs
Lines 46 to 78 in b456d1f
We should replace direct instantiation and invocation of
ParallelStateRoot
in the codebase with invocations of the provider methods.Additional context
No response
The text was updated successfully, but these errors were encountered: