Closed wacban closed 1 month ago
Attention: Patch coverage is 93.75000%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 71.60%. Comparing base (
e5aa208
) to head (797ce1f
). Report is 6 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
core/primitives/src/shard_layout.rs | 93.68% | 11 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
We might want to do sth with ShardUId::next_shard_prefix()
.
Also, there is remove_range_by_shard_uid()
:
fn remove_range_by_shard_uid(store_update: &mut StoreUpdate, shard_uid: ShardUId, col: DBCol) {
let key_from = shard_uid.to_bytes();
let key_to = ShardUId::next_shard_prefix(&key_from);
store_update.delete_range(col, &key_from, &key_to);
}
Reviewers, can you have another look please? The most notable change is that the mapping is now from account range to shard id (used to be the other way around). It will allows us to optimize the account id to shard mapping in the future. Also addressed the comments and did some cleanups.
Adding a new shard layout structure. It replaces the boundary accounts with a mapping from shard id to the account range of that shard. This is necessary in order to implement the account id to shard id mapping. Previously it relied on shard ids being contiguous and ordered by the account ranges, neither of which will be the case in this shard layout.