Repository navigation
fix: vote for the justified checkpoint when the target walk lands behind it - #47
Merged
Merged
Conversation
…ind it The attestation duty returned SourceAfterTarget, and the validator cast nothing, whenever the target walk selected a block behind the head's justified checkpoint. The walk is bounded by the safe target and the finalized checkpoint, never by the justified one, so a sparse chain reaches this: the three-node devnet5 run behind #42 had the head chain 62 -> 59 -> 51 -> 50 -> 49 -> 45 -> 42 with finalized 42 and justified 49, and the validator's weight was missing from slots 16 and 64. Every other lean client raises the target to the justified checkpoint here (ethlambda, ream, zeam, gean, lantern), and leanSpec PR #1207 (issue #1206) makes the spec say the same. attestation_data now does so and is infallible: the duty path had no other way to fail. The attested log names the source next to the target so a raised vote is visible. DutyError::Rejected stays for block production, which still returns rejections. Closes #44 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
The attestation duty was skipped with
SOURCE_AFTER_TARGETwhenever the target walk selected a block behind the head's justified checkpoint. The walk is bounded by the safe target and the finalized checkpoint, never by the justified one, so a sparse chain reaches this: the three-node devnet5 run behind #42 had the head chain62 → 59 → 51 → 50 → 49 → 45 → 42with finalized 42 and justified 49. Three steps from 62 reach 50, neither 50 nor 49 is justifiable after 42, the walk stops at 45, and the validator's weight was missing from slots 16 and 64.Every other lean client raises the target to the justified checkpoint here — ethlambda, ream, zeam, gean, lantern (qlean-mini bounds only the first walk). Upstream, leanSpec #1206 describes the reachable assert and leanSpec PR #1207 makes the spec say the same; the clamp there sits in
produce_attestation_data, soget_attestation_targetand the fixtures that check it are unchanged.Changes
verity-chainattestation_data: when the source is after the target, the target is the justified checkpoint. The function is now infallible — the duty path had no other way to fail — and so isChainView::attestation_data.RejectionReason::SourceAfterTargetstays for incoming attestation validation.verity-validator: theattesteddebug log names the source next to the target, so a raised vote is visible in the log.DutyError::Rejectedstays: block production still returns rejections through it.duties.rsbuild the devnet chain above on a genesis store. The first fails ondevelop(target 45 behind source 49) and passes here; the second checks a target at or after the source is left as the walk selected it.Validation
cargo fmt --all --check,cargo clippy --locked --workspace --all-targets -- -D warnings,cargo test --locked --workspace,cargo deny --locked check,typos— all green.Closes #44
🤖 Generated with Claude Code