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

Add CLI config validation of op-batcher to prevent submitting Blobs into Alt DA #274

Open
wants to merge 1 commit into
base: celo10
Choose a base branch
from

Conversation

Kourin1996
Copy link

Fixes https://github.com/celo-org/celo-blockchain-planning/issues/784

This PR adds a new validation of CLI configuration of op-batcher. op-batcher throws error in runtime when submitting blobs type txdata into Alt DA.

This PR adds new validation for the 'op-batcher' CLI configuration. 'op-batcher' throws an error at runtime when submitting blobs of type txdata into Alt DA

func (l *BatchSubmitter) publishToAltDAAndL1(txdata txData, queue *txmgr.Queue[txRef], receiptsCh chan txmgr.TxReceipt[txRef], daGroup *errgroup.Group) {
// sanity checks
if nf := len(txdata.frames); nf != 1 {
l.Log.Crit("Unexpected number of frames in calldata tx", "num_frames", nf)
}
if txdata.asBlob {
l.Log.Crit("Unexpected blob txdata with AltDA enabled")
}

The validation added in this PR prevents both Alt DA mode and Blob types from being enabled at the same time.

FYI: If the TxData type is 'auto', the txdata type will be set to 'calldata' for now.

@Kourin1996 Kourin1996 self-assigned this Nov 27, 2024
@karlb
Copy link

karlb commented Nov 27, 2024

The devnet-celo job only fails due to flakiness from what I can see (#235).

@karlb
Copy link

karlb commented Nov 27, 2024

FYI: If the TxData type is 'auto', the txdata type will be set to 'calldata' for now.

It looks different to me in

case flags.BlobsType, flags.AutoType:
if !cfg.TestUseMaxTxSizeForBlobs {
// account for version byte prefix
cc.MaxFrameSize = eth.MaxBlobDataSize - 1
}
cc.UseBlobs = true

Am I looking at the wrong thing?

@Kourin1996
Copy link
Author

@karlb I need double check. I have to follow some code. Will do now. Thank you!

@Kourin1996
Copy link
Author

@karlb

As you mentioned, UseBlobs is set for for auto batch data type.
However, this will be reset below this in the same function.

if cfg.DataAvailabilityType == flags.AutoType {
// copy blobs config and use hardcoded calldata fallback config for now
calldataCC := cc
calldataCC.TargetNumFrames = 1
calldataCC.MaxFrameSize = 120_000
calldataCC.UseBlobs = false
calldataCC.ReinitCompressorConfig()
bs.ChannelConfig = NewDynamicEthChannelConfig(bs.Log, 10*time.Second, bs.TxManager, cc, calldataCC)
} else {
bs.ChannelConfig = cc
}

NewDynamicEthChannelConfig is a module that fetches configuration dynamically. As far as I search the code, UseBlobs won't update regardless of the batch data type right now.

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