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

op-node: Remove Unsafe Sync Target & Direct Engine Manipulation #8856

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented Jan 5, 2024

Description

This PR primarily moves the last of the direct execution engine manipulation from the EngineQueue to the EngineController. It also removes the unsafe sync target because maintaining the unsafe sync target was difficult and will be replaced by a different EL sync method.

Tests

Again no tests because this is tidying.

@trianglesphere trianglesphere force-pushed the jg/engine_controller_v3 branch from 7086c1d to 1995e9f Compare January 5, 2024 23:24
Copy link
Contributor

semgrep-app bot commented Jan 5, 2024

Semgrep found 1 sol-style-notice-over-dev-natspec finding:

  • packages/contracts-bedrock/src/dispute/interfaces/IFaultDisputeGame.sol: L12

Prefer @notice over @dev in natspec comments

Ignore this finding from sol-style-notice-over-dev-natspec.

@trianglesphere trianglesphere force-pushed the jg/engine_controller_v2 branch from e6b1ee6 to 47f6f63 Compare January 5, 2024 23:43
@trianglesphere trianglesphere force-pushed the jg/engine_controller_v3 branch from 1995e9f to 1ec6a98 Compare January 5, 2024 23:47
@trianglesphere trianglesphere changed the base branch from jg/engine_controller_v2 to develop January 5, 2024 23:47
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (320fe93) 34.70% compared to head (164f472) 20.40%.
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #8856       +/-   ##
============================================
- Coverage    34.70%   20.40%   -14.30%     
============================================
  Files          165       86       -79     
  Lines         7123     2058     -5065     
  Branches      1208      473      -735     
============================================
- Hits          2472      420     -2052     
+ Misses        4499     1607     -2892     
+ Partials       152       31      -121     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests ?
common-ts-tests ?
contracts-bedrock-tests 20.40% <ø> (ø)
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 79 files with indirect coverage changes

@trianglesphere trianglesphere changed the base branch from develop to jg/engine_controller_v2 January 5, 2024 23:47
@trianglesphere trianglesphere changed the base branch from jg/engine_controller_v2 to develop January 5, 2024 23:48
@trianglesphere trianglesphere changed the base branch from develop to jg/engine_controller_v2 January 8, 2024 21:16
@trianglesphere trianglesphere changed the title Jg/engine controller v3 op-node: Remove Unsafe Sync Target & Direct Engine Manipulation Jan 8, 2024
Base automatically changed from jg/engine_controller_v2 to develop January 9, 2024 00:07
@trianglesphere trianglesphere force-pushed the jg/engine_controller_v3 branch from 1ec6a98 to 66f70b1 Compare January 9, 2024 00:24
@trianglesphere trianglesphere marked this pull request as ready for review January 9, 2024 00:26
Copy link
Contributor

coderabbitai bot commented Jan 9, 2024

Warning

Rate Limit Exceeded

@trianglesphere has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 29 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 320fe93 and 164f472.

Walkthrough

The overarching modification involves the removal of the EngineSyncTarget method and associated logic across various components of the system. This suggests a refactoring or redesign of how engine synchronization targets are handled, with a shift towards new methods and fields that likely streamline the synchronization process. The changes impact tests, synchronization status reporting, and engine control mechanisms, indicating a significant update to the synchronization strategy within the system's architecture.

Changes

Files Change Summary
op-e2e/actions/l2_verifier.go
op-node/node/server_test.go
op-node/rollup/derive/pipeline.go
op-node/rollup/driver/driver.go
op-node/rollup/driver/state.go
op-service/eth/sync_status.go
op-service/testutils/random.go
Removal of EngineSyncTarget method and related logic, impacting synchronization status and engine control.
op-e2e/actions/sync_test.go
op-node/rollup/derive/engine_queue_test.go
Modifications to test logic, replacing hash comparisons involving EngineSyncTarget with L2Unsafe and updating fork choice update handling.
op-node/rollup/derive/engine_controller.go
op-node/rollup/derive/engine_queue.go
Introduction of new fields (syncMode, needFCUCall), removal of old fields (syncTarget, needForkchoiceUpdate), and addition of new methods (checkNewPayloadStatus, checkForkchoiceUpdatedStatus, resetBuildingState), with updates to existing methods to accommodate these changes.

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

op-node/rollup/derive/engine_queue_test.go Show resolved Hide resolved
op-node/rollup/derive/engine_queue_test.go Show resolved Hide resolved
op-node/rollup/derive/engine_queue_test.go Show resolved Hide resolved
op-node/rollup/derive/engine_queue_test.go Show resolved Hide resolved
op-e2e/actions/sync_test.go Outdated Show resolved Hide resolved
op-e2e/actions/sync_test.go Outdated Show resolved Hide resolved
op-e2e/actions/sync_test.go Outdated Show resolved Hide resolved
op-e2e/actions/sync_test.go Outdated Show resolved Hide resolved
op-node/rollup/derive/engine_queue.go Outdated Show resolved Hide resolved
op-node/rollup/derive/engine_queue.go Outdated Show resolved Hide resolved
op-service/eth/sync_status.go Show resolved Hide resolved
@axelKingsley axelKingsley requested review from axelKingsley and removed request for axelKingsley January 9, 2024 17:20
@trianglesphere trianglesphere force-pushed the jg/engine_controller_v3 branch 2 times, most recently from eeae377 to 714a127 Compare January 9, 2024 18:34
This fully moves all execution engine manipulation into the Engine Controller
from the Engine Queue. It does not remove the proxy methods however.
@trianglesphere trianglesphere added this pull request to the merge queue Jan 10, 2024
Merged via the queue into develop with commit 509772a Jan 10, 2024
68 checks passed
@trianglesphere trianglesphere deleted the jg/engine_controller_v3 branch January 10, 2024 01:47
@@ -165,7 +164,6 @@ func (e *EngineController) ConfirmPayload(ctx context.Context) (out *eth.Executi
}

e.unsafeHead = ref
e.syncTarget = ref

e.metrics.RecordL2Ref("l2_unsafe", ref)
e.metrics.RecordL2Ref("l2_engineSyncTarget", ref)
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to remove this as well.

anikaraghu pushed a commit to anikaraghu/optimism that referenced this pull request Jan 11, 2024
…reum-optimism#8856)

This fully moves all execution engine manipulation into the Engine Controller
from the Engine Queue. It does not remove the proxy methods however.
0xfuturistic pushed a commit that referenced this pull request Jan 11, 2024
This fully moves all execution engine manipulation into the Engine Controller
from the Engine Queue. It does not remove the proxy methods however.
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