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 committed Aug 19, 2020
1 parent 29e409d commit 2ac3af7
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 @@ -329,6 +329,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 2ac3af7

Please sign in to comment.