-
Notifications
You must be signed in to change notification settings - Fork 56
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
Westlad/fix restart nightfall #564
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
Westlad
requested review from
IlyasRidhuan,
signorecello,
ChaitanyaKonda,
druiz0992 and
daveroga
March 4, 2022 16:10
signorecello
reviewed
Mar 8, 2022
druiz0992
reviewed
Mar 10, 2022
druiz0992
reviewed
Mar 10, 2022
druiz0992
reviewed
Mar 10, 2022
druiz0992
reviewed
Mar 13, 2022
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.
Will some of these changes be also required for a challenger registration?
@druiz0992 I think not because challengers don't register on-chain - but it remains to be seen. |
druiz0992
approved these changes
Mar 19, 2022
druiz0992
added
the
One more approval needed
One reviewer has approved this PR but another is needed
label
Mar 19, 2022
IlyasRidhuan
approved these changes
Mar 21, 2022
ChaitanyaKonda
added
PRIORITY 0
and removed
One more approval needed
One reviewer has approved this PR but another is needed
labels
Mar 21, 2022
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.
fixes #375
When nightfall is stopped and restarted, its containers should re-sync with the blockchain and it should carry on working. This was buggy for two reasons, which this PR fixes:
optimist
stops and loses its database, it does not know which proposers are registered with it. Therefore it will not make blocks for them when they are the current proposer. The proposers are still registered with the blockchain, however, and so should be able to make blocks when it's their turn in the round-robin. This PR adds a check to the/register
endpoint. It checks whether the proposer is (a) already registered with the blockchain and (b) already registered with theoptimist
instance. It then registers on an as-needed basis. This is transparent to the caller.client
did not sync if its commitment database had been dropped (or a new instance was started). This meant that its Timber Merkle tree was out of sync with the blockchain and it was unable to performtransfer
L2 transactions.One result of the above fix is that the ping-pong test can now be run repeatedly without resetting nightfall.
One can demonstrate the effectiveness with a ping-pong test:
./pong-down
ordocker-compose down
(the former will dropclient
's DB, the latter will not). Do not do./pong-down -v
because this will remove the trusted setup and smart contract addresses., effectively starting again with a clean environment../pong-nightfall -s
or./pong-nightfall -d -s
. The former will run up nightfall without runningdeployer
first, thus guaranteeing no changes to the blockchain or trusted setup; the second will rundeployer
but deployer will work out that it has no work to do and will eventually exit without making changes. They are therefore equivalent.optimist
andclient
to finish syncing with the blockchain (maybe we should provide asyncing
endpoint so we can test for this programmatically)../pong-apps
. The test will succeed, whereas previously it would have failed.