base / base/blob-archiver

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
Dominant language
Go
Stars
126
Forks
87
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.