Add a precision parameter to proxy round reads - #176
Draft
Fletch153 wants to merge 1 commit into
Draft
Conversation
Soroban Contract Test Coverage92.64% line coverage — 18001 / 19431 lines hit
Per-Contract Breakdown
Full file-level coverage report |
- latest_round/get_round take precision and downscale the stored answer to it; precision above the stored scale is rejected and a nonzero answer truncating to zero errors instead of reporting a false 0 - decimals/description stay pass-through; the cache is untouched - Rebuild the proxy self-upgrade fixture for the new signature
Fletch153
force-pushed
the
feature/DF-25429/proxy-precision-param
branch
from
August 7, 2026 21:15
6d9cd7b to
d729402
Compare
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
latest_round/get_roundtake aprecisionargument; the proxy downscales the stored answer to it.Stacks on #161. Supersedes the canonical-ID approach explored in #173.
Changes
precision: u32onlatest_roundandget_round;precision > stored→UnsupportedDecimals(51); a nonzero answer truncating to zero →AnswerTruncatedToZero(52);decimals/descriptionunchanged pass-throughs.mod scalingtests: stored-precision identity, 8dp/6dp downscale,get_roundscaling, negative truncation toward zero, both error paths; end-to-end downscale against the real cache.Testing
cargo testincontracts/data-feeds— 223 pass (180 cache unchanged, 9 common, 34 proxy).Notes
feature/DF-25434/data-feeds-deployment(Add data feeds cache and proxy bindings #162) need regenerating after this lands.