Skip to content

test(st): attestation with already-justified target is silently skipped#591

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
menawar:test/576-attestation-already-justified-target-silently-skipped
Apr 11, 2026
Merged

test(st): attestation with already-justified target is silently skipped#591
tcoratger merged 1 commit intoleanEthereum:mainfrom
menawar:test/576-attestation-already-justified-target-silently-skipped

Conversation

@menawar
Copy link
Copy Markdown
Contributor

@menawar menawar commented Apr 11, 2026

Summary

  • Add test_attestation_with_already_justified_target_is_silently_skipped to test_justification.py
  • Justifies slot 1 via supermajority (validators 0–2), then includes a late attestation from validator 3 targeting the same already-justified slot 1
  • Verifies the duplicate attestation is silently skipped: no error, no double-counting, no pending vote residue

🔗 Related Issues or PRs

closes #576

Design notes

The test uses the simplest possible chain (4 validators, 3 slots) to isolate the skip path at State.process_attestations where justified_slots.is_slot_justified(...)
returns True and the attestation is dropped via continue.

Post-state assertions confirm:

  • latest_justified_slot stays at 1 (no regression)
  • justifications_roots and justifications_validators are empty (pending votes were cleared on justification and the skipped attestation created no new ones)
  • justified_slots is unchanged (no double-marking)

Test plan

  • uv run fill --fork=devnet --clean -n auto -k test_attestation_with_already_justified passes
  • Full suite uv run fill --fork=devnet --clean -n auto passes (no regressions)
  • uvx tox -e all-checks — ruff, ty, codespell, mdformat all pass

@tcoratger tcoratger merged commit e58a13c into leanEthereum:main Apr 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(st): attestation with already-justified target is silently skipped

2 participants