Skip to content

Commit d8ab4e2

Browse files
committed
add more log to indicate progress
1 parent 1c48136 commit d8ab4e2

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

crates/client/src/state_dump.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,16 @@ pub fn export_space_accounts_with_callback<F: Fn(AccountState)>(
271271
StorageKeyWithSpace::from_key_bytes::<SkipInputCheck>(&key);
272272
if storage_key_with_space.space != space {
273273
core_space_key_count += 1;
274-
if core_space_key_count % 10000 == 0 {
275-
println(&format!(
276-
"total_key_count: {}, core_space_key_count: {}",
277-
total_key_count, core_space_key_count
278-
));
279-
}
280274
return;
281275
}
282276

277+
if total_key_count % 10000 == 0 {
278+
println(&format!(
279+
"total_key_count: {}, core_space_key_count: {}",
280+
total_key_count, core_space_key_count
281+
));
282+
}
283+
283284
if let StorageKey::AccountKey(address_bytes) =
284285
storage_key_with_space.key
285286
{

crates/dbs/storage/src/impls/single_mpt_state.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use primitives::{
1010
EpochId, MerkleHash, MptValue, StateRoot, StorageKeyWithSpace,
1111
MERKLE_NULL_NODE,
1212
};
13+
use rustc_hex::ToHex;
1314
use std::{cell::UnsafeCell, sync::Arc};
1415

1516
pub struct SingleMptState {
@@ -312,7 +313,17 @@ impl SingleMptState {
312313
) -> Result<()> {
313314
self.ensure_temp_slab_for_db_load();
314315

316+
let mut total_key_count: u64 = 0;
317+
315318
let mut inner_callback = |(k, v): MptKeyValue| {
319+
total_key_count += 1;
320+
if total_key_count % 10000 == 0 {
321+
println!(
322+
"read_all_with_callback_impl -> total_key_count: {} {}",
323+
total_key_count,
324+
k.to_hex::<String>()
325+
);
326+
}
316327
if v.len() > 0 {
317328
callback((k, v));
318329
}

0 commit comments

Comments
 (0)