-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat!: deploy Blobstream at a custom nonce #255
feat!: deploy Blobstream at a custom nonce #255
Conversation
WalkthroughThe changes primarily revolve around the introduction of a new concept, Changes
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- src/Blobstream.sol (1 hunks)
- src/lib/verifier/test/DAVerifier.t.sol (2 hunks)
- src/lib/verifier/test/RollupInclusionProofs.t.sol (2 hunks)
- src/test/Blobstream.t.sol (4 hunks)
- src/test/BlobstreamBenchmark.t.sol (2 hunks)
Files skipped from review due to trivial changes (2)
- src/Blobstream.sol
- src/test/BlobstreamBenchmark.t.sol
Additional comments: 9
src/lib/verifier/test/RollupInclusionProofs.t.sol (2)
214-216: The
initialize
function now uses a domain-separated hashcheckpoint
instead of the originalvalidatorSetHash
. Ensure that this change is reflected in all calls toinitialize
throughout the codebase.370-379: The
domainSeparateValidatorSetHash
function is introduced to compute a domain-separated hash using the validator set hash, nonce, and power threshold. This function seems to be correctly implemented, but it would be good to add some unit tests to verify its behavior.src/lib/verifier/test/DAVerifier.t.sol (2)
80-82: The
initialize
function of thebridge
contract is now called with thecheckpoint
value instead of thehash
value. Ensure that theinitialize
function in thebridge
contract has been updated to accept this new argument and that it is being used correctly within the function.202-211: The
domainSeparateValidatorSetHash
function is a new addition that computes a domain-separated hash using the validator set hash, nonce, and power threshold. This function seems to be implemented correctly, but it would be good to add some tests to ensure its correctness.src/test/Blobstream.t.sol (5)
33-40: The
setUp()
function has been updated to initializeinitialVelsetNonce
to 1 instead of 0. Ensure that this change is reflected in all calls tosetUp()
throughout the codebase.43-52: The
testUpdateValidatorSet()
function has been updated to initializeinitialVelsetNonce
andnewNonce
to 1 and 2 respectively, instead of 0 and 1. Ensure that this change is reflected in all calls totestUpdateValidatorSet()
throughout the codebase.70-74: The
testSubmitDataRootTupleRoot()
function has been updated to initializeinitialVelsetNonce
andnonce
to 1 and 2 respectively, instead of 0 and 1. Ensure that this change is reflected in all calls totestSubmitDataRootTupleRoot()
throughout the codebase.92-119: A new function
testDeployContractAtCustomNonce()
has been added. This function tests the deployment of the contract at a custom nonce. Ensure that this function is called in the appropriate test cases.131-134: The
testVerifyAttestation()
function has been updated to initializeinitialVelsetNonce
andnonce
to 1 and 2 respectively, instead of 0 and 1. Ensure that this change is reflected in all calls totestVerifyAttestation()
throughout the codebase.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- wrappers/Blobstream.sol/wrapper.go (2 hunks)
Files not summarized due to errors (1)
- wrappers/Blobstream.sol/wrapper.go: Error: Message exceeds token limit
Files not reviewed due to errors (1)
- wrappers/Blobstream.sol/wrapper.go (Error: diff too large)
|
||
// LOGS | ||
|
||
emit ValidatorSetUpdatedEvent(_nonce, _powerThreshold, _validatorSetHash); |
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.
[Note to reviewers]
removes emitting this event since we no longer have the validator set hash but the checkpoint. However, in other updates, we have the hash, so not sure how important this event is
@@ -89,6 +89,35 @@ contract RelayerTest is DSTest { | |||
assertEq(bridge.state_dataRootTupleRoots(nonce), newTupleRoot); | |||
} | |||
|
|||
function testDeployContractAtCustomNonce() public { | |||
uint256 initialVelsetNonce = 1; | |||
uint256 targetNonce = 200; |
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.
[Note to reviewers]
deploying starting nonce 200 while the valset is of nonce 1. No need to add a test also for submitting valset changes in this scenario since its the same as submitting data commitments
Co-authored-by: John Adler <[email protected]>
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.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- wrappers/Blobstream.sol/wrapper.go (2 hunks)
Files not summarized due to errors (1)
- wrappers/Blobstream.sol/wrapper.go: Error: Message exceeds token limit
Files not reviewed due to errors (1)
- wrappers/Blobstream.sol/wrapper.go (Error: diff too large)
Overview
Closes #251
Checklist
Summary by CodeRabbit
initialize
function in theBlobstream
contract to use the computedcheckpoint
instead of the originalhash
value.testDeployContractAtCustomNonce()
and made adjustments to nonce values in various test functions._validatorSetHash
to_validatorSetCheckpoint
in theBlobstream
contract and removed theValidatorSetUpdatedEvent
.