ChainSafe / ChainSafe/ssz

bitlist maxSize off by one and inconsistent progressive list default limits

Open Beginner friendly
#548 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
61
Forks
26
Avg merge
3h 20m
Merged PRs (30d)
6

Description

Two small follow-ups from #545, noticed while wiring the limits into lodestar (ChainSafe/lodestar#10042).

- `BitListType` and `ProgressiveBitListType` compute `maxSize = Math.ceil(limitBits / 8) + 1`, which over-estimates by one byte when `limitBits` is not a multiple of 8 (limit 7 gives 2, the largest encoding is 1 byte). Exact is `Math.floor(limitBits / 8) + 1`.
- `ProgressiveByteListType` defaults its limit to `PROGRESSIVE_LIST_MAX_SIZE` while `ProgressiveListBasicType`, `ProgressiveListCompositeType` and `ProgressiveBitListType` default to `Number.MAX_SAFE_INTEGER`.

Both are harmless as `maxSize` is only used as an upper bound, noting for consistency.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the BitListType, ProgressiveBitListType, ProgressiveByteListType, ProgressiveListBasicType, and ProgressiveListCompositeType definitions. Check the maxSize calculation and each default limit, then run the relevant existing test suite to verify the byte bound and progressive-list defaults are consistent.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.