-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ShardUId #4659
Implement ShardUId #4659
Conversation
chain/chain/src/chain.rs
Outdated
self.runtime_adapter.get_state_root_node(shard_id, &chunk_header.prev_state_root())?; | ||
let state_root_node = self.runtime_adapter.get_state_root_node( | ||
shard_id, | ||
&sync_hash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid that sync_hash
is not what you want here because sync_hash
is the first block of the new block and I believe here the chunk could be included in a block in the previous epoch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but we will disable state sync for epoch changes where resharding happens. I will add a comment here noting that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an issue #4711 noting this
looks like CI is still failing |
Given how invasive this change is, could you run nayduck to see that no test regresses? |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Estimator changes looks good to me, leaving approval to unblock the PR. I haven't looked at the change as a whole.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@frol @bowenwang1996 hmm I realized that #4709 will not fix the I'm not sure when is the next time we will make the next release. Is there any way to bypass that? |
Do you need just the branch or do you need a specific commit? If you just need it to be included in the branch, feel free to cherry-pick the commit on top of 1.21.0 branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly checked runtime part, and looks good!
This PR implements ShardUId as specified in near/NEPs#241 so that trie states are indexed by 'shard_uid
instead of
shard_id`.The main change is to change the interface around trie storage to use
shard_uid
instead ofshard_id
. The database columnsColState
andColTrieChanges
are now indexed byshard_uid
instead ofshard_id
.Changes that this PR does not include:
account_id_to_shard_id
to account for changing shard layoutTest Plan:
The main source for errors is where
shard_id
andshard_uid
is mixed up or the wrongshard_version
is used forshard_uid
, which may result inDB not found error
. To test for the first type, we will change a wide range of existing unit and integration tests to use a shard layout with shard_version = 1 soshard_id
andshard_uid
cannot be mixed up.