Repository navigation
Define and enforce representable oracle price bounds - #1793
Merged
Merged
Conversation
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.
A raw oracle price can fit uint256 while its conservative bound does not. Define the helper's supported domain as
p <= floor(MAX_UINT256 * (D - e) / D)and reject larger prices with an understandable revert string. Both helpers reject uncertainty at or above 100%. Representable results retain exact outward rounding and zero-uncertainty identity across the entire uint256 range.Update INV-27 with the domain and production caller argument: positive collateral and uint128 REP at 1e18 precision keep funded prices safely representable for every permitted uncertainty. Cached getters, report authorization, and the authenticated capital callback inherit that bound; initial cached zero is supported too.
Refresh every affected bytecode consumer: generated bot runtime identities, public deployment and bootstrap-descendant hash pins, four deterministic deployment manifests, the audited Solidity source fingerprint, and the documentation search index. Runtime pins are verified against fresh local deployments for Sepolia, deterministic-WETH testnets, and mainnet, including both genesis outcomes. Existing rejection of incorrect deployed code is preserved. No live deployment was performed.
Addresses #1791. The SolidCore model mentioned in the issue exists only in separate open PR #1784, not in main or this checkout. That PR must regenerate against this helper and expect the explicit revert instead of panic 0x11; this change does not import its unmerged formal toolchain.
Validation includes full TypeScript; targeted oracle, capital, report, auction-rounding, documentation, and deployment tests; complete bot-shared and liquidator package checks; formatting; full repository checks; both Knip modes; generated-output freshness; and diff whitespace checks. The new boundary regression was preceded by an Anvil reproduction of the old arithmetic panic.
Chromium documentation QA at 1440×900 and 390×844 found no overflow or runtime errors. Documentation review scored 93/100 and visual review 94/100, both without findings. Subsequent runtime hash updates change no rendered content, layout, or simulation behavior. App layout scans, unrelated root suites, and live-network checks are excluded for that scope; deterministic deployment integration tests cover the changed verification paths.
Merged the current
origin/main(#1790) without conflicts. On the merged branch, all 1,006 selected tests passed: 94 oracle/capital tests, 120 deployment/documentation/SDK tests, 403 bot-shared tests, and 389 liquidator tests. Full TypeScript, formatting, repository checks, Knip, generated freshness, and diff checks passed. Branch-current gate: behind count 0. Final code review: 96/100, no findings.