Skip to content

Commit

Permalink
track oversize block errors in metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo authored and arajasek committed Nov 17, 2020
1 parent e23170d commit 8191654
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chain/sub/incoming.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ func (bv *BlockValidator) validateLocalBlock(ctx context.Context, msg *pubsub.Me

if size := msg.Size(); size > 1<<20-1<<15 {
log.Errorf("ignoring oversize block (%dB)", size)
ctx, _ = tag.New(ctx, tag.Insert(metrics.FailureType, "oversize_block"))
stats.Record(ctx, metrics.BlockValidationFailure.M(1))
return pubsub.ValidationIgnore
}

Expand Down

0 comments on commit 8191654

Please sign in to comment.