Skip to content

Commit

Permalink
fix other log stringers on block
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Jan 24, 2024
1 parent a7473f4 commit 21fd029
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/firehose/prometheus_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func runPrometheusExporterE[B firecore.Block](chain *firecore.Chain[B], zlog *za
}

if cursor, err := bstream.CursorFromOpaque(response.Cursor); err == nil {
zlog.Info("Got block", zap.Stringer("block", cursor.Block))
zlog.Info("Got block", zap.String("block", cursor.Block.ID()), zap.Uint64("block_num", cursor.Block.Num()))

lastBlockLock.Lock()
lastBlockReceived = time.Now()
Expand Down
4 changes: 2 additions & 2 deletions merged_blocks_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func (w *MergedBlocksWriter) ProcessBlock(blk *pbbstream.Block, obj interface{})
return fmt.Errorf("received unexpected block %s (not a boundary, not the first streamable block %d)", blk, bstream.GetProtocolFirstStreamableBlock)
}
w.LowBlockNum = LowBoundary(blk.Number)
w.Logger.Debug("setting initial boundary to %d upon seeing block %s", zap.Uint64("low_boundary", w.LowBlockNum), zap.Stringer("blk", blk))
w.Logger.Debug("setting initial boundary to %d upon seeing block %s", zap.Uint64("low_boundary", w.LowBlockNum), zap.Uint64("blk_num", blk.Number))
}

if blk.Number > w.LowBlockNum+99 {
w.Logger.Debug("bundling because we saw block %s from next bundle (%d was not seen, it must not exist on this chain)", zap.Stringer("blk", blk), zap.Uint64("last_bundle_block", w.LowBlockNum+99))
w.Logger.Debug("bundling because we saw block %s from next bundle (%d was not seen, it must not exist on this chain)", zap.Uint64("blk_num", blk.Number), zap.Uint64("last_bundle_block", w.LowBlockNum+99))
if err := w.writeBundle(); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion node-manager/mindreader/archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (a *Archiver) Start(ctx context.Context) {

func (a *Archiver) StoreBlock(ctx context.Context, block *pbbstream.Block) error {
if block.Number < a.startBlock {
a.logger.Debug("skipping block below start_block", zap.Stringer("block", block), zap.Uint64("start_block", a.startBlock))
a.logger.Debug("skipping block below start_block", zap.Uint64("block_num", block.Number), zap.Uint64("start_block", a.startBlock))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion node-manager/mindreader/mindreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (p *MindReaderPlugin) consumeReadFlow(blocks <-chan *pbbstream.Block) {

err := p.archiver.StoreBlock(ctx, block)
if err != nil {
p.zlogger.Error("failed storing block in archiver, shutting down and trying to send next blocks individually. You will need to reprocess over this range.", zap.Error(err), zap.Stringer("received_block", block))
p.zlogger.Error("failed storing block in archiver, shutting down and trying to send next blocks individually. You will need to reprocess over this range.", zap.Error(err), zap.String("received_block", block.Id), zap.Uint64("received_block_num", block.Number))

if !p.IsTerminating() {
go p.Shutdown(fmt.Errorf("archiver store block failed: %w", err))
Expand Down

0 comments on commit 21fd029

Please sign in to comment.