chain: log duplicate-AttestationData STF rejects with full context#850
Merged
Conversation
When a block is rejected for containing duplicate AttestationData
entries, log every distinguishing field of the duplicate so the
reproduction has enough on-the-wire context to diagnose without
pulling block bytes from a peer.
Two `AttestationData` values are equal iff every field (slot, head,
target, source) matches, so the new log line includes:
- blockroot, slot, proposer_index of the offending block
- the two indices [i, j] inside the block whose data hashed to
the same value
- data.slot
- data.head.blockroot @ slot
- data.target.checkpoint_root @ slot
- data.source.checkpoint_root @ slot
The format string is intentionally split across 5 logical chunks
(block-level / data / head / target / source) so it stays diff
friendly and operators can grep individual fields. Naming
(`blockroot=` / `checkpoint_root=`) mirrors neighbouring logs in
chain.zig (e.g. line ~1867's gossip-block log).
Splits the chain.zig portion of #848 review #6 into its own PR so
the wedge-fix for #837 stays focused on node.zig + metrics.
Refs #837, #848.
Signed-off-by: zclawz <zclawz@users.noreply.github.com>
anshalshukla
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits the chain.zig portion of #848 review #6 into its own PR so the wedge-fix for #837 stays focused on
pkgs/node/src/node.zig+pkgs/metrics/src/lib.zig.What this changes
When a block is rejected for containing duplicate
AttestationDataentries, log every distinguishing field of the duplicate so the reproduction has enough on-the-wire context to diagnose without pulling block bytes from a peer.Two
AttestationDatavalues are equal iff every field (slot,head,target,source) matches, so the new log line includes:blockroot,slot,proposer_indexof the offending block[i, j]inside the block whose data hashed to the same valuedata.slotdata.head.blockroot @ slotdata.target.checkpoint_root @ slotdata.source.checkpoint_root @ slotPre-fix log:
Post-fix log:
Review nits applied (point #9 from #848)
root=normalised toblockroot=/checkpoint_root=to match neighbouring logs inchain.zig(e.g. line ~1867 gossip block log).block.proposer_indexisValidatorIndex=u64, so{d}is correct.Refs
error.DuplicateAttestationDatareject of block accepted by every other client family #837 ask update codebase to support 0.14.0 #5