Skip to content

feat(op-challenger): Output Bisection Game Genesis Output Root Fetching#8394

Merged
refcell merged 1 commit intodevelopfrom
refcell/absolute-prestate-validation
Dec 7, 2023
Merged

feat(op-challenger): Output Bisection Game Genesis Output Root Fetching#8394
refcell merged 1 commit intodevelopfrom
refcell/absolute-prestate-validation

Conversation

@refcell
Copy link
Contributor

@refcell refcell commented Dec 1, 2023

Descriptions

Adds support for genesis output root fetching to the op-challenger contracts.

Metadata

Makes progress on https://github.com/ethereum-optimism/client-pod/issues/259

@refcell refcell requested a review from a team as a code owner December 1, 2023 21:01
@refcell refcell requested a review from ajsutton December 1, 2023 21:01
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2023

Walkthrough

Walkthrough

The recent updates to the op-challenger codebase involve structural changes to fault handling and contract interaction. New validation methods and types have been introduced, shifting some functionality from interfaces to function types. The OutputBisectionGameContract now includes a method for retrieving the genesis output root, and associated tests have been added. These changes enhance the code's modularity and extend its capabilities for handling game states and blockchain interactions.

Changes

File(s) Summary
.../fault/register.go Consolidated changes to add validateAbsolutePrestate method to outputAlphabetResources and outputCannonResources and modified CreateAccessor to include this method as a parameter.
.../fault/trace/outputs/output_alphabet.go, .../fault/trace/outputs/output_cannon.go Added a new parameter v of type AbsolutePrestateValidator to accessor functions and included conditional validation logic.
.../fault/trace/outputs/provider.go Introduced a new type alias AbsolutePrestateValidator for a validation function.
.../fault/contracts/outputbisectiongame.go (2 entries) Added a new global variable methodGenesisOutputRoot and a new method GetGenesisOutputRoot to OutputBisectionGameContract.
.../fault/player.go Changed PrestateLoader from an interface to a function type.
.../fault/player_test.go Modified newMockPrestateLoader to return a function instead of a struct.
.../fault/contracts/outputbisectiongame_test.go Added a new test function TestGetGenesisOutputRoot to verify the new contract method.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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

@refcell
Copy link
Contributor Author

refcell commented Dec 1, 2023

@refcell refcell self-assigned this Dec 1, 2023
@codecov
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Merging #8394 (2ac6817) into develop (db04c8b) will increase coverage by 28.84%.
The diff coverage is n/a.

❗ Current head 2ac6817 differs from pull request most recent head 74a4849. Consider uploading reports for the commit 74a4849 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #8394       +/-   ##
============================================
+ Coverage    34.64%   63.48%   +28.84%     
============================================
  Files          167       16      -151     
  Lines         7146     1427     -5719     
  Branches      1207        0     -1207     
============================================
- Hits          2476      906     -1570     
+ Misses        4521      475     -4046     
+ Partials       149       46      -103     
Flag Coverage Δ
cannon-go-tests 63.48% <ø> (ø)
chain-mon-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
contracts-ts-tests ?
core-utils-tests ?
sdk-next-tests ?
sdk-tests ?

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

see 151 files with indirect coverage changes

@refcell refcell requested a review from clabby December 1, 2023 21:28
Copy link
Contributor

@clabby clabby left a comment

Choose a reason for hiding this comment

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

Logic lgtm; Will defer to a go reviewer to give approval.

@refcell refcell force-pushed the refcell/absolute-prestate-validation branch from 9d86c67 to 885b4c9 Compare December 2, 2023 00:45
@refcell refcell mentioned this pull request Dec 2, 2023
7 tasks
@refcell refcell force-pushed the refcell/absolute-prestate-validation branch 2 times, most recently from b6cce8b to 2696744 Compare December 5, 2023 19:54
@refcell refcell force-pushed the refcell/absolute-prestate-validation branch 2 times, most recently from 079a695 to 2ac6817 Compare December 6, 2023 17:10
@refcell refcell force-pushed the refcell/absolute-prestate-validation branch from 2ac6817 to 197aba1 Compare December 7, 2023 01:51
@refcell refcell changed the title feat(op-challenger): Output Bisection Game Absolute Prestate Validation feat(op-challenger): Output Bisection Game Genesis Output Root Fetching Dec 7, 2023
@refcell refcell requested a review from ajsutton December 7, 2023 01:52
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM.

providers.

fix(op-challenger): genesis output root validation for top of output bisection games

genesis output root test

fix(op-challenger): revert validation wiring

revert newline change
@refcell refcell force-pushed the refcell/absolute-prestate-validation branch from 197aba1 to 74a4849 Compare December 7, 2023 03:04
@refcell refcell enabled auto-merge December 7, 2023 03:04
@refcell refcell added this pull request to the merge queue Dec 7, 2023
Merged via the queue into develop with commit c2c69cb Dec 7, 2023
@refcell refcell deleted the refcell/absolute-prestate-validation branch December 7, 2023 03:40
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