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): OutputBisection actor tests #8536

Merged
merged 26 commits into from
Dec 13, 2023
Merged

Conversation

clabby
Copy link
Member

@clabby clabby commented Dec 8, 2023

Overview

Introduces a GameSolver harness for actor tests against the OutputBisectionGame contract. Each actor is an abstraction
around the game solving logic, capable of participating in an OutputBisectionGame backed by the AlphabetVM2.

Test Cases

Note
We don't have to cover all of these, though it would be nice. op-e2e gives us more concrete coverage, these should primarily help drive contracts changes w/o the weight of op-e2e.

  • [Fuzz] Correct root, same trace length between actors - DEFENDER_WINS
  • Correct root, defense step by dishonest actor - DEFENDER_WINS.
  • Incorrect root, defense step by honest actor - CHALLENGER_WINS.
  • Correct root, attack step by dishonest actor from the absolute prestate - DEFENDER_WINS
  • Incorrect root, attack step by honest actor from the absolute prestate - CHALLENGER_WINS
  • Correct root, attack step in secondary execution trace subgame by dishonest actor - DEFENDER_WINS
  • Incorrect root, attack step in secondary execution trace subgame by honest actor - CHALLENGER_WINS
  • Correct root, defense step in secondary execution trace subgame at final insn by dishonest actor - DEFENDER_WINS
  • Incorrect root, defense step in secondary execution trace subgame at final insn by honest actor - CHALLENGER_WINS
  • Variable trace lengths
  • Variable l2Outputs lengths (?)

Metadata
closes https://github.com/ethereum-optimism/client-pod/issues/255
closes https://github.com/ethereum-optimism/client-pod/issues/253

@clabby
Copy link
Member Author

clabby commented Dec 8, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@clabby clabby self-assigned this Dec 8, 2023
@clabby clabby added the A-pkg-contracts-bedrock Area: packages/contracts-bedrock label Dec 8, 2023
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch from 73a438b to e017287 Compare December 8, 2023 23:50
@clabby clabby changed the base branch from develop to cl/ctb/test-lint December 8, 2023 23:53
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch from e017287 to cebcb45 Compare December 8, 2023 23:53
@clabby clabby mentioned this pull request Dec 8, 2023
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch 2 times, most recently from e968477 to 8fef157 Compare December 8, 2023 23:56
@clabby clabby changed the base branch from cl/ctb/test-lint to cl/ctb/upgrade-foundry December 8, 2023 23:57
@clabby clabby mentioned this pull request Dec 8, 2023
@clabby clabby force-pushed the cl/ctb/upgrade-foundry branch from c295efa to 7f17f8e Compare December 9, 2023 00:02
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch from 8fef157 to e98088a Compare December 9, 2023 00:02
@clabby clabby force-pushed the cl/ctb/upgrade-foundry branch from 7f17f8e to bdb55d0 Compare December 9, 2023 21:17
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch from 1433561 to b09ddeb Compare December 9, 2023 21:17
Copy link

codecov bot commented Dec 9, 2023

Codecov Report

Merging #8536 (8e65880) into develop (dc01c03) will decrease coverage by 8.93%.
The diff coverage is 0.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8536      +/-   ##
===========================================
- Coverage    34.60%   25.68%   -8.93%     
===========================================
  Files          167      119      -48     
  Lines         7155     4879    -2276     
  Branches      1209     1060     -149     
===========================================
- Hits          2476     1253    -1223     
+ Misses        4530     3523    -1007     
+ Partials       149      103      -46     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-bedrock-tests 20.19% <0.00%> (-0.06%) ⬇️
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-next-tests 42.18% <ø> (ø)
sdk-tests 42.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../contracts-bedrock/src/dispute/lib/LibPosition.sol 0.00% <0.00%> (ø)
...tracts-bedrock/src/dispute/OutputBisectionGame.sol 0.00% <0.00%> (ø)

... and 48 files with indirect coverage changes

@clabby clabby marked this pull request as ready for review December 9, 2023 22:19
@clabby clabby requested a review from a team as a code owner December 9, 2023 22:19
@clabby clabby requested review from Inphi and removed request for a team December 9, 2023 22:19
@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch 3 times, most recently from a177b5d to f95003b Compare December 10, 2023 05:02
Base automatically changed from cl/ctb/upgrade-foundry to cl/ctb/test-lint December 11, 2023 13:55
Base automatically changed from cl/ctb/test-lint to develop December 11, 2023 16:50
Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

Walkthrough

The changes involve updates to smart contracts related to dispute resolution, position tracking, and testing within a blockchain framework. A new version of the OutputBisectionGame contract has been released, with enhanced logic for verifying execution bisection roots. The LibPosition contract has been refactored for improved ancestor tracing. Test contracts have been expanded with new variables, functions, and actors to better simulate and handle disputes. The AlphabetVM2 mock contract has been updated for more accurate state transition computations.

Changes

File Path Change Summary
.../OutputBisectionGame.sol
.../OutputBisectionActors.sol
.../OutputBisectionGame.t.sol
Updated version constant in OutputBisectionGame.sol; added logic in verifyExecBisectionRoot. Added new variables and functions; modified constructor signatures; introduced DisputeActor and HonestDisputeActor in OutputBisectionActors.sol. Added imports, modified functions, and added new contracts and helper functions in OutputBisectionGame.t.sol.
.../LibPosition.sol Refactored ancestor finding logic with traceAncestor function.
.../AlphabetVM2.sol Added view keyword to computeStateTransition; refactored function logic; added PreimageKeyLib import.

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment from CodeRabbit.
  • You can also chat with CodeRabbit bot directly around the specific lines of code or files in the PR by tagging @coderabbitai in a new comment.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase.

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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@clabby clabby force-pushed the cl/ctb/ob-actor-tests branch from 4c45bc0 to 8e65880 Compare December 12, 2023 20:26
Copy link
Contributor

@Inphi Inphi left a comment

Choose a reason for hiding this comment

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

Very nice!

@clabby clabby added this pull request to the merge queue Dec 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 12, 2023
@ajsutton ajsutton added this pull request to the merge queue Dec 13, 2023
Merged via the queue into develop with commit 5fb16e2 Dec 13, 2023
@ajsutton ajsutton deleted the cl/ctb/ob-actor-tests branch December 13, 2023 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pkg-contracts-bedrock Area: packages/contracts-bedrock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants