Skip to content

Commit 91248cc

Browse files
add account tree log
1 parent b48a087 commit 91248cc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

crates/trie/parallel/src/parallel_root.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,17 @@ where
136136
hashed_cursor_factory.hashed_account_cursor().map_err(ProviderError::Database)?,
137137
);
138138

139+
let account_tree_start = std::time::Instant::now();
139140
let mut hash_builder = HashBuilder::default().with_updates(retain_updates);
140141
let mut account_rlp = Vec::with_capacity(128);
141142
while let Some(node) = account_node_iter.try_next().map_err(ProviderError::Database)? {
142143
match node {
143144
TrieElement::Branch(node) => {
145+
tracker.inc_branch();
144146
hash_builder.add_branch(node.key, node.value, node.children_are_in_trie);
145147
}
146148
TrieElement::Leaf(hashed_address, account) => {
149+
tracker.inc_leaf();
147150
let (storage_root, _, updates) = match storage_roots.remove(&hashed_address) {
148151
Some(result) => result,
149152
// Since we do not store all intermediate nodes in the database, there might
@@ -181,15 +184,18 @@ where
181184
prefix_sets.destroyed_accounts,
182185
);
183186

187+
let account_tree_duration = account_tree_start.elapsed();
184188
let stats = tracker.finish();
185189

186190
#[cfg(feature = "metrics")]
187191
self.metrics.record_state_trie(stats);
188192

189-
trace!(
193+
debug!(
190194
target: "trie::parallel_state_root",
191195
%root,
192196
duration = ?stats.duration(),
197+
account_tree_duration = ?account_tree_duration,
198+
storage_trees_duration = ?(stats.duration() - account_tree_duration),
193199
branches_added = stats.branches_added(),
194200
leaves_added = stats.leaves_added(),
195201
missed_leaves = stats.missed_leaves(),

0 commit comments

Comments
 (0)