Repository navigation
Define INV-01 for representable healthy-price boundaries - #1798
Merged
Merged
Conversation
KillariDev
enabled auto-merge
November 26, 2026 15:32
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 26, 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.
INV-01 previously promised a public inverse boundary across unrestricted uint256 inputs, although the checked inverse can overflow when every representable price is healthy. This change explicitly requires representable intermediate values and boundary; it preserves reverting arithmetic rather than introducing saturation. At uint256.max there is no representable successor price.
The compiled-Solidity regression covers issue #1796's forward quote, adjacent successful inverse, overflowing inverse, and an exactly representable uint256.max boundary. NatSpec states the overflow policy. The invariant reference reconciles this domain with the existing source-model counterexample and supply-cap proof in the still-open proof PR #1784; no Lean infrastructure is imported or changed.
Closes #1796.
Validation: full TypeScript check; 68 focused contract/documentation runtime tests; documentation runtime rerun after search-index regeneration; formatting; full repository checks; Knip; generated-artifact freshness; and
git diff --checkpassed. The branch is current withorigin/main.The documentation source fingerprint and generated search index are refreshed. Chromium QA at 1440×900 and 390×844 found no horizontal overflow. Documentation review scored 94/100 and visual review 95/100, both with no findings. No executable behavior or ABI changed, so unrelated consumer suites and app workflow/layout scans were excluded. Lean replay is outside this checkout: its infrastructure remains in open PR #1784; the existing source-model results were inspected and reconciled with the chosen domain.
Final review: 96/100, no findings. No findings were deferred.
The invariant separates the rule, formula, input conditions, and upper-bound behavior into short paragraphs, with source-model details linked under evidence. Documentation, formatting, and desktop/mobile QA passed again after the readability revision.