Skip to content

Bedrock: new batch-derivation changes#2871

Merged
mslipper merged 22 commits intodevelopfrom
batch-derivation
Jun 30, 2022
Merged

Bedrock: new batch-derivation changes#2871
mslipper merged 22 commits intodevelopfrom
batch-derivation

Conversation

@protolambda
Copy link
Contributor

This PR tracks all batch-derivation changes, starting a squashed version of the earlier dev branch batch-deriv-v2 (#2714).

Op-node and op-e2e tests are passing, except an unrelated e2e fees test which is being looked at separately.

We'll split out some of the eth/l2/testutils changes into separate PRs to reduce the size of this one. And then likely review in smaller PRs that isolate changes more.

@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2022

⚠️ No Changeset found

Latest commit: cb8ecb0

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

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

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


"seq_window_size": 2,

"channel_timeout": 10,
Copy link
Contributor

Choose a reason for hiding this comment

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

10 here, 100s above (in docker compose)

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.

I left a couple comments on packages other than op-node
I wrote most of op-batcher so I don't want to do most of the review
op-e2e lgtm
op-proposer lgtm
ops-bedrock has a slight inconsistency

Will help with splitting out refactor code from op-node & then start reviewing it

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

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

@mergify mergify bot added the conflict label Jun 28, 2022
feat: bedrock inwards/outwards batch deriv draft v2

skip timed out frames, keep reading tx data

ignore frame if it already exists, do not stop reading tx

update pruning

fix channel closing

fix reorg recover func

misc reorg func fixes

channels for multiplexing submissions, inclusion for ordering of processing, decoded batches can be ordered as necessary after pulling from the stream

ignore timed out frames

fix maxBlocksPerChannel name

fix var name, stop producing output data if no blocks are left

implement channel out reader, start testing, renaming, structure etc.

rename pipeline to channel-in-reader, fix old l2 package imports

close compression stream

improve channel out reader

add de compression and rlp reading to channel-in-reader

channel in reader: l1 origin update

channel in reader updates

move new deriv code into derive package

work in progress integration of batch derivation changes

work in progress, l2 derivation stepper

fix rlp dependency

channel in reader is broken, left todo

update work in progress derivation pipeline with todo spec per function

engine queue todo

work in progress integration with driver

fix channel in reader init

driver event loop and derive loop separation

(WIP) derive: Implement BatchQueue with full window

This implements a simple algorithm for the batch queue. It waits
until it has a full sequence window and then runs the historical
batch derivation process over that data.

The WIP part is that it needs more data that it does not yet have.

derive: Fully derive payload attributes

Also properly slices the queue.

Remove batch bundle, split of reading of data from txs

move engine update/consolidation into derive package

tag channel bank with l1 origin as whole, read frame data may not revert to older l1 origin because out-of-order channel frames

read full channel, forward L1 origin changes in channel-in-reader, don't block on batch reading

engine queue

engine queue work

driver updates

carry data between pipeline stages

log sync progress

wip init pipeline

fetch l1 data as part of derivation pipeline

init fix

work in progress channel bank reset change

channel bank resetting as part of pipeline

define interfaces for stages, clean up l1 interface usage

less trigger happy derivation pipeline resets, just reset when the pipeline says we need to

test utils

update driver snapshot usage, move L1Info interface to eth package, misc driver cleanup

use channel emitter for api, fix build issues

update batch submitter (work in progress, needs more testing)

engine queue fix (@trianglesphere)

find sync start reduce args, just get l2 head directly

fix channel reader: don't attempt to read when there's no channel data yet

log batcher and proposer in e2e

channel emitter / channel out reader fixes

fix channel emitter timeout

fix channel reading end

fix unexpected eof when buffer is not filled due to compressing layer also buffering

add logging to batch filtering

fix batch inputs, don't derive attributes before reading all batches of the origin

all derivation pipeline stages now have the same Step and ResetStep interfaces

misc open/close origin fixes and sync work

fix test

lint

improve testutils, fix l1 mock, implement calldata source tests

more mocking/testing utils, split l1 source/traversal, test first few stages

improve mock test utils, don't use bignum in l2 api

test pipeline per stage

channel timeout config param, test channel bank

fix batcher channel timeout flag

new op-batcher

new batcher in the op-node

logging / disable parts of the op-node for testing

fix off by one in batcher

Close l1src stage

Note: may want to pass the close further out / have more complex
logic about open/close.

logging + hacks to make the sequencer work & verifier half work

change open/close origin api, fix genesis seq nr bug, e2e passing

fix progress/origin naming, avoid engine api linear unwind in consolidation, fix batcher process closing

remove old ChannelEmitter, remove ChannelOutReader in favor of ChannelOut, fix tests, clean up unused l2 engine change, clean up op-batcher flags

fix op-batcher flags / docker compose update

clean up logging

lint

test valid -> if err == nil, not err != nil

L1Source -> L1Retrieval, fix receiver names

wait for derivation to be idle before sequencing new block

implement verifier and sequencer confirmation depth

op-node: Add Epoch Hash to batch

This commits a batch to a specific L1 origin block by hash rather
than just by number. This help in the case of L1 reorgs by stopping
batches from being applied in weird ways.

fix missing epoch block hash

batcher: Handle multiple frames per channel

The batcher is still very simple generating a new channel full of
L2 blocks since the last channel that it created, but it is just
a tad smarter now in that if will handle the case of multiple frames
per channel.

This is the bare minimum functionality to handle happy case batching
on a real network. The only other thing that it can't handle is
reorgs, but it can now handle very larger L2 transactions and blocks.
@mergify mergify bot removed the conflict label Jun 28, 2022
@github-actions github-actions bot added the A-pkg-core-utils Area: packages/core-utils label Jun 28, 2022
mslipper and others added 3 commits June 29, 2022 01:07
@mslipper mslipper merged commit e14351f into develop Jun 30, 2022
@mslipper mslipper deleted the batch-derivation branch June 30, 2022 18:00
theochap added a commit that referenced this pull request Dec 10, 2025
Fixes design inconsistency where sequencer keys could only be passed via
CLI args while regular P2P keys support file loading.

This adds `--p2p.sequencer.key.path` parameter to match the existing
`--p2p.priv.path` pattern.

This resolves the[ TODO
mentioned](https://github.com/ethereum-optimism/optimism/blob/44d3429d2913c8c90fbb0848e14c1022b8ca2267/op-devstack/sysgo/l2_cl_kona.go#L196)
in optimism's devstack where they noted the missing file support for
sequencer keys.

---------

Co-authored-by: theo <80177219+theochap@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pkg-core-utils Area: packages/core-utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants