fix(L1): sanity-check protocol version fits in 128 bits - #387
Merged
Conversation
Collaborator
✅ Heimdall Review Status
|
jackchuma
previously approved these changes
Jul 29, 2026
registerUpgrade and setMinimumProtocolVersion accepted an unbounded uint256, but the offchain client packs a protocol version into only the lower 128 bits. Reject values above type(uint128).max so an oversized value can't silently truncate offchain.
PelleKrab
force-pushed
the
fix/protocol-version-max-size
branch
from
July 29, 2026 13:49
652d064 to
aa2f59b
Compare
cb-heimdall
dismissed
jackchuma’s stale review
July 29, 2026 13:49
Approved review 4807619613 from jackchuma is now dismissed due to new commit. Re-request for approval.
jackchuma
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registerUpgradeandsetMinimumProtocolVersionaccepted an unboundeduint256protocol version, but the offchain client only packs a protocol version into the lower 128 bits.ProtocolVersions_InvalidProtocolVersionif the provided value exceedstype(uint128).max, preventing a value that would silently lose its upper bits offchain.Test plan
test_setMinimumProtocolVersion_tooLarge_revertsandtest_setMinimumProtocolVersion_maxValue_succeedstest_registerUpgrade_minProtocolVersionTooLarge_revertsforge test— full suite passesjust semver-lock— refreshedProtocolVersionshash insnapshots/semver-lock.json