-
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/informal q3 fixes #192
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces updates to the GitHub Actions workflow and the Changes
Possibly related PRs
Suggested labels
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
d80e695
to
f1ade7e
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 (4)
- contracts/core/Dispatcher.sol (3 hunks)
- contracts/libs/IbcErrors.sol (1 hunks)
- test/Dispatcher/Dispatcher.closeChannel.t.sol (1 hunks)
- test/Dispatcher/Dispatcher.t.sol (1 hunks)
Additional comments not posted (6)
contracts/libs/IbcErrors.sol (1)
33-33
: LGTM!The addition of the
invalidVersion()
error declaration to theIBCErrors
library is approved. It enhances the error handling capabilities of the library by allowing it to signal an additional specific error condition related to version validation.test/Dispatcher/Dispatcher.closeChannel.t.sol (1)
77-98
: LGTM!The addition of the
test_recvPacket_afterChannelCloseInit()
test function to theDispatcherCloseChannelTest
contract is approved. This test is well-structured and enhances the test coverage for the dispatcher contract by validating the behavior when a channel close initialization occurs but is not relayed to the polymer.The test simulates a scenario where the Dapp on the local chain triggers a channel close, and subsequently, it checks that any attempt to receive a packet from a remote chain after this closure results in a revert with the expected
channelIdNotFound
error. This ensures that the dispatcher maintains a consistent view of the channel's status.The test utilizes the
vm.expectRevert
function to assert the expected revert behavior when therecvPacket
function is called under these conditions.Overall, this test addition contributes to the robustness and reliability of the dispatcher contract.
test/Dispatcher/Dispatcher.t.sol (1)
180-191
: LGTM!The addition of the
test_chanOpenInit_fail_invalidVersion()
test function to theChannelHandshakeTestSuite
contract is approved. This test is well-structured and enhances the test coverage for the channel opening logic by validating the behavior when an invalid version is provided during the channel opening process.The test sets up a scenario where the local end initiates a channel opening without a remote version being applied, which is expected to trigger a revert with the
invalidVersion
error. It iterates through a predefined set of channel handshake settings, ensuring that for each setting, the local end's version call is empty, and the expected revert behavior is correctly asserted using thevm.expectRevert
function.This test addition focuses on error handling related to version mismatches and contributes to the robustness and reliability of the channel opening process.
Overall, the test is well-designed and provides valuable coverage for an important failure scenario.
contracts/core/Dispatcher.sol (3)
181-183
: LGTM!The added check ensures that the
version
parameter is not empty when initializing a channel. This strengthens the input validation and aligns with the AI-generated summary.
399-402
: LGTM!Deleting the
_channelIdToConnection
mapping for thechannelId
in theChannelCloseInit
function is a good addition. It ensures that any proof-dependent calls related to the channel are effectively "bricked" after the channel close is initiated, maintaining consistency in the dispatcher's view of the channel across both local and proof-dependent logic. The change aligns with the AI-generated summary.
459-463
: LGTM!Deleting the
_channelIdToConnection
mapping for thechannelId
in theChannelCloseConfirm
function is a good addition, similar to the change inChannelCloseInit
. It ensures that any proof-dependent calls related to the channel are effectively "bricked" after the channel close is confirmed, maintaining consistency in the dispatcher's view of the channel across both local and proof-dependent logic. The change aligns with the AI-generated summary.
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 (4)
- contracts/core/Dispatcher.sol (3 hunks)
- contracts/libs/IbcErrors.sol (1 hunks)
- test/Dispatcher/Dispatcher.closeChannel.t.sol (1 hunks)
- test/Dispatcher/Dispatcher.t.sol (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- contracts/libs/IbcErrors.sol
- test/Dispatcher/Dispatcher.closeChannel.t.sol
Additional comments not posted (4)
test/Dispatcher/Dispatcher.t.sol (1)
180-191
: LGTM!The new test function
test_chanOpenInit_fail_invalidVersion
is a valuable addition to the test suite. It correctly tests the behavior ofchannelOpenInit
when an invalid version is provided and expects the appropriate revert with theinvalidVersion
error.The test iterates through a set of channel handshake settings to ensure comprehensive coverage.
Great work on enhancing the test coverage for the channel opening logic!
contracts/core/Dispatcher.sol (3)
181-183
: LGTM!The added validation check in the
ChannelOpenInit
function is a valuable improvement. It ensures that theversion
parameter is not empty and reverts with aninvalidVersion
error if it is.This change strengthens the input validation for channel opening and enhances the robustness of the contract by enforcing that a valid version is always provided.
Well done on improving the contract's input validation!
399-402
: LGTM!The deletion of the
_channelIdToConnection
mapping for thechannelId
in theChannelCloseInit
function is a good practice. It ensures that any proof-dependent calls related to the channel are effectively "bricked" and maintains consistency in the dispatcher's view of the channel across both local and proof-dependent logic.The accompanying comment provides a clear rationale for the deletion, emphasizing the importance of consistent behavior even in the absence of relayed events.
This change enhances the overall consistency and robustness of the contract by maintaining a coherent state across channel operations.
Great work on improving the contract's consistency and clarity!
459-462
: LGTM!The deletion of the
_channelIdToConnection
mapping for thechannelId
in theChannelCloseConfirm
function is a good practice, similar to the changes made in theChannelCloseInit
function. It ensures that any proof-dependent calls related to the channel are effectively "bricked" and maintains consistency in the dispatcher's view of the channel across both local and proof-dependent logic.The accompanying comment provides a clear rationale for the deletion, emphasizing the importance of consistent behavior even in the absence of relayed events.
This change enhances the overall consistency and robustness of the contract by maintaining a coherent state across channel operations.
Excellent work on improving the contract's consistency and clarity!
ce42ad3
to
515d592
Compare
d0c9fa2
to
227a716
Compare
227a716
to
dd01c21
Compare
PR to address findings in the informal audit:
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores