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: Refactor frame & tx data handling #5083

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

sebastianst
Copy link
Member

@sebastianst sebastianst commented Mar 8, 2023

Description

Introduces two separate types for frame data and tx data to make a clear
distinction between the two. Also prepares the batcher for future changes
when it will support sending multiple frames per tx.

Tests

Added a regression test to validate that requeued transactions have the same data (and don't prepend 0 version bytes) and that transaction data can be parsed correctly.

I added a random L2 block generator. Because of dependency cycles, I couldn't put it into package op-node/testutils since it uses a function from the derive package. Hence added the random generator to a new package op-node/rollup/derive/test, following the pattern to create testing code dependent on a package in a .../test sub-package.

Additional context

Cleaner solution of #5050

@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2023

⚠️ No Changeset found

Latest commit: 4df9505

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

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #5083 (448a3b3) into develop (e251dac) will decrease coverage by 4.88%.
The diff coverage is 68.62%.

❗ Current head 448a3b3 differs from pull request most recent head 4df9505. Consider uploading reports for the commit 4df9505 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5083      +/-   ##
===========================================
- Coverage    41.19%   36.32%   -4.88%     
===========================================
  Files          349      209     -140     
  Lines        21317    17241    -4076     
  Branches       776        0     -776     
===========================================
- Hits          8782     6262    -2520     
+ Misses       11866    10347    -1519     
+ Partials       669      632      -37     
Flag Coverage Δ
bedrock-go-tests 36.32% <68.62%> (-0.62%) ⬇️
contracts-bedrock-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-batcher/batcher/driver.go 0.00% <0.00%> (ø)
op-batcher/batcher/tx_data.go 60.00% <60.00%> (ø)
op-node/rollup/derive/test/random.go 71.42% <71.42%> (ø)
op-batcher/batcher/channel_manager.go 46.91% <72.22%> (+6.30%) ⬆️
op-batcher/batcher/channel_builder.go 51.82% <83.33%> (+1.45%) ⬆️
op-node/testutils/random.go 88.64% <100.00%> (+0.18%) ⬆️

... and 151 files with indirect coverage changes

@sebastianst sebastianst marked this pull request as ready for review March 11, 2023 20:29
@sebastianst sebastianst requested a review from a team as a code owner March 11, 2023 20:29
@sebastianst sebastianst force-pushed the seb/batcher-fix-tx-data branch 2 times, most recently from c9c3502 to 4e9f5cd Compare March 11, 2023 21:07
op-batcher/batcher/tx_data.go Outdated Show resolved Hide resolved
op-node/rollup/derive/test/random.go Outdated Show resolved Hide resolved
op-node/rollup/derive/test/random.go Outdated Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Mar 13, 2023

Hey @sebastianst! This PR has merge conflicts. Please fix them before continuing review.

Introduces two separate types for frame data and tx data to make a clear
distinction between the two. Also prepares the batcher for future changes
when it will support sending multiple frames per tx.
Also adds a function RandomBlockPrependTxs to package op-node/testutils
to avoid code duplication with RandomBlock.
Copy link
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

@mergify
Copy link
Contributor

mergify bot commented Mar 14, 2023

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

@mergify
Copy link
Contributor

mergify bot commented Mar 14, 2023

Hey @sebastianst, 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.

@mergify mergify bot removed the on-merge-train label Mar 14, 2023
@trianglesphere trianglesphere merged commit a1e6eee into develop Mar 14, 2023
@trianglesphere trianglesphere deleted the seb/batcher-fix-tx-data branch March 14, 2023 15:47
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