-
Notifications
You must be signed in to change notification settings - Fork 26
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
Raunak/dispatcher upgrade testing #81
Conversation
WalkthroughThe update focuses on refining the vIBC protocol's smart contracts by restructuring, updating Solidity versions, and enhancing contract structures and interfaces. It includes optimizations and new features across core contracts, interfaces, and libraries to improve clarity, efficiency, and compliance with coding standards. Changes
Possibly related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
42f41bf
to
6b7a30b
Compare
6b7a30b
to
fb75529
Compare
16eee0f
to
76c46dd
Compare
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.
Actionable comments posted: 3
Out of diff range and nitpick comments (5)
contracts/base/GeneralMiddleware.sol (1)
16-21
: TheGeneralMiddleware
class is well-documented and serves as a good starting point for middleware development. Consider adding more detailed comments for public methods to guide developers.test/Dispatcher/Dispatcher.proof.t.sol (1)
18-34
: TheDispatcherProofTestUtils
class is well-implemented and provides necessary functionalities for loading and handling proofs in tests. Ensure that the test descriptions are clear and descriptive to help other developers understand the test scenarios.contracts/libs/Ibc.sol (1)
258-308
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [171-307]
The new utility functions for handling proofs and converting data types are well-implemented. Consider adding more detailed comments to these functions to improve their understandability and ease of use.
test/upgradeableProxy/Dispatcher.upgrade.t.sol (1)
41-47
: TheupgradeDispatcher
function is well-implemented and provides necessary functionalities for upgrading the Dispatcher contract. Ensure that the function description is clear and descriptive to help other developers understand its purpose and usage.contracts/core/Dispatcher.sol (1)
22-28
: The contract description is clear and informative. However, consider consolidating the multiple@notice
tags into a single comprehensive description to enhance readability.
679f504
to
d3ca2db
Compare
dee7968
to
7e2d744
Compare
03642e2
to
596f2fd
Compare
02837cc
to
cff09c3
Compare
91d32e4
to
6847751
Compare
6847751
to
3f57d4b
Compare
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- test/Dispatcher/Dispatcher.proof.t.sol (1 hunks)
- test/Dispatcher/Dispatcher.t.sol (2 hunks)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (5 hunks)
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (1 hunks)
- test/utils/Dispatcher.base.t.sol (1 hunks)
Files skipped from review due to trivial changes (1)
- test/Dispatcher/Dispatcher.proof.t.sol
Additional comments not posted (7)
test/utils/Dispatcher.base.t.sol (1)
191-194
: ThegenAckPacket
function correctly generates an acknowledgment packet for a given packet sequence.test/upgradeableProxy/Dispatcher.upgrade.t.sol (2)
40-40
: TheupgradeDispatcher
function correctly handles the upgrade and initialization of the Dispatcher contract.
51-59
: ThedeployDispatcherRC4ProxyAndImpl
function correctly handles the deployment and initialization of the Dispatcher RC4 contract using an ERC1967 proxy.test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (2)
40-71
: ThesetUp
function correctly handles the setup of the testing environment, including the deployment of Dispatcher RC4 and setting initial state.
73-92
: Thetest_SentPacketState_Conserved_RC4_Upgrade
test case correctly checks if the packet state is conserved after upgrading Dispatcher RC4.test/Dispatcher/Dispatcher.t.sol (2)
16-16
: Thetest_openChannel_initiator_ok
test case correctly checks the successful opening of a channel when the local end is the initiator.
16-16
: Thetest_openChannel_receiver_ok
test case correctly checks the successful opening of a channel when the remote end is the receiver.
b774356
to
3161ac7
Compare
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- test/Dispatcher/Dispatcher.multiclient.sol (1 hunks)
- test/Dispatcher/Dispatcher.proof.t.sol (2 hunks)
- test/Dispatcher/Dispatcher.t.sol (2 hunks)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (5 hunks)
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (1 hunks)
- test/utils/Dispatcher.base.t.sol (4 hunks)
Files not reviewed due to errors (1)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (no review received)
Files skipped from review as they are similar to previous changes (5)
- test/Dispatcher/Dispatcher.multiclient.sol
- test/Dispatcher/Dispatcher.proof.t.sol
- test/Dispatcher/Dispatcher.t.sol
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol
- test/utils/Dispatcher.base.t.sol
3161ac7
to
ceddaa9
Compare
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.
Actionable comments posted: 2
Out of diff range and nitpick comments (1)
test/upgradeableProxy/Dispatcher.upgrade.t.sol (1)
36-40
: Consider documenting the purpose ofconnectionHops0
andconnectionHops1
arrays.These arrays are used in the upgrade process, and documenting their specific roles or the scenarios they represent could improve code readability and maintainability.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- test/Dispatcher/Dispatcher.multiclient.sol (1 hunks)
- test/Dispatcher/Dispatcher.proof.t.sol (2 hunks)
- test/Dispatcher/Dispatcher.t.sol (2 hunks)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (5 hunks)
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (1 hunks)
- test/utils/Dispatcher.base.t.sol (4 hunks)
Files skipped from review as they are similar to previous changes (5)
- test/Dispatcher/Dispatcher.multiclient.sol
- test/Dispatcher/Dispatcher.proof.t.sol
- test/Dispatcher/Dispatcher.t.sol
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol
- test/utils/Dispatcher.base.t.sol
Additional comments not posted (2)
test/upgradeableProxy/Dispatcher.upgrade.t.sol (2)
73-103
: Ensure version compatibility during channel handshake.Given the complexity of version handling in channel handshakes, it's crucial to verify that all versions used are compatible with both the local and remote ends to prevent potential issues during runtime.
188-220
: Verify state conservation post-upgrade.It's crucial to ensure that the state is conserved across upgrades, especially for critical components like sequence numbers and packet commitments. This script will help verify that appropriate tests are in place.
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.
lgtm, approving to unblock conditioned on the last couple requests
ceddaa9
to
70df3c0
Compare
70df3c0
to
1a4ecea
Compare
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- test/Dispatcher/Dispatcher.multiclient.sol (1 hunks)
- test/Dispatcher/Dispatcher.proof.t.sol (2 hunks)
- test/Dispatcher/Dispatcher.t.sol (2 hunks)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (5 hunks)
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (1 hunks)
- test/utils/Dispatcher.base.t.sol (4 hunks)
Files not reviewed due to errors (1)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (no review received)
Files skipped from review as they are similar to previous changes (5)
- test/Dispatcher/Dispatcher.multiclient.sol
- test/Dispatcher/Dispatcher.proof.t.sol
- test/Dispatcher/Dispatcher.t.sol
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol
- test/utils/Dispatcher.base.t.sol
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.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- test/Dispatcher/Dispatcher.multiclient.sol (1 hunks)
- test/Dispatcher/Dispatcher.proof.t.sol (2 hunks)
- test/Dispatcher/Dispatcher.t.sol (2 hunks)
- test/upgradeableProxy/Dispatcher.upgrade.t.sol (5 hunks)
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol (1 hunks)
- test/utils/Dispatcher.base.t.sol (4 hunks)
Files skipped from review as they are similar to previous changes (5)
- test/Dispatcher/Dispatcher.multiclient.sol
- test/Dispatcher/Dispatcher.proof.t.sol
- test/Dispatcher/Dispatcher.t.sol
- test/upgradeableProxy/DispatcherRC4.upgrade.t.sol
- test/utils/Dispatcher.base.t.sol
Additional comments not posted (1)
test/upgradeableProxy/Dispatcher.upgrade.t.sol (1)
159-191
: LGTM! The function correctly tests the conservation of packet state after an upgrade.
PR to add upgrade testing to ensure that the v2.0.0-rc3 is compatible for an upgrade with the v2.0.0-pre-audit.
Seemed like proof generation might be a bit complex, so I'm settling for just mocking the calls to the proof verifier for now.
One thing I did discover through this testing was that the Channel struct was indeed incompatible since we were adding a portId to it to the beginning. Moving the portId to the end of the struct should solve this issue (the change is in the Ibc.sol file).
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests
Refactor