Commit 01d667a
committed
Fix attestation source divergence (leanSpec PR #506)
produce_attestation_data used store.latest_justified (global max across all
forks) as the attestation source, while build_block filters by
head_state.latest_justified. When a non-head fork block advances the
store-wide justified past the head chain's justified, every attestation
gets rejected during block building, producing blocks with 0 attestations
and stalling justification/finalization indefinitely.
Align with the 3sf-mini reference: derive the attestation source from the
head state's justified checkpoint. Also handle the genesis edge case where
the zero-hash root must be substituted with the real genesis block root,
matching the existing logic in build_block.
Update LEAN_SPEC_COMMIT_HASH to include the new spec test that exercises
the divergence scenario.1 parent 38229f5 commit 01d667a
2 files changed
+25
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
743 | 749 | | |
744 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
745 | 765 | | |
746 | | - | |
| 766 | + | |
747 | 767 | | |
748 | | - | |
| 768 | + | |
749 | 769 | | |
750 | 770 | | |
751 | 771 | | |
| |||
758 | 778 | | |
759 | 779 | | |
760 | 780 | | |
761 | | - | |
| 781 | + | |
762 | 782 | | |
763 | 783 | | |
764 | 784 | | |
| |||
0 commit comments