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

Open Beginner friendly
#69 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
backend

Research direction

Read validator/service/service.go and start at Start(), then follow the checkBlobs loop. Exercise the cases where headSlot is below finalizedL1Offset and where end is below NumBlocks. Done means Start() returns an early error for the invalid head slot, clamps the other start value instead of underflowing, and no longer hangs.

Written by the indexing model from the issue text.

Description

In validator/service/service.go Start(), phase0.Slot is uint64. If headSlot < finalizedL1Offset (64), the subtraction wraps around to a very large value. Similarly if end < NumBlocks (default 600), start wraps around. The checkBlobs loop then iterates from a huge start value up to end, effectively hanging the validator.

Fixed by:

  1. Guard headSlot against finalizedL1Offset and return an error early
  2. Clamp start to 0 when end < numBlocks instead of underflowing
Dominant language
Go
Stars
126
Forks
87
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from base/blob-archiver

All issues in base/blob-archiver

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.