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

fix(op-node): Correctly pop unsafe payload queue when payload is too … #6324

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

Kelvyne
Copy link
Contributor

@Kelvyne Kelvyne commented Jul 18, 2023

…older

Fixes #6092

Description

See #6092

Tests

The test is minimalist. It only ensures that the unsafe payload queue is pop'd

Additional context

Metadata

@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2023

⚠️ No Changeset found

Latest commit: 174ece6

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

@netlify
Copy link

netlify bot commented Jul 18, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 174ece6
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/64b6914ea3e25700081bfe11

@Kelvyne
Copy link
Contributor Author

Kelvyne commented Jul 18, 2023

cc @ajsutton

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #6324 (174ece6) into develop (a88cd43) will increase coverage by 13.65%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #6324       +/-   ##
============================================
+ Coverage    30.84%   44.50%   +13.65%     
============================================
  Files          429      449       +20     
  Lines        27559    29246     +1687     
  Branches       748      748               
============================================
+ Hits          8500    13015     +4515     
+ Misses       18472    15170     -3302     
- Partials       587     1061      +474     
Flag Coverage Δ
bedrock-go-tests 43.65% <100.00%> (+17.10%) ⬆️
cannon-go-tests 62.58% <ø> (ø)
common-ts-tests 26.82% <ø> (ø)
contracts-bedrock-tests 51.09% <ø> (-7.37%) ⬇️
core-utils-tests 44.24% <ø> (ø)
fault-detector-tests 26.95% <ø> (ø)
sdk-next-tests 42.48% <ø> (ø)
sdk-tests 42.48% <ø> (ø)

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

Impacted Files Coverage Δ
op-node/rollup/derive/engine_queue.go 47.47% <100.00%> (+47.47%) ⬆️

... and 116 files with indirect coverage changes

@ajsutton
Copy link
Contributor

Ooo, thank you. I'll get @protolambda to take a look since he knows this code really well and it is quite an important area.

One additional bit of context is that p2p sync is now enabled by default, so while we previously went to almost any length to avoid dropping gossip we might need, now we can be a bit more relaxed knowing that p2p sync can fetch the blocks if needed. I think there may be a case where a L1 reorg causes the safe head to drop back and so there's potentially a period where we haven't seen that reorg yet but the sequencer has published new unsafe payloads that are prior to our current unsafe head (but after the post-reorg unsafe head). This change would then drop those payloads and depend on p2p sync filling them in. However that's likely less common and resolves faster than the case where p2p sync winds up adding a payload just as the safe head advances and unsafe processing stalls until the next safe head update which is what this fixes.

@protolambda
Copy link
Contributor

This change would then drop those payloads and depend on p2p sync filling them in.

Note that it would only be able to fill them in after first reorging the chain using the safe-head reorg mechanism. Since we do not really have a forkchoice other than following the latest canonical L1 chain, we do not allow unsafe-head reorgs until seeing the new L1 chain.

@mergify
Copy link
Contributor

mergify bot commented Jul 18, 2023

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

@mergify
Copy link
Contributor

mergify bot commented Jul 18, 2023

Hey @Kelvyne, this pull request failed to merge and has been dequeued from the merge train. If you believe your PR failed in the merge train because of a flaky test, requeue it by commenting with @mergifyio requeue.
More details can be found on the Queue: Embarked in merge train check-run.

@ajsutton
Copy link
Contributor

This change would then drop those payloads and depend on p2p sync filling them in.

Note that it would only be able to fill them in after first reorging the chain using the safe-head reorg mechanism. Since we do not really have a forkchoice other than following the latest canonical L1 chain, we do not allow unsafe-head reorgs until seeing the new L1 chain.

Yep agreed. Which is similar to the current setup where importing unsafe payloads stops because the next payload is prior to the current unsafe head, until the L1 reorg is process and then that first pending unsafe payload should now build on the new safe head and be able to be imported.

@mergify mergify bot removed the on-merge-train label Jul 18, 2023
@ajsutton ajsutton merged commit ab8d533 into ethereum-optimism:develop Jul 19, 2023
73 of 76 checks passed
seolaoh added a commit to kroma-network/kroma that referenced this pull request Aug 9, 2023
…t head

When activating the `unsafeL2Payload` queue, kroma-node stops processing the
queue if a payload is older than the rollup's `unsafeL2Head`. It happens more
frequently when the batches are pushed slower. Changes to pop unsafe payload
queue when payload is older than current unsafe head.

See ethereum-optimism/optimism#6324
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.

op-node: unsafeL2Payloads blocks when receiving a block prior to unsafeL2Head
3 participants