Skip to content

op-node: buffer unsafe payloads with priority queue [bedrock]#3346

Merged
mslipper merged 6 commits intodevelopfrom
p2p-payloads-buffer
Sep 7, 2022
Merged

op-node: buffer unsafe payloads with priority queue [bedrock]#3346
mslipper merged 6 commits intodevelopfrom
p2p-payloads-buffer

Conversation

@protolambda
Copy link
Contributor

Description

Pop blocks by lowest number to maintain max size, and do not drop if the first payload is in the future.
This way we keep the buffer around until block derivation from L1 makes progress, and the unsafe payloads can be processed (or dropped if they do not connect with parent hash).

This should enabled nodes to stay on the canonical unsafe L2 chain, the blocks by the sequencer ahead of what's submitted to L1, more reliably.

Testing work in progress.

Metadata

Fix ENG-2511

@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2022

This PR changes implementation code, but doesn't include a changeset. Did you forget to add one?

…r to maintain max size, and do not drop if the first payload is in the future
@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2022

⚠️ No Changeset found

Latest commit: 8e88f55

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

SequencingErrors: NewEventMetrics(registry, ns, "sequencing_errors", "sequencing errors"),
PublishingErrors: NewEventMetrics(registry, ns, "publishing_errors", "p2p publishing errors"),

UnsafePayloadsBufferLen: promauto.With(registry).NewGauge(prometheus.GaugeOpts{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 🎉

@mslipper mslipper marked this pull request as ready for review September 7, 2022 20:33
@mslipper mslipper merged commit 4aa822c into develop Sep 7, 2022
@mslipper mslipper deleted the p2p-payloads-buffer branch September 7, 2022 20:33
maurelian pushed a commit that referenced this pull request Sep 15, 2022
* op-node: buffer unsafe payloads with priority queue, pop lowest number to maintain max size, and do not drop if the first payload is in the future

* payload queue testing

* op-node: payload queue metrics, error handling

* op-node: fix payloads queue test missing pop

* op-node: payloads queue false semgrep case

Co-authored-by: Matthew Slipper <me@matthewslipper.com>
sam-goldman pushed a commit that referenced this pull request Sep 15, 2022
* op-node: buffer unsafe payloads with priority queue, pop lowest number to maintain max size, and do not drop if the first payload is in the future

* payload queue testing

* op-node: payload queue metrics, error handling

* op-node: fix payloads queue test missing pop

* op-node: payloads queue false semgrep case

Co-authored-by: Matthew Slipper <me@matthewslipper.com>
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