Commit a0dfdef
committed
fix: prevent uint64 underflow in ListFinalizedSlots on short-lived chains
When the finalized epoch is smaller than historical_epoch_count (e.g. on a
freshly started devnet or kurtosis enclave), the previous expression
`latestSlot - SlotsPerEpoch*HistoricalEpochCount` underflows uint64 and
produces a value near 2^64, so the loop never executes and the
/checkpointz/v1/beacon/slots endpoint returns an empty list — leaving the
UI's historical checkpoints table blank until the chain has produced
HistoricalEpochCount epochs.
Clamp the lower bound at 0 so we return every available finalized
epoch-boundary slot, regardless of chain age.
Same fix as #241 but targeted at release/gloas so gloas devnets can pick
it up without waiting for a master merge.1 parent 9326d5c commit a0dfdef
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
752 | | - | |
| 751 | + | |
753 | 752 | | |
754 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
755 | 763 | | |
756 | 764 | | |
757 | 765 | | |
| |||
0 commit comments