test(oracle): add deterministic Binance quorum E2E - #805
Merged
Conversation
Pin the merged generic relayer runtime and exercise two closed Binance index-price buckets across four equal-power validators. The suite registers tasks through governance, verifies observer and voting-power quorum evidence, checks NativeOracle and resolver state on every RPC, and uses a localhost-only fixture with no credentials or public network dependency. Refs Galxe/gravity-audit#1038
keanji-x
approved these changes
Aug 3, 2026
nekomoto911
approved these changes
Aug 3, 2026
ByteYue
added a commit
that referenced
this pull request
Aug 3, 2026
## Summary - pin the SDK runtime to merged gravity-reth #420 - add a deterministic localhost Polygon JSON-RPC fixture with a separately controlled finalized head - add one four-validator merge-gating E2E for the complete Polymarket settlement transport path - document the exact local run command and scope boundaries Tracks Galxe/gravity-audit#1038 and preserves the split requested by Galxe/gravity-audit#1033. ## Dependency baseline - gravity-aptos #79: `a64f8adc274bf2681df796766ef9a5b195fee44b` - gravity_chain_core_contracts #115: `f447687bf6f6f9efabd92626b588aeda94148f88` - gravity-reth #420: `0c038e180cc26ae400f3fb2e6199e6f079f68fbc` - gravity-sdk main / #805: `fc7cb8f4b665e524e132f0921d5b99dc7cde6929` Both the direct `greth` dependency and the `reth-primitives-traits` patch point at the same merged reth revision. The lockfile changes are limited to replacing the previous gravity-reth source revision. ## Workflow covered 1. Start four validators with equal voting power. 2. Governance deploys `PolymarketSettlementResolver`, binds source type 6, registers one CTF mirror, and activates the task. 3. Every validator independently polls the same localhost Polygon fixture. 4. The CTF event exists at `latest`, while `finalized` remains one block behind. 5. All validators persist an empty-scan cursor and no settlement reaches `NativeOracle`. 6. The fixture advances `finalized`; validators derive byte-identical observations. 7. At least three validators certify, JWK consensus reaches a voting-power quorum, and execution records nonce `1`. 8. The resolver stores winner slot `1` and canonical Polygon provenance. 9. All four relayer checkpoints become terminal and all four Gravity RPCs return identical contract state at the same block. The fixture uses the canonical Polygon CTF `ConditionResolution` ABI and validates the derived condition ID, topic layout, dynamic payout encoding, filter behavior, and finalized/latest separation. ## Deliberate exclusions - no prediction-market betting/product contract - no live Polygon RPC or credentials - no frontend/demo/soak test - no new Aptos or reth runtime behavior The oracle data-source runtime path is localhost-only. A fresh build may still download repository dependencies. ## Validation - `make MODE=quick-release gravity_node gravity_cli` - fixture unit tests: `3 passed` - four-validator Polymarket E2E: `1 passed` in `46.57s` - TOML/JSON parsing, Python bytecode compilation, `git diff --check`, and credential/user-path scans passed - no Rust source files changed ## Run ```bash make MODE=quick-release gravity_node gravity_cli PATH="$HOME/.foundry/bin:$PWD/target/quick-release:$PATH" \ ./gravity_e2e/run_test.sh \ polymarket_settlement_multivalidator \ --force-init \ --log-cli-level=INFO ```
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
Add one deterministic, merge-gating E2E suite for the complete multi-validator Binance price-feed path. This PR intentionally keeps the localhost provider fixture, reusable oracle helpers, cluster definition, and E2E assertions together so the workflow can be reviewed and run as one unit.
The suite also pins
gravity-rethto the merged generic relayer runtime through Galxe/gravity-reth#419.Workflow under test
PriceFeedResolverand register twosourceType=3tasks through the on-chain governance lifecycle.indexPriceKlinesbuckets forNVDAUSDTandTSLAUSDT.NativeOracleand its resolver callback.Determinism and network boundary
127.0.0.1only.startTime,endTime, andlimit=1closed-bucket coordinates.Cross-repository revisions
gravity-aptos:a64f8adc274bf2681df796766ef9a5b195fee44b(refactor(oracle): expose fixed-size source progress API gravity-aptos#79)gravity_chain_core_contracts:ccd88ee62d90d38f824def26b32063fd094807c7(feat(oracle): add deterministic price resolver gravity_chain_core_contracts#114)gravity-reth:4ee9f656d5eb36f86934ffd712c476b57145d328(fix(oracle): discover price feed relayer tasks gravity-reth#419)Run
From the SDK repository root, after building
gravity_nodeandgravity_cli:PATH="$HOME/.foundry/bin:$PWD/target/quick-release:$PATH" \ ./gravity_e2e/run_test.sh \ binance_price_feed_multivalidator \ --force-init \ --log-cli-level=INFOExpected terminal evidence includes all four validators active, observer/certifier/quorum assertions passing for both feeds, stored round
29720875for the fixed fixture bucket, andAll suites passed!after all four nodes stop.Validation
cargo build --bin gravity_node --bin gravity_cli --profile quick-releasewith the repository-required Rust flagspython3 -m pytest -q gravity_e2e/gravity_e2e/utils/test_mock_binance_index.py(3 passed)./gravity_e2e/run_test.sh binance_price_feed_multivalidator --log-cli-level=INFO(1 passedin 40.65s)git diff --checkRefs Galxe/gravity-audit#1038
Refs Galxe/gravity-audit#1033