[codex] Add combined Binance and Polymarket oracle E2E - #758
Draft
ByteYue wants to merge 17 commits into
Draft
Conversation
ByteYue
force-pushed
the
codex/sports-score-oracle-poc
branch
from
June 28, 2026 14:47
65d73c4 to
459ebc7
Compare
ByteYue
force-pushed
the
codex/sports-score-oracle-poc
branch
2 times, most recently
from
July 18, 2026 10:08
57c27c8 to
6b80d5d
Compare
Remove the legacy continuous query parameter from Binance task URIs and document that binance_index_kline_v1 is inherently continuous. Pin the SDK lockfile to gravity-reth d8cb206f6, and require a new feedId whenever the bucket origin or interval changes.
Pin the latest Aptos JWK observation fix and the aligned reth relayer revision, then launch four equal-power validators against explicit closed Binance index-price buckets. The suite verifies independent per-validator certification and relayer state, a three-of-four voting-power QC, Binance-to-contract price equality, and identical resolver rounds from all four RPCs. It also lets genesis generation accept git worktrees. Verified with Binance Futures testnet: 4 active validators, QC threshold 3/4, and 1 passed in 43.96s.
ByteYue
force-pushed
the
codex/sports-score-oracle-poc
branch
from
July 23, 2026 10:29
4142b88 to
5cb4e29
Compare
Keep the four-validator Binance suite's fixed listeners below Linux's default ephemeral source-port range and keep the advertised genesis validator/VFN addresses aligned with runtime listeners. Validated with the live Binance testnet indexPriceKlines flow: BINANCE_PRICE_FEED_MODE=live BINANCE_PRICE_FEED_BASE_URL=https://testnet.binancefuture.com BINANCE_PRICE_FEED_LAG_MINUTES=4 ./gravity_e2e/run_test.sh binance_price_feed_multivalidator --force-init --log-cli-level=INFO Result: 1 passed; four active validators formed JWK quorum and all RPCs observed the same on-chain NVDAUSDT/TSLAUSDT round.
Remove the binary market deadline from the E2E create tuple, switch to permissionless finalizeMarket, and update all Market tuple indices after the ABI change. Assert the resolver winner classification and Polygon provenance before finalization. Pin oracle_demo to contracts commit 0f769b8 and document the per-suite contract revisions and strict mirror semantics. Tests: not run; oracle_demo execution deferred to the next session as requested.
Exercise a four-validator binary rollout while the existing bridge source remains live, then activate Binance price feeds and a Polymarket mirror through governance at the next epoch. Verify independent relayer checkpoints, JWK quorum evidence, fixed-size source progress, replica consistency, and restart catch-up.
Add a manual four-validator soak that registers a continuous Binance NVDA feed and one real Polymarket mirror through governance, waits for next-epoch activation, and monitors quorum-backed source progress, four-RPC consistency, liveness, restart recovery, replay safety, and final provider equality for a configurable duration.
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
This PR adds the Gravity Oracle transport and E2E surface for:
indexPriceKlinesbuckets throughsourceType=3;sourceType=6;The relayer-backed observations reuse the existing unsupported-JWK consensus path and execute agreed bytes through
NativeOraclecallbacks.E2E coverage
The review surface is intentionally limited to three non-overlapping suites:
oracle_demopolymarket_mockbinance_price_feed_multivalidatorFollow-up commit
29a6bab01eaddressesGalxe/gravity-audit#1033:binance_price_feedsuite;f5bd9a8079;This reduces the GitHub PR diff from
4613+/395-to3586+/395-while retaining the distinct deterministic, three-outcome settlement, live-source, and quorum assertions.Canonical runbook:
gravity_e2e/docs/ORACLE_E2E.md.Binance task semantics
binance_index_kline_v1is continuous by definition. The task URI rejects the legacycontinuousparameter. For eachfeedId,bucketStartMsandintervalare immutable; use a newfeedIdwhen either changes. This keeps delivery nonce, bucket time, and confirmed-cursor reconciliation monotonic.Run
Build once:
RUSTFLAGS="--cfg tokio_unstable" \ cargo build --profile quick-release -p gravity_node -p gravity_cli --lockedDeterministic combined gate:
PATH="$HOME/.foundry/bin:$PWD/target/quick-release:$PATH" \ ./gravity_e2e/run_test.sh oracle_demo --force-initFocused three-outcome Polymarket gate:
PATH="$HOME/.foundry/bin:$PWD/target/quick-release:$PATH" \ ./gravity_e2e/run_test.sh polymarket_mock --force-initThe live four-validator command, outbound approval boundary, replay parameter, frontend mode, stop commands, and expected evidence are maintained only in the canonical runbook.
Pinned revisions
f5bd9a80794c318ea1ccdbd0fb7f15e1e83dbdad20af4ae4a2125f6232d6b2c5e7cc3f40140f250110c4553b16aead745e1701db7885a39313607b2610c491bc7fe69838398971281270ce438c72e17aCargo.lockcontains one Aptosapi-typesrevision.Validation
Current cleanup commit:
py_compile;git diff --checkpasses.The live four-validator suite previously passed at the pinned heads with four active validators, a 3-of-4 threshold, identical resolver rounds across four RPCs, and
1 passed in 47.97s.Scope boundary
These suites prove configured task execution and contract consumption. They do not implement generic intra-epoch request discovery or automatic mirroring of arbitrary Polymarket UI markets. Production mirrors still require reviewed manifests, finality gates, watermarks, deadlines, and typed pending or expired states.