[Certora] earliest time spec with decreasetimelock#901
Open
lilCertora wants to merge 1 commit intomainfrom
Open
[Certora] earliest time spec with decreasetimelock#901lilCertora wants to merge 1 commit intomainfrom
decreasetimelock#901lilCertora wants to merge 1 commit intomainfrom
Conversation
QGarchery
reviewed
Mar 6, 2026
|
|
||
| // The timelocked() function enforces block.timestamp >= executableAt[msg.data]. | ||
| // The checker read execAtOfOp = vault.executableAt(msg.data) with the same msg.data. | ||
| // The prover can't link these reads across contracts, so we add the constraint explicitly. |
Collaborator
There was a problem hiding this comment.
curious to understand what this means, why can't it do that ? I had some verification jobs that were passing where values are taken from different contracts
Comment on lines
+149
to
+150
| assert viaDirectAfter >= earliestBefore; | ||
| assert viaFreshAfter >= earliestBefore; |
Collaborator
There was a problem hiding this comment.
If viaDecreaseAfter < earliestBefore, then we have earliestAfter < earliestBefore, which is what we want to show cannot happen.
So I think the argument why it's ok is that viaDecrease actually increases when decreaseTimelock is called, as explained here
Comment on lines
+133
to
+135
| mathint viaDecreaseBefore = (timelockAfter < timelockBefore && execAtOfOp != 0) | ||
| ? to_mathint(execAtOfOp) + to_mathint(timelockAfter) | ||
| : max_uint256; |
Collaborator
There was a problem hiding this comment.
Collaborator
There was a problem hiding this comment.
I think you can reuse the EarliestTime.sol for that
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.
Added extra comments in order to make understanding easier but we can remove them later
=> Verify
earliestExecutionTimeIncreasesfordecreaseTimelockby bypassing the prover's msg.data-in-hooks limitation using the fallback pattern. Paths 1 (direct execution) and 2 (fresh submission) are formally verified; path 3 (remaining pending ops) holds by the argument that removing an element from a min can only increase it (due to code)