Skip to content

Commit

Permalink
da: try fallback to blobdata else try calldata
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxcanfly committed Jun 7, 2024
1 parent 5196308 commit c5c2684
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions op-batcher/batcher/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,14 @@ func (l *BatchSubmitter) calldataTxCandidate(data []byte) (*txmgr.TxCandidate, e
if l.DAClient.EthFallbackDisabled {
return nil, fmt.Errorf("celestia: blob submission failed; eth fallback disabled: %w", err)
}

l.Log.Info("celestia: blob submission failed; falling back to eth", "err", err)
// eth fallback: try using blobdata otherwise use calldata
// NOTE: the data already includes the version byte
candidate, err := l.blobTxCandidate(singleFrameTxData(frameData{data: data[1:]}))
if err == nil {
l.Log.Info("celestia: blob submission failed; falling back to eth blobdata", "err", err)
return candidate, nil
}
l.Log.Info("celestia: blob submission failed; falling back to eth calldata", "err", err)
}
return &txmgr.TxCandidate{
To: &l.RollupConfig.BatchInboxAddress,
Expand Down

0 comments on commit c5c2684

Please sign in to comment.