Skip to content

Commit bb447b2

Browse files
committed
Important: unify the insertion of child key values
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.
1 parent 7b67beb commit bb447b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

substrate/client/network/sync/src/strategy/state_sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ where
150150
is_top && well_known_keys::is_child_storage_key(key_value.0.as_slice())
151151
});
152152

153-
for key_value in child_key_values {
154-
self.insert_child_trie_roots(key_value);
155-
}
156-
157153
let entry = self.state.entry(state_root).or_default();
158154

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

167163
entry.0.extend(top_key_values);
164+
165+
for key_value in child_key_values {
166+
self.insert_child_trie_roots(key_value);
167+
}
168168
}
169169
}
170170

0 commit comments

Comments
 (0)