Skip to content

Commit af1d8a6

Browse files
committed
split state dump into multiple task
1 parent 7bee403 commit af1d8a6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/client/src/state_dump.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ pub fn export_space_accounts_with_callback<F: Fn(AccountState)>(
276276
"[{}] Start to iterate state...",
277277
Utc::now().format("%Y-%m-%d %H:%M:%S")
278278
);
279+
let mut found_accounts = 0;
279280

280281
for i in 0..=255 {
281282
let prefix = [i];
@@ -314,7 +315,7 @@ pub fn export_space_accounts_with_callback<F: Fn(AccountState)>(
314315
Utc::now().format("%Y-%m-%d %H:%M:%S")
315316
);
316317
}
317-
let mut found_accounts = 0;
318+
318319
for (_address, account) in account_states {
319320
let account_state = get_account_state(state, &account, config)?;
320321
callback(account_state);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl SingleMptState {
267267
self.pre_modification();
268268
}
269269

270-
// Retrieve and delete key/value pairs from delta trie
270+
// Retrieve and delete key/value pairs from single mpt trie
271271
let trie_kvs = {
272272
let key_prefix = access_key_prefix.to_key_bytes();
273273
let deleted = if AM::READ_ONLY {
@@ -294,8 +294,6 @@ impl SingleMptState {
294294
let mut result = Vec::new();
295295
if let Some(kvs) = trie_kvs {
296296
for (k, v) in kvs {
297-
let storage_key = StorageKeyWithSpace::from_delta_mpt_key(&k);
298-
let k = storage_key.to_key_bytes();
299297
if v.len() > 0 {
300298
result.push((k, v));
301299
}

docs/commands/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ Note:
9393
4. When performing state export, please stop the node program first, then execute the export operation in the node directory.
9494
5. Please use the binary corresponding to the network and execute the export operation in the corresponding network data directory; `do not` use `testnet or master` code compiled binary to execute export operations on `mainnet data`.
9595
6. If the state is very big, recommand export state into multi file, through arg `--multifile`
96-
7. When running this command on mainnnet or testnet, recommend open below configs
96+
7. When this command start, it will first sync to latest block(if your node is not fully synced, this step will take long time), and then do the state export operation
97+
8. When running this command on mainnnet or testnet, recommend open below configs
9798
```toml
9899
storage_delta_mpts_cache_size=10_000_0000
99100
storage_delta_mpts_cache_start_size=1_000_0000

0 commit comments

Comments
 (0)