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: reset engine through events #10961

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Conversation

protolambda
Copy link
Contributor

Description

This changes the op-node to reset the engine by:

  • detecting the reset error, and then emitting a request to the engine-resetter to compute where to reset to
  • once computed, the reset is forced to the engine.
  • once completed, the reset is confirmed to the derivation pipeline

The old ResetEngine function was split as follows:

  • the computational part, basically just sync.FindSyncStart call: happens on request event
  • the application of the start point to the engine: happens on force event
  • the safe-head notifications: op-node driver handles it for now, when receiving the confirmation event
  • reset is confirmed to pipeline

Note that events are still processed synchronously, so the code won't spawn more reset-error events from the pipeline until the reset has been confirmed. Once we make this async we'll need to hold a lock somewhere that a reset is in progress.

Now it can be composed nicely with the other event derivers.

Tests

The reset code-paths are used in almost every test, and no branching functionality is added, so no new tests.

Metadata

Fix #10958

@protolambda protolambda requested review from a team and ajsutton as code owners June 19, 2024 22:50
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.

op-node/rollup/engine/engine_reset.go Show resolved Hide resolved
@protolambda protolambda added this pull request to the merge queue Jun 19, 2024
Merged via the queue into develop with commit 2d0e83a Jun 19, 2024
58 checks passed
@protolambda protolambda deleted the engine-reset-events branch June 19, 2024 23:40
rdovgan pushed a commit to rdovgan/optimism that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Interop: instrument Engine with Reset events
2 participants