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: introduce AnchorStateRegistry #9835

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Conversation

smartcontracts
Copy link
Contributor

@smartcontracts smartcontracts commented Mar 12, 2024

Description
Introduces the AnchorStateRegistry used to hold anchor states for different game types. Anchor states are updated automatically when a game resolves.

@smartcontracts
Copy link
Contributor Author

Still needs tests

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 16.17%. Comparing base (dc2b714) to head (4f8f76f).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #9835       +/-   ##
============================================
- Coverage    28.53%   16.17%   -12.37%     
============================================
  Files          164      123       -41     
  Lines         7211     5297     -1914     
  Branches      1321     1173      -148     
============================================
- Hits          2058      857     -1201     
+ Misses        5047     4365      -682     
+ Partials       106       75       -31     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-bedrock-tests 0.60% <0.00%> (-0.01%) ⬇️
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-next-tests 41.94% <ø> (ø)
sdk-tests 41.94% <ø> (ø)

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

Files Coverage Δ
...ts-bedrock/src/dispute/PermissionedDisputeGame.sol 0.00% <ø> (ø)
...contracts-bedrock/src/dispute/FaultDisputeGame.sol 0.00% <0.00%> (ø)
...tracts-bedrock/src/dispute/AnchorStateRegistry.sol 0.00% <0.00%> (ø)

... and 42 files with indirect coverage changes

Copy link
Member

@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.

Looking good so far. Couple suggestions + a bug.

@smartcontracts smartcontracts force-pushed the sc/anchor-state-registry branch 7 times, most recently from bdceff8 to f84e452 Compare March 13, 2024 04:36
@smartcontracts smartcontracts marked this pull request as ready for review March 13, 2024 04:41
@smartcontracts smartcontracts requested review from a team as code owners March 13, 2024 04:41
Copy link
Contributor

coderabbitai bot commented Mar 13, 2024

Walkthrough

The update involves transitioning from genesis-related terminology to start-focused terms, broadening their relevance beyond the initial block. It introduces the AnchorStateRegistry contract to manage anchor states across various game types in the dispute resolution system. These changes streamline initialization and validation processes in the fault dispute game and its tests, enhancing clarity and adaptability in managing game states.

Changes

File Path Change Summary
op-challenger/game/fault/contracts/faultdisputegame.go
op-challenger/game/fault/contracts/faultdisputegame_test.go
Renamed genesis-related methods and variables to start-focused terms. Updated names of variables and test functions accordingly.
op-challenger/game/fault/register.go
op-e2e/e2eutils/disputegame/helper.go
op-e2e/e2eutils/disputegame/output_game_helper.go
Updated references from genesis to starting terms and adjusted validator and method calls.
packages/contracts-bedrock/.gas-snapshot Made minor gas usage adjustments for a benchmark function.
packages/contracts-bedrock/invariant-docs/FaultDisputeGame.md Updated a test reference link.
packages/contracts-bedrock/scripts/...
packages/contracts-bedrock/src/dispute/...
Introduced AnchorStateRegistry, updated imports, and modified contracts to utilize the new registry. Removed outdated genesis references.
packages/contracts-bedrock/src/dispute/interfaces/... Updated Solidity pragma version and added new functions related to starting terms.
packages/contracts-bedrock/src/libraries/DisputeErrors.sol
packages/contracts-bedrock/src/libraries/DisputeTypes.sol
Added new error and struct for handling output roots.
packages/contracts-bedrock/test/dispute/... Adjusted test setups and assertions to align with the new starting terms and AnchorStateRegistry.

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-tests 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 tests 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 tests.
    • @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.
  • 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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@smartcontracts
Copy link
Contributor Author

I could use some assistance re-generating the Kontrol artifacts. I can never seem to get them to generate properly, who knows why.

Introduces the AnchorStateRegistry used to hold anchor states for
different game types. Anchor states are updated automatically when
a game resolves.
@clabby clabby enabled auto-merge March 18, 2024 21:45
@clabby clabby added this pull request to the merge queue Mar 18, 2024
Merged via the queue into develop with commit 380d8cf Mar 18, 2024
72 of 73 checks passed
@clabby clabby deleted the sc/anchor-state-registry branch March 18, 2024 22:48
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.

4 participants