From e4f20474f1611410ec0e0d5b57694fb319965182 Mon Sep 17 00:00:00 2001 From: Dhruv Bodani Date: Wed, 1 Nov 2023 17:16:38 +0530 Subject: [PATCH] core/tracker: fix inclusion checker bug (#2670) Fixes inclusion checker bug which was reporting false negatives about the inclusion blinded blocks. This happened because of misconfiguration between deadline of a duty and inclusion checker lag. Duty deadline of `builder_proposer` is 5 slots while inclusion lag is 4 slots. Inclusion checker should start checking after duty deadline is hit to avoid getting any submissions after that. Which is why even the blinded block was _actually_ proposed successfully, inclusion checker marked it failed as duty was still active and retryer was busy retrying `blinded_block` submission request. category: bug ticket: #2661 --- core/tracker/inclusion.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/core/tracker/inclusion.go b/core/tracker/inclusion.go index 97485657a..188730388 100644 --- a/core/tracker/inclusion.go +++ b/core/tracker/inclusion.go @@ -19,9 +19,12 @@ import ( const ( // InclCheckLag is the number of slots to lag before checking inclusion. - // We wait for 4 slots to mitigate against reorgs as it should cover almost all reorg scenarios. - // Reorgs of more than 4 slots are very rare in ethereum PoS. - InclCheckLag = 4 + // We wait for 6 slots to mitigate against reorgs as it should cover almost all reorg scenarios. + // Reorgs of more than 6 slots are very rare in ethereum PoS. + // The inclusion checker should begin checking for the inclusion of duties after the duty deadline is reached, + // i.e., after 5 slots. + InclCheckLag = 6 + // InclMissedLag is the number of slots after which we assume the duty was not included and we // delete cached submissions. InclMissedLag = 32 @@ -194,6 +197,17 @@ func (i *inclusionCore) CheckBlock(ctx context.Context, block block) { continue } + msg := "Broadcasted block included on-chain" + if sub.Duty.Type == core.DutyBuilderProposer { + msg = "Broadcasted blinded block included on-chain" + } + + log.Info(ctx, msg, + z.I64("block_slot", block.Slot), + z.Any("pubkey", sub.Pubkey), + z.Any("broadcast_delay", sub.Delay), + ) + // Just report block inclusions to tracker and trim i.trackerInclFunc(sub.Duty, sub.Pubkey, sub.Data, nil) delete(i.submissions, key)