Skip to content
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

Update expectRevert reason in OptimismPortalKontrol & bump Kontrol version #10159

Merged

Conversation

JuanCoRo
Copy link
Contributor

Description

This PR

Something to note is that, at the moment, Kontrol doesn't support the signature expectRevert(bytes4) (see runtimeverification/kontrol#466), so instead of vm.expectRevert(CallPause.selector), we have to resort to vm.expectRevert(abi.encodeWithSelector(CallPaused.selector)). A follow-up PR will be made once support for the appropriate signature is in place.

Tests

No new tests are added. The ones in OptimismPortal.k.sol are modified as described above.

@JuanCoRo JuanCoRo requested a review from a team as a code owner April 15, 2024 21:01
@JuanCoRo JuanCoRo requested a review from clabby April 15, 2024 21:01
Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough

Walkthrough

The recent update in the OptimismPortalKontrol contract introduces a new error handling library, PortalErrors.sol, and modifies the error handling approach. The update involves encoding error selectors as bytes, addressing compatibility issues with bytes4. This enhancement primarily affects how errors are managed and reported within the contract, specifically in the expectRevert function calls.

Changes

File Path Change Summary
.../proofs/OptimismPortal.k.sol Introduced PortalErrors.sol library; updated error handling to use bytes encoding for error selectors.

Recent Review Details

Configuration used: .coderabbit.yml

Commits Files that changed from the base of the PR and between 4a157b4 and d3b5146.
Files ignored due to path filters (1)
  • versions.json is excluded by !**/*.json
Files selected for processing (1)
  • packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal.k.sol (3 hunks)
Additional comments not posted (3)
packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal.k.sol (3)

11-11: Import statement for PortalErrors.sol is correctly formatted and appears to be correctly placed.


31-34: Updated error handling using abi.encodeWithSelector(CallPaused.selector) is correctly implemented. This change is a valid workaround for the lack of bytes4 support as noted in the referenced issue.


55-58: The same update to error handling as above is correctly applied here. The use of abi.encodeWithSelector(CallPaused.selector) is appropriate given the current limitations of Kontrol.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mds1 mds1 enabled auto-merge April 15, 2024 21:10
@mds1 mds1 added this pull request to the merge queue Apr 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2024
@mds1 mds1 added this pull request to the merge queue Apr 16, 2024
Merged via the queue into ethereum-optimism:develop with commit fa19f9a Apr 16, 2024
67 of 69 checks passed
@mds1 mds1 deleted the fix/kontrol-error-codes branch April 16, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants