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-batcher: Properly drain state on L2 reorgs #5536

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented Apr 26, 2023

Description
When a L2 reorg occurs the batcher should close out the pending channel and submit everything that it has before clearing the channel builder. The reason for this is that even though it may be submitting incorrect data it should not leave dangling channels. After the pending state is drained it can begin tracking the new L2 chain.

Tests

Unfortunately the action tests are not suitable for testing this because they have rewritten the batcher. It might be possible in op-e2e, but I don't see an easy way to trigger a L2 reorg & also asserts that it does this flushing.

Metadata

@changeset-bot
Copy link

changeset-bot bot commented Apr 26, 2023

⚠️ No Changeset found

Latest commit: 7e389c7

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 Apr 26, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 7e389c7
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/644ac3deaeb9bb0008181663

@trianglesphere trianglesphere force-pushed the jg/handle_l2_reorgs_cleanly branch 2 times, most recently from e5f179d to 0aff62e Compare April 26, 2023 18:54
@trianglesphere trianglesphere marked this pull request as ready for review April 26, 2023 18:58
@trianglesphere trianglesphere requested a review from a team as a code owner April 26, 2023 18:58
@trianglesphere trianglesphere requested review from mslipper and ajsutton and removed request for mslipper April 26, 2023 18:58
When a L2 reorg occurs the batcher should close out the pending channel
and submit everything that it has before clearing the channel builder.
The reason for this is that even though it may be submitting incorrect
data it should not leave dangling channels. After the pending state is
drained it can begin tracking the new L2 chain.
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.

@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2023

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

@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2023

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

@OptimismBot OptimismBot merged commit 2aab09b into develop Apr 27, 2023
@OptimismBot OptimismBot deleted the jg/handle_l2_reorgs_cleanly branch April 27, 2023 19:07
@mergify mergify bot removed the on-merge-train label Apr 27, 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.

None yet

3 participants