Skip to content
This repository was archived by the owner on Oct 9, 2026. It is now read-only.

fix(validator): guard against uint64 underflow in Start() slot arithmetic - #70

Merged
danyalprout merged 1 commit into
base:masterfrom
ygd58:fix/validator-slot-underflow
Oct 6, 2026
Merged

danyalprout merged 1 commit into
base:masterfrom
ygd58:fix/validator-slot-underflow

Conversation

@ygd58

@ygd58 ygd58 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #69.

phase0.Slot is uint64. In Start(), two subtractions can wrap around:

  1. headSlot - finalizedL1Offset wraps if the beacon head is below slot 64. Added an early return with a descriptive error.
  2. end - phase0.Slot(a.cfg.NumBlocks) wraps if the chain has fewer than NumBlocks slots. Clamped start to 0 in that case instead of underflowing.

The checkBlobs loop iterates slot := start to end, so a wrapped start value would cause the validator to hang iterating an astronomically large range. All existing tests pass.

@cb-heimdall

cb-heimdall commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@ygd58

ygd58 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

hey @wbnns @danyalprout can you take a look? fixes a uint64 underflow in the validator Start() that would cause the blob checker to hang on a chain with fewer than 664 slots.

@wbnns

wbnns commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@ygd58 Similarly to the other thread, I wouldn't be the right person to give guidance here. :)

@danyalprout
danyalprout merged commit 0373a61 into base:master Oct 6, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(validator): uint64 underflow in Start() when head slot is below finalizedL1Offset or NumBlocks

4 participants