-
Notifications
You must be signed in to change notification settings - Fork 247
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
Make the domain client instantiation-aware #1716
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This value will be used in later commit Signed-off-by: linning <[email protected]>
This value indicate the consensus block number that the domain instance first instantiated Signed-off-by: linning <[email protected]>
Before this commit, the domain client assume that the domain chain start at the consensus chain's genesis block, but in domain v2, the domain chain only start after it is instantiated at the consensus chain, namely started at domain_created_at, this commit recorrect this assumption and handling various edge cases properly Signed-off-by: linning <[email protected]>
NingLin-P
requested review from
liuchengxu,
vedhavyas,
nazar-pc and
rg3l3dr
as code owners
July 28, 2023 22:00
…le the consensus block even it is out of order Signed-off-by: linning <[email protected]>
NingLin-P
force-pushed
the
domain-instance-fix
branch
from
July 28, 2023 22:23
6bdf25c
to
672c149
Compare
liuchengxu
previously approved these changes
Jul 31, 2023
vedhavyas
reviewed
Jul 31, 2023
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.
Some nits
vedhavyas
previously approved these changes
Jul 31, 2023
NingLin-P
force-pushed
the
domain-instance-fix
branch
from
July 31, 2023 12:44
077fe91
to
ad52f72
Compare
NingLin-P
force-pushed
the
domain-instance-fix
branch
from
July 31, 2023 18:32
5a15060
to
8e373c4
Compare
liuchengxu
approved these changes
Aug 1, 2023
ParthDesai
added a commit
to autonomys/subspace-pulsar-sdk
that referenced
this pull request
Aug 5, 2023
ParthDesai
added a commit
to autonomys/subspace-pulsar-sdk
that referenced
this pull request
Aug 5, 2023
ParthDesai
added a commit
to autonomys/subspace-pulsar-sdk
that referenced
this pull request
Aug 15, 2023
ParthDesai
added a commit
to autonomys/subspace-pulsar-sdk
that referenced
this pull request
Aug 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the main branch, the domain client assumes that the domain chain will start at the genesis block of the consensus chain. This is not true in domain v2, where the domain chain is started after the domain is instantiated at the consensus chain, for the genesis domain it starts at consensus block
#1
due to our workaround of the extension issue. This PR recorrects this assumption in the domain client and handles various edge cases properly.The error we meet in the devnet:
is because the domain block processor handles the consensus block out of order (i.e. the first consensus block being processed is not block
#1
), this can happen if the consensus chain import block when the domain chain is still initializing:https://github.com/subspace/subspace/blob/d2b394445acb5c8f1be3b62501f47e805a73ca9a/domains/client/domain-operator/src/domain_worker.rs#L97-L109
this PR's last commit (although very tiny) adds a test case to simulate this error (pick this commit to the main branch and run the test, which will result in the same error) and ensure it is fixed.
Code contributor checklist: