Skip to content

op-node: refactor sequencer to use EngineControl, test sequencing#4757

Merged
mergify[bot] merged 2 commits intodevelopfrom
sequencer-engine-control
Jan 26, 2023
Merged

op-node: refactor sequencer to use EngineControl, test sequencing#4757
mergify[bot] merged 2 commits intodevelopfrom
sequencer-engine-control

Conversation

@protolambda
Copy link
Copy Markdown
Contributor

@protolambda protolambda commented Jan 21, 2023

Description

This cleans up the sequencer code-path by removing all remaining engine state from the Driver and Sequencer in favor of using just EngineControl,
and exposing a minimal sequencer planning interface to the Driver loop.

For origin selection the L1 head is still being passed around, this is addressed in the next PR.

Tests

I removed the trail-of-bits test because it's only testing 2 properties around sequencer state, which has now been refactored away.

Instead, we now have a large chaos-monkey like test:
we run the Sequencer with a faked EngineControl and inputs (origin selection / attributes building) and throw chaos it at it:

  • make every type of input randomly and frequently fail
  • make the engine control randomly fail to process the instructions of the sequencer
  • mess with the sequencer clock

And then at the end of test we assert some chain health metrics,
to make sure we can deal with the above errors and still maintain a reasonably healthy L2 chain.

Removing the old test + writing this new large one also means this PR had to be larger, but I tried to keep the functionality changes limited to just the Sequencer and removal of the old sequencer state from the driver.

Additional context

Fix ENG-3104

Stacked on #4756 and draft until that is merged.

Full PR stack:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 21, 2023

⚠️ No Changeset found

Latest commit: 755fef5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

lgtm. Nice tests

Base automatically changed from metered-engine-controls to develop January 26, 2023 18:28
@mslipper mslipper marked this pull request as ready for review January 26, 2023 18:50
@mslipper mslipper requested a review from a team as a code owner January 26, 2023 18:50
@mslipper mslipper requested a review from tynes January 26, 2023 18:50
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 26, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 26, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 26, 2023

Codecov Report

Merging #4757 (755fef5) into develop (c0aaf9b) will decrease coverage by 4.29%.
The diff coverage is 75.60%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4757      +/-   ##
===========================================
- Coverage    40.62%   36.33%   -4.29%     
===========================================
  Files          327      180     -147     
  Lines        18600    14396    -4204     
  Branches       768        0     -768     
===========================================
- Hits          7556     5231    -2325     
+ Misses       10484     8637    -1847     
+ Partials       560      528      -32     
Flag Coverage Δ
bedrock-go-tests 36.33% <75.60%> (+0.91%) ⬆️
contracts-bedrock-tests ?
contracts-periphery-tests ?
contracts-tests ?
core-utils-tests ?
dtl-tests ?
fault-detector-tests ?
sdk-tests ?

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

Impacted Files Coverage Δ
op-node/rollup/derive/pipeline.go 0.00% <ø> (ø)
op-node/rollup/driver/driver.go 0.00% <0.00%> (ø)
op-node/rollup/driver/state.go 0.00% <0.00%> (-3.54%) ⬇️
op-node/rollup/driver/sequencer.go 94.59% <95.38%> (+94.59%) ⬆️
op-node/rollup/driver/l1_state.go 0.00% <0.00%> (-5.56%) ⬇️
...racts-bedrock/contracts/governance/MintManager.sol
.../contracts/libraries/bridge/CrossDomainEnabled.sol
.../contracts-bedrock/contracts/L1/OptimismPortal.sol
...rock/contracts/universal/OptimismMintableERC20.sol
...cts/contracts/L2/predeploys/OVM_GasPriceOracle.sol
... and 145 more

@mergify mergify bot merged commit 5e8bc3d into develop Jan 26, 2023
@mergify mergify bot deleted the sequencer-engine-control branch January 26, 2023 19:06
@mergify mergify bot removed the on-merge-train label Jan 26, 2023
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.

2 participants