Commit 7fb55f7
authored
Document attestation target clamping as defensive guard (#214)
## Motivation
A spec-to-code compliance audit (FINDING-003) identified that
`get_attestation_target` adds a clamping guard to `latest_justified`
that the spec does not have. The code was correct but lacked explanation
of why the guard exists and that it diverges from the spec.
## Description
Clarifies the comment on the `latest_justified` clamping in
`get_attestation_target` to explain:
- The spec's justifiability walk-back has no lower bound and can produce
attestations where `target.slot < source.slot`
- These would fail `is_valid_vote` Rule 5 and be discarded, but
producing them wastes work and pollutes the network
- The clamping is our defensive addition, not spec behavior
- This edge case triggers when a block advances `latest_justified`
between `safe_target` updates (interval 2)
## How to Test
Documentation-only change. `cargo test --workspace --release` passes.1 parent 3e54039 commit 7fb55f7
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
700 | 706 | | |
701 | 707 | | |
702 | 708 | | |
| |||
0 commit comments