op-challenger: Limit output roots to safe head at L1 block
Description
Add logic to op-challenger to load the latest safe head at a L1 block from the op-node. This depends on the new RPC method added in https://github.com/ethereum-optimism/optimism/pull/9575 which is not present in this PR. Tests will fail into the other PR is merged.
Tests
Added unit tests.
Metadata
- https://github.com/ethereum-optimism/client-pod/issues/593
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.20%. Comparing base (
3179d49) to head (dfc28e6). Report is 2 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #9598 +/- ##
============================================
+ Coverage 28.62% 82.20% +53.58%
============================================
Files 162 10 -152
Lines 7130 1068 -6062
Branches 1305 0 -1305
============================================
- Hits 2041 878 -1163
+ Misses 4983 159 -4824
+ Partials 106 31 -75
| Flag | Coverage Δ | |
|---|---|---|
| cannon-go-tests | 82.20% <ø> (ø) |
|
| 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.
Walkthrough
Walkthrough
The overall change consists of updating the trace provider initialization process across various files in the op-challenger and op-e2e modules, introducing a new method for handling safe heads at L1 blocks, and adjusting the configuration for the sequencer node. This includes modifications to function signatures, renaming functions, adding new fields and methods to structs, and updating test cases to align with these changes.
Changes
| Files | Summary |
|---|---|
op-challenger/game/fault/register.go |
Introduced outputSourceCreator with conditional initialization. |
op-challenger/game/fault/trace/outputs/output_alphabet.goop-challenger/game/fault/trace/outputs/output_cannon.goop-e2e/e2eutils/disputegame/helper.goop-e2e/e2eutils/disputegame/output_cannon_helper.go |
Updated NewTraceProviderFromInputs to NewTraceProvider, affecting initialization. |
op-challenger/game/fault/trace/outputs/provider.goop-challenger/game/fault/trace/outputs/split_adapter_test.go |
Renamed NewTraceProviderFromInputs to NewTraceProvider with updated parameters. |
op-challenger/game/fault/trace/outputs/provider_test.go |
Added SafeHeadAtL1Block method to stubRollupClient. |
op-challenger/game/fault/trace/outputs/source/creator.goop-challenger/game/fault/trace/outputs/source/restricted.goop-challenger/game/fault/trace/outputs/source/restricted_test.go |
Added SafeHeadAtL1Block and L1HeaderSource interface; updated NewOutputSourceCreator and NewRestrictedOutputSource function signatures. |
op-e2e/faultproofs/util.goop-e2e/system_tob_test.go |
Set SafeDBPath for "sequencer" node to a temporary directory; adjusted configuration settings. |
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?
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.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin 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
@coderabbitaiin 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 from git 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai helpto 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.yamlfile 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.