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

feat(batcher): multi-frame channels for large eigenda blobs #22

Open
wants to merge 1 commit into
base: eigenda-develop
Choose a base branch
from

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Jan 29, 2025

TLDR

channel 1--1 frame 1--1 altda-commitment (current implementation)
channel 1--* frame *--1 alt-DA-commitment (this pr)

The target-num-frames batcher flag can be set to decide on the number of frames to pull from the channel.

Description

Currently altda forces using "calldata" channels, which restrict their txData output to a single frame at a time. EigenDA (and probably other altdas) support larger blobs than the default 128KB frame size. This PR allows channels to have the altDA da type, which allows them to output a much larger number of frames when queried for txData. These frames are then concatenated and sent as a large blob to the altda source.

Tests

No new tests because there isn't really any change in behaviour here since this is a small repurpose of frame concatenation logic that was already there (curious to see if the ci here will pass). The derivation pipeline also doesn't need any changes because it already can read multiple concatenated frames. Perhaps an e2e test to show that an op-node is able to derive the concatenated frames would be useful though?

Additional context

An alternative here would have been to still read single frame at a time, but increase the MaxL1FrameSize variable. This approach requires more changes, and the derivation pipeline also has hardcoded limits which would have needed to change. Also keeping small frames allows fallbacking to ethDA automatically if ever needed, potentially even inside a single channel.

@samlaf samlaf changed the title feat(batcher): multi-frame altda channels feat(batcher): multi-frame channels for large eigenda blobs Jan 29, 2025
@samlaf samlaf requested review from bxue-l2 and litt3 January 29, 2025 03:56
@@ -132,22 +132,22 @@ func (c *channel) ID() derive.ChannelID {
// NextTxData should only be called after HasTxData returned true.
func (c *channel) NextTxData() txData {
nf := c.cfg.MaxFramesPerTx()
txdata := txData{frames: make([]frameData, 0, nf), asBlob: c.cfg.UseBlobs}
txdata := txData{frames: make([]frameData, 0, nf), daType: c.cfg.DaType}
Copy link

Choose a reason for hiding this comment

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

you changed the field to DaType, but didn't update the function doc from UseBlobs

type DaType int

const (
DaTypeCalldata DaType = iota
Copy link

Choose a reason for hiding this comment

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

consider adding docs for these constants

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