fix: prefer full-coverage oracles in ClassicCollector (1.0.3) - #65
Open
iMCrazyDev wants to merge 1 commit into
Open
fix: prefer full-coverage oracles in ClassicCollector (1.0.3)#65iMCrazyDev wants to merge 1 commit into
iMCrazyDev wants to merge 1 commit into
Conversation
When more oracles than minimalOracles were available, the collector picked the newest by timestamp without checking asset coverage. An oracle missing a requested asset (NOT is signed by 3 of 4 mainnet oracles) made generateMerkleProofDirect throw 'Trying to generate merkle proof for a missing key', failing every getPrices* call on the ALTS pool that included NOT. Selection now prefers oracles that cover every requested asset, and only assets provable by all selected oracles are packed into the price cell (uncoverable assets are dropped like assets with no median price). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
On the ALTS pool every
getPrices*call that includedNOTfailed with:Root cause: when more oracles than
minimalOraclesrespond,ClassicCollectorpicked the newest ones by timestamp only.NOTis currently signed by 3 of the 4 mainnet oracles (oracle84df…ea24omits it), so whenever that oracle landed in the top-3,packOraclesDatatried to build a merkle proof for a key the oracle's dict doesn't have and the whole call threw — even though 3 fully-covering oracles were available.Fix
Verified
getPricesruns failed on the missingNOTkey. After: 5/5 runs return prices for all 5 assets (GRAM USDT CATI NOT DOGS); main pool still returns 8/8.SUPPLY_WITHDRAW_SATISFIED, jettons paid out).tests/pricesjest results unchanged vsmain(pre-existing failures are Pyth endpoint auth / ICP source issues, untouched by this change).🤖 Generated with Claude Code