-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cl/forkchoice: harden Gloas envelope persistence #23152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ab1430e
7b866b0
532d14e
0fd4267
c83a147
6ad6496
a4be61c
d15cc63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,3 +149,10 @@ func (b *ByteListSSZ) SetBytes(buf []byte) error { | |
| func (b *ByteListSSZ) Len() int { | ||
| return len(b.data) | ||
| } | ||
|
|
||
| func (b *ByteListSSZ) ValidateBounds(limit uint64) error { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bound is taken as a parameter while the instance already carries
Either validate against |
||
| if uint64(len(b.data)) > limit { | ||
| return fmt.Errorf("data length %d exceeds limit %d", len(b.data), limit) | ||
| } | ||
| return nil | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four lists are progressive in Gloas, so a hard
len <= configured maxcheck rejects what the decoder accepts.For Gloas,
ensureListsbuilds all five viaNewStaticProgressiveListSSZ, whose limit isprogressiveDecodeLimit(configLimit)=2 * configLimit.progressiveDecodeLimit's own comment says: "Progressive lists are semantically unbounded, so decode limits are resource guards rather than protocol maxima."validateForPersistencefollows that forDeposits(ValidateProgressiveDecodeBounds, i.e. 2x), but lines 240-251 apply the raw 1x protocol maximum to the other four.Two consequences:
MaxDepositRequestsPerPayload + 1deposits is accepted, one withMaxWithdrawalRequestsPerPayload + 1withdrawals is rejected.ReadEnvelopeFromDiskalso runs this, and a failure setsinvalidEnvelopespermanently. Any config tightening of these four maxima turns already-persisted envelopes into permanently unreadable ones and killsHasEnvelopefor those roots.Per
cl/CLAUDE.md("Review all changes against the upstream Ethereum consensus specifications"), either useValidateProgressiveDecodeBoundsfor all five or drop the four 1x checks.