Make latest_round accept one or many data ids - #182
Draft
Fletch153 wants to merge 7 commits into
Draft
Conversation
Soroban Contract Test Coverage92.64% line coverage — 18001 / 19431 lines hit
Per-Contract Breakdown
Full file-level coverage report |
Fletch153
force-pushed
the
feature/DF-25429/latest-rounds-bulk-read
branch
5 times, most recently
from
August 15, 2026 13:13
0c5da95 to
a7d9518
Compare
The DON transmitter reads every feed's latest state each round to gate on deviation and heartbeat; single-feed reads would cost one consensus call per feed. latest_round now takes a Vec of ids and returns an Option<RoundData> per id. Page sizing is the caller's concern; the host's own budget and footprint limits bound oversized calls either way. The cache no longer cares about freeze on any read path: it holds state and serves it raw, exposing only the is_frozen flag. The proxy decides: every consumer read is prefixed with an is_frozen check that fails with the same FeedFrozen error as before. The check costs no extra ledger reads since every reader loads the feed_state entry holding the flag anyway. Freezing blocks consumer reads, never DON writes, so the transmitter keeps reading and writing frozen feeds. Self-upgrade wasm fixtures are rebuilt.
The mock cache derived its latest round from an injected round list with its own max-by-round-id logic, a transcription of cache behavior that could silently drift from the real contract. Tests now inject the exact RoundData the cache would return for latest_round, and the freeze flag is injected explicitly for is_frozen, so the mock holds answers rather than reimplementing cache logic.
Fletch153
force-pushed
the
feature/DF-25429/latest-rounds-bulk-read
branch
from
August 15, 2026 13:31
a7d9518 to
3adf29f
Compare
Fletch153
force-pushed
the
feature/DF-25429/latest-rounds-bulk-read
branch
from
August 17, 2026 13:21
e93e23c to
3d094b2
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,decimalsanddescriptionnow takes aVecof data ids and returns anOption<>per id, so the DON transmitter reads its whole feed book in one consensus call; a single-feed read is a one-element vec.is_frozenflag. The proxy decides, prefixing every consumer read with anis_frozencheck that fails with the sameFeedFrozenerror as before.