Skip to content

Commit

Permalink
Important: unify the insertion of child key values
Browse files Browse the repository at this point in the history
Before this commit, every commit is an equalvalent rewrite.

This commit modifies the origin logic by moving the child_key_value
in `process_state_verified()` to the same place in `process_state_unverified()`.

Please review this very carefully.
  • Loading branch information
liuchengxu committed Oct 26, 2024
1 parent 7b67beb commit bb447b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions substrate/client/network/sync/src/strategy/state_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ where
is_top && well_known_keys::is_child_storage_key(key_value.0.as_slice())
});

for key_value in child_key_values {
self.insert_child_trie_roots(key_value);
}

let entry = self.state.entry(state_root).or_default();

if entry.0.len() > 0 && entry.1.len() > 1 {
Expand All @@ -165,6 +161,10 @@ where
}

entry.0.extend(top_key_values);

for key_value in child_key_values {
self.insert_child_trie_roots(key_value);
}
}
}

Expand Down

0 comments on commit bb447b2

Please sign in to comment.