@@ -9,9 +9,9 @@ use rayon::iter::{ParallelBridge, ParallelIterator};
99use reth_trie:: { updates:: TrieUpdates , Nibbles } ;
1010use reth_trie_parallel:: root:: ParallelStateRootError ;
1111use reth_trie_sparse:: {
12- blinded:: { BlindedProvider , BlindedProviderFactory , DefaultBlindedProvider } ,
12+ blinded:: { BlindedProvider , BlindedProviderFactory } ,
1313 errors:: { SparseStateTrieResult , SparseTrieErrorKind } ,
14- SparseStateTrie , SparseTrie ,
14+ SparseStateTrie , SparseTrieState ,
1515} ;
1616use std:: {
1717 sync:: mpsc,
@@ -63,41 +63,39 @@ where
6363 }
6464 }
6565
66- /// Creates a new sparse trie, populating the accounts trie with the given cleared `SparseTrie`
67- /// if it exists.
66+ /// Creates a new sparse trie, populating the accounts trie with the given cleared
67+ /// `SparseTrieState` if it exists.
6868 pub ( super ) fn new_with_stored_trie (
6969 executor : WorkloadExecutor ,
7070 updates : mpsc:: Receiver < SparseTrieUpdate > ,
7171 blinded_provider_factory : BPF ,
7272 trie_metrics : MultiProofTaskMetrics ,
73- sparse_trie : Option < SparseTrie < DefaultBlindedProvider > > ,
73+ sparse_trie_state : Option < SparseTrieState > ,
7474 ) -> Self {
75- if let Some ( sparse_trie ) = sparse_trie {
75+ if let Some ( sparse_trie_state ) = sparse_trie_state {
7676 Self :: with_accounts_trie (
7777 executor,
7878 updates,
7979 blinded_provider_factory,
8080 trie_metrics,
81- sparse_trie ,
81+ sparse_trie_state ,
8282 )
8383 } else {
8484 Self :: new ( executor, updates, blinded_provider_factory, trie_metrics)
8585 }
8686 }
8787
88- /// Creates a new sparse trie task, using the given cleared `SparseTrie` for the accounts trie.
88+ /// Creates a new sparse trie task, using the given cleared `SparseTrieState` for the accounts
89+ /// trie.
8990 pub ( super ) fn with_accounts_trie (
9091 executor : WorkloadExecutor ,
9192 updates : mpsc:: Receiver < SparseTrieUpdate > ,
9293 blinded_provider_factory : BPF ,
9394 metrics : MultiProofTaskMetrics ,
94- cleared_accounts_trie : SparseTrie < DefaultBlindedProvider > ,
95+ sparse_trie_state : SparseTrieState ,
9596 ) -> Self {
9697 let mut trie = SparseStateTrie :: new ( blinded_provider_factory) . with_updates ( true ) ;
97-
98- if let SparseTrie :: Revealed ( cleared) = cleared_accounts_trie {
99- trie. populate_from ( cleared) ;
100- }
98+ trie. populate_from ( sparse_trie_state) ;
10199
102100 Self { executor, updates, metrics, trie }
103101 }
@@ -149,7 +147,7 @@ where
149147 self . metrics . sparse_trie_total_duration_histogram . record ( now. elapsed ( ) ) ;
150148
151149 // take the account trie
152- let trie = self . trie . take_cleared_account_trie ( ) ;
150+ let trie = self . trie . take_cleared_account_trie_state ( ) ;
153151
154152 Ok ( StateRootComputeOutcome { state_root, trie_updates, trie } )
155153 }
@@ -164,7 +162,7 @@ pub struct StateRootComputeOutcome {
164162 /// The trie updates.
165163 pub trie_updates : TrieUpdates ,
166164 /// The account state trie.
167- pub trie : SparseTrie < DefaultBlindedProvider > ,
165+ pub trie : SparseTrieState ,
168166}
169167
170168/// Updates the sparse trie with the given proofs and state, and returns the elapsed time.
0 commit comments