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

feat(ctb): Support OptimismPortal2 in kontrol tests #10429

Merged
merged 7 commits into from May 13, 2024

Conversation

clabby
Copy link
Member

@clabby clabby commented May 7, 2024

Overview

Adds a second DeploymentSummary to kontrol for fault proofs, and
ports the existing OptimismPortal proofs with the OptimismPortal2.

@clabby clabby requested review from a team as code owners May 7, 2024 00:44
@clabby clabby requested review from mslipper and refcell May 7, 2024 00:44
Copy link
Contributor

coderabbitai bot commented May 7, 2024

Walkthrough

Walkthrough

The recent changes focus on enhancing deployment and testing frameworks in a blockchain project, emphasizing fault-proof deployment and withdrawal transaction proofs. New scripts, test cases, and configurations were introduced to support these features and improve performance, particularly targeting the functionalities of the Optimism Portal.

Changes

File Path Change Summary
.circleci/config.yml Updated patterns list to include OptimismPortal2.sol.
packages/contracts-bedrock/.gitignore Added entries for kontrol-fp.json and kontrol-fp.jsonReversed.
packages/contracts-bedrock/test/kontrol/README.md Added note on fault-proof summary deployment.
packages/contracts-bedrock/test/kontrol/deployment/... Introduced new test contracts and functions for deployment summaries and fault-proof testing.
packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal2.k.sol Added functions for proving withdrawal transactions in various scenarios.
packages/contracts-bedrock/test/kontrol/scripts/... Updated scripts for different deployment configurations and added test cases for OptimismPortal2Kontrol.
packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol Changed visibility modifier in setUp function of OptimismPortal2_Test.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 75f4eab and 584f398.
Files ignored due to path filters (1)
  • packages/contracts-bedrock/package.json is excluded by !**/*.json
Files selected for processing (11)
  • .circleci/config.yml (1 hunks)
  • packages/contracts-bedrock/.gitignore (1 hunks)
  • packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol (1 hunks)
  • packages/contracts-bedrock/test/kontrol/README.md (1 hunks)
  • packages/contracts-bedrock/test/kontrol/deployment/DeploymentSummaryFaultProofs.t.sol (1 hunks)
  • packages/contracts-bedrock/test/kontrol/deployment/KontrolDeployment.sol (1 hunks)
  • packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal2.k.sol (1 hunks)
  • packages/contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummaryFaultProofs.sol (1 hunks)
  • packages/contracts-bedrock/test/kontrol/scripts/common.sh (1 hunks)
  • packages/contracts-bedrock/test/kontrol/scripts/make-summary-deployment.sh (2 hunks)
  • packages/contracts-bedrock/test/kontrol/scripts/run-kontrol.sh (1 hunks)
Files not summarized due to errors (1)
  • packages/contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummaryFaultProofs.sol: Error: Message exceeds token limit
Files skipped from review as they are similar to previous changes (8)
  • .circleci/config.yml
  • packages/contracts-bedrock/.gitignore
  • packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol
  • packages/contracts-bedrock/test/kontrol/deployment/DeploymentSummaryFaultProofs.t.sol
  • packages/contracts-bedrock/test/kontrol/deployment/KontrolDeployment.sol
  • packages/contracts-bedrock/test/kontrol/scripts/common.sh
  • packages/contracts-bedrock/test/kontrol/scripts/make-summary-deployment.sh
  • packages/contracts-bedrock/test/kontrol/scripts/run-kontrol.sh
Additional Context Used
LanguageTool (20)
packages/contracts-bedrock/test/kontrol/README.md (20)

Near line 24: Unpaired symbol: ‘[’ seems to be missing
Context: ... Getting Started ### Overview [Kontrol](https://github.com/runtimeverification/...


Near line 64: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)?
Context: ... a deployment summary contract from the deploy script in [KontrolDeployment.sol](./d...


Near line 95: Loose punctuation mark.
Context: ...modes of proof execution: - container: Runs the proofs using the same Docker i...


Near line 96: Loose punctuation mark.
Context: ...will be executed in this mode. - local: Runs the proofs with your local Kontrol...


Near line 97: Loose punctuation mark.
Context: ...on](../../../../versions.json). - dev`: Run the proofs with your local Kontrol ...


Near line 101: Loose punctuation mark.
Context: ...ying which tests to execute: - script: Runs the tests specified in the `test_l...


Near line 118: Consider a shorter alternative to avoid wordiness.
Context: ... JSON contains correct updates. Hence, in order to write a proof for a contract which is n...


Near line 129: It seems that a comma is missing.
Context: ...oofs/interfaces/KontrolInterfaces.sol) So far we've got all the state updates ready t...


Near line 131: After an expression of time at the start of a sentence, a comma is usually used.
Context: ...f compiled contracts by Kontrol. In the future there might interfaces for all contract...


Near line 131: The modal verb ‘might’ requires the verb’s base form.
Context: ...s by Kontrol. In the future there might interfaces for all contracts under `contracts-bedr...


Near line 135: This expression is wordy and can make your writing hard to follow, try rephrasing to be more direct.
Context: ...stto avoidforge test` running them. The reason for this is that if Kontrol cheatcodes (see [Kontrol's o...


Near line 166: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)?
Context: ...s feasible without large changes to the deploy script. 2. Size of bytes[] arguments...


Near line 179: A comma may be missing after the conjunctive/linking adverb ‘Therefore’.
Context: ...l representation of the EVM in Kontrol. Therefore we want to minimize the amount of code ...


Near line 182: These punctuation marks differ from each other. Use only one if you are ending a sentence.
Context: ...usage of this fast summarization feature.: - kdeploy: Used by [`make-summary-de...


Near line 184: Loose punctuation mark.
Context: ...ast summarization feature.: - kdeploy: Used by [make-summary-deployment.sh](...


Near line 187: Loose punctuation mark.
Context: ...ited by DeploymentSummary. - kprove: Used by the [run-kontrol.sh](./scrpts...


Near line 193: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...nd DeploymentSummaryCode.sol contracts, because forge fails to build if those contracts...


Near line 193: The word “workaround” is a noun. The verb is spelled with a white space.
Context: ...ommit these autogenerated files than to workaround their absence in forge builds. During ...


Near line 196: The word ‘deploy’ is a verb. Did you mean the noun “deployment” (= release, placement)?
Context: ...o address. This is required because the deploy script in KontrolDeployment.sol is do...


Near line 196: The verb form seems incorrect.
Context: ...eploy script in KontrolDeployment.sol is does not fully reproduce all deployments in ...

Learnings (1)
packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal2.k.sol (2)
User: JuanCoRo
PR: ethereum-optimism/optimism#10292
File: packages/contracts-bedrock/test/kontrol/scripts/run-kontrol.sh:128-128
Timestamp: 2024-04-24T18:19:24.451Z
Learning: User JuanCoRo confirmed that the extra parenthesis in the test name `OptimismPortalKontrol.prove_proveWithdrawalTransaction_paused1(` does not introduce syntax errors and functions as intended in the `run-kontrol.sh` script as part of PR #10292. This was verified through local testing.
User: JuanCoRo
PR: ethereum-optimism/optimism#10292
File: packages/contracts-bedrock/test/kontrol/scripts/run-kontrol.sh:128-128
Timestamp: 2024-04-24T18:15:27.717Z
Learning: User JuanCoRo introduced an extra parenthesis in the test name `OptimismPortalKontrol.prove_proveWithdrawalTransaction_paused1(` to avoid matching with `OptimismPortalKontrol.prove_proveWithdrawalTransaction_paused10` in the `run-kontrol.sh` script as part of PR #10292. This is a workaround to handle test selection based on naming conventions.
Additional comments not posted (3)
packages/contracts-bedrock/test/kontrol/proofs/OptimismPortal2.k.sol (2)

29-29: Consider making the pause identifier configurable to enhance flexibility in testing.


53-53: Consider making the pause identifier configurable to enhance flexibility in testing.

packages/contracts-bedrock/test/kontrol/README.md (1)

70-71: Clarify the documentation on fault proof summary deployment.


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.

Copy link
Member Author

clabby commented May 7, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @clabby and the rest of your teammates on Graphite Graphite

@clabby clabby marked this pull request as draft May 7, 2024 00:46
@clabby clabby marked this pull request as ready for review May 7, 2024 01:06
@clabby clabby requested review from Inphi and mds1 and removed request for mslipper and refcell May 7, 2024 01:06
@clabby clabby self-assigned this May 7, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

packages/contracts-bedrock/test/kontrol/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
packages/contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummaryFaultProofs.sol (1)

10-645: Review the extensive use of vm.etch and vm.store.

The method recreateDeployment makes extensive use of vm.etch and vm.store to manipulate contract storage. This approach is powerful but should be used with caution to avoid unintended side effects or security vulnerabilities. Ensure that these operations are wrapped in adequate safety checks and validations, especially when used in a broader testing framework.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Out of diff range and nitpick comments (9)
packages/contracts-bedrock/test/kontrol/README.md (9)

Line range hint 24-24: Check for a possible missing closing bracket for the link to Kontrol's documentation.


Line range hint 95-97: Consider removing the extra spaces before the colons in the list items.


Line range hint 106-106: Consider adding a comma after "options" for better readability.


Line range hint 118-118: Consider simplifying the phrase "Hence, in order to write a proof for a contract which is not present in KontrolDeployment it must be added there first." to "To write a proof for a contract not present in KontrolDeployment, add it there first."


Line range hint 131-131: After "In the future," add a comma for better readability.


Line range hint 131-131: Change "there might interfaces" to "there might be interfaces".

- there might interfaces
+ there might be interfaces

Line range hint 166-166: Consider changing "deploy" to "deployment" for correct usage.

- changes to the deploy script
+ changes to the deployment script

Line range hint 179-179: Add a comma after "Therefore" for better readability.


Line range hint 193-193: Change "workaround" to "work around".

- to workaround their absence
+ to work around their absence

@clabby clabby force-pushed the cl/ctb/portal2-kontrol branch 2 times, most recently from 48d8bfb to 75f4eab Compare May 13, 2024 15:49
clabby and others added 5 commits May 13, 2024 11:49
Adds a second `DeploymentSummary` to `kontrol` for fault proofs, and
ports the existing `OptimismPortal` proofs with the `OptimismPortal2`.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Matt Solomon <matt@mattsolomon.dev>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Out of diff range and nitpick comments (1)
packages/contracts-bedrock/test/kontrol/proofs/utils/DeploymentSummaryFaultProofs.sol (1)

1-3: Ensure the file header comment is accurate and up-to-date.

The comment "Do not edit this file manually" is crucial for autogenerated files to prevent manual edits that could be overwritten. Ensure this policy is well communicated and adhered to.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

@clabby clabby added this pull request to the merge queue May 13, 2024
Merged via the queue into develop with commit 0ad342a May 13, 2024
72 checks passed
@clabby clabby deleted the cl/ctb/portal2-kontrol branch May 13, 2024 17:47
Inphi pushed a commit that referenced this pull request May 14, 2024
* feat(ctb): Support `OptimismPortal2` in kontrol tests

Adds a second `DeploymentSummary` to `kontrol` for fault proofs, and
ports the existing `OptimismPortal` proofs with the `OptimismPortal2`.

* summary tests

* Update packages/contracts-bedrock/test/kontrol/README.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* tests

* Update `check-snapshots`

* Update packages/contracts-bedrock/test/kontrol/README.md

Co-authored-by: Matt Solomon <matt@mattsolomon.dev>

* Separate snapshot gen

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Matt Solomon <matt@mattsolomon.dev>
clabby added a commit that referenced this pull request May 14, 2024
* feat(ctb): Support `OptimismPortal2` in kontrol tests

Adds a second `DeploymentSummary` to `kontrol` for fault proofs, and
ports the existing `OptimismPortal` proofs with the `OptimismPortal2`.

* summary tests

* Update packages/contracts-bedrock/test/kontrol/README.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* tests

* Update `check-snapshots`

* Update packages/contracts-bedrock/test/kontrol/README.md

Co-authored-by: Matt Solomon <matt@mattsolomon.dev>

* Separate snapshot gen

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Matt Solomon <matt@mattsolomon.dev>
@mds1 mds1 mentioned this pull request May 15, 2024
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.

None yet

4 participants