Skip to content

Commit

Permalink
chore: better logs in batcher
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Feb 14, 2025
1 parent 69ce69a commit 94b7c18
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions op-batcher/batcher/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (c *channel) TxFailed(id string, failoverToEthDA bool) {
// and is only used while the altDA is down, so we can afford to be inefficient here.
// TODO: figure out how to switch to blobs/auto instead. Might need to make
// batcherService.initChannelConfig function stateless so that we can reuse it.
c.log.Info("Failing over to calldata txs", "id", c.ID())
c.cfg.DaType = DaTypeCalldata
}
c.metr.RecordBatchTxFailed()
Expand Down
2 changes: 1 addition & 1 deletion op-batcher/batcher/channel_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (s *channelManager) ensureChannelWithSpace(l1Head eth.BlockID) error {
"compression_algo", cfg.CompressorConfig.CompressionAlgo,
"target_num_frames", cfg.TargetNumFrames,
"max_frame_size", cfg.MaxFrameSize,
"da_type", cfg.DaType,
"da_type", cfg.DaType.String(),
)
s.metr.RecordChannelOpened(pc.ID(), s.pendingBlocks())

Expand Down
13 changes: 13 additions & 0 deletions op-batcher/batcher/tx_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ const (
DaTypeAltDA
)

func (d DaType) String() string {
switch d {
case DaTypeCalldata:
return "calldata"
case DaTypeBlob:
return "blob"
case DaTypeAltDA:
return "alt_da"
default:
return fmt.Sprintf("unknown_da_type_%d", d)
}
}

// txData represents the data for a single transaction.
//
// Note: The batcher currently sends exactly one frame per transaction. This
Expand Down

0 comments on commit 94b7c18

Please sign in to comment.