Repository navigation
Conversation
Block-range validity only applies when BOTH bounds carry the range flag. There is no helper for block ranges, and the natural hand-rolled encoding for 'deadline, no start bound' (validUntil flagged, validAfter = 0) fails the both-bounds check and is silently interpreted as a timestamp range — the block deadline becomes validity for millions of years. The helper always flags both bounds and maps a zero deadline to an open-ended range, mirroring the timestamp convention. Signed-off-by: SashaMIT <sash@ela.city> Co-authored-by: Cursor <cursoragent@cursor.com>
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
EntryPoint._getValidationDataapplies block-number validity only when bothvalidAfterandvalidUntilcarryVALIDITY_BLOCK_RANGE_FLAG; otherwise the values are read as timestamps.validUntil = FLAG|N,validAfter = 0— fails the both-bounds check, soFLAG|N(~140 trillion) is read as a timestamp and the UserOp stays valid for ~4.4 million years instead of until block N._packValidationDataBlockRange(sigFailed, validUntilBlock, validAfterBlock)which always flags both bounds, and maps a zero deadline to an open-ended block range (mirroring the timestamp0 = indefinitelyconvention).Impact if unsolved
Accounts/paymasters encoding block deadlines with no start bound — e.g. "this intent is only valid for the next 100 blocks" — get silent unlimited validity: a signature intended to die at block N remains executable indefinitely if leaked or front-run later.
Test plan
#packValidationDataBlockRangecases intest/helpers.test.ts: both bounds flagged even when 0;sigFailedpreserved; zero deadline → open-ended range.yarn hardhat compile+ fulltest/helpers.test.tssuite passes (5/5).Made with Cursor