Skip to content

Commit 08c0875

Browse files
committed
chore: better logs in batcher
1 parent 1be0553 commit 08c0875

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

op-batcher/batcher/channel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (c *channel) TxFailed(id string, failoverToEthDA bool) {
6565
// and is only used while the altDA is down, so we can afford to be inefficient here.
6666
// TODO: figure out how to switch to blobs/auto instead. Might need to make
6767
// batcherService.initChannelConfig function stateless so that we can reuse it.
68+
c.log.Info("Failing over to calldata txs", "id", c.ID())
6869
c.cfg.DaType = DaTypeCalldata
6970
}
7071
c.metr.RecordBatchTxFailed()

op-batcher/batcher/channel_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func (s *channelManager) ensureChannelWithSpace(l1Head eth.BlockID) error {
318318
"compression_algo", cfg.CompressorConfig.CompressionAlgo,
319319
"target_num_frames", cfg.TargetNumFrames,
320320
"max_frame_size", cfg.MaxFrameSize,
321-
"da_type", cfg.DaType,
321+
"da_type", cfg.DaType.String(),
322322
)
323323
s.metr.RecordChannelOpened(pc.ID(), s.pendingBlocks())
324324

op-batcher/batcher/tx_data.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ const (
2121
DaTypeAltDA
2222
)
2323

24+
func (d DaType) String() string {
25+
switch d {
26+
case DaTypeCalldata:
27+
return "calldata"
28+
case DaTypeBlob:
29+
return "blob"
30+
case DaTypeAltDA:
31+
return "alt_da"
32+
default:
33+
return fmt.Sprintf("unknown_da_type_%d", d)
34+
}
35+
}
36+
2437
// txData represents the data for a single transaction.
2538
//
2639
// Note: The batcher currently sends exactly one frame per transaction. This

0 commit comments

Comments
 (0)