fix(oracle): discover price feed relayer tasks - #419
Merged
Conversation
Include sourceType=3 in relayer-backed task discovery so epoch JWK configuration starts observers for Binance price feeds. Route provider construction through the shared relayer task enumerator and pin the supported source set in a focused regression test. Refs Galxe/gravity-audit#1038 and Galxe/gravity-audit#1033.
ByteYue
force-pushed
the
codex/oracle-price-feed-discovery
branch
from
August 3, 2026 11:55
f788322 to
e1bb5d7
Compare
ByteYue
added a commit
to Galxe/gravity-sdk
that referenced
this pull request
Aug 3, 2026
## 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-reth` to the merged generic relayer runtime through Galxe/gravity-reth#419. ## Workflow under test 1. Start four equal-voting-power Gravity validators. 2. Deploy `PriceFeedResolver` and register two `sourceType=3` tasks through the on-chain governance lifecycle. 3. Have every validator discover the tasks and fetch the same explicit, closed one-minute `indexPriceKlines` buckets for `NVDAUSDT` and `TSLAUSDT`. 4. Form JWK consensus from at least three certifying validators. 5. Execute the agreed bytes through `NativeOracle` and its resolver callback. 6. Verify observer startup, quorum evidence, per-validator relayer progress, resolver values, and identical contract state through all four RPC endpoints at one block. ## Determinism and network boundary - The Binance-compatible endpoint binds to `127.0.0.1` only. - Requests must include the exact pair, interval, `startTime`, `endTime`, and `limit=1` closed-bucket coordinates. - Prices are deterministic fixed-point values keyed by pair and bucket. - The test uses no Binance API key, secret, or public Binance endpoint. - The mock request counters prove that multiple validators independently fetched each feed. ## Cross-repository revisions - `gravity-aptos`: `a64f8adc274bf2681df796766ef9a5b195fee44b` (Galxe/gravity-aptos#79) - `gravity_chain_core_contracts`: `ccd88ee62d90d38f824def26b32063fd094807c7` (Galxe/gravity_chain_core_contracts#114) - `gravity-reth`: `4ee9f656d5eb36f86934ffd712c476b57145d328` (Galxe/gravity-reth#419) ## Run From the SDK repository root, after building `gravity_node` and `gravity_cli`: ```bash PATH="$HOME/.foundry/bin:$PWD/target/quick-release:$PATH" \ ./gravity_e2e/run_test.sh \ binance_price_feed_multivalidator \ --force-init \ --log-cli-level=INFO ``` Expected terminal evidence includes all four validators active, observer/certifier/quorum assertions passing for both feeds, stored round `29720875` for the fixed fixture bucket, and `All suites passed!` after all four nodes stop. ## Validation - `cargo build --bin gravity_node --bin gravity_cli --profile quick-release` with the repository-required Rust flags - `python3 -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 passed` in 40.65s) - Python compile checks, TOML/JSON parse checks, and `git diff --check` Refs Galxe/gravity-audit#1038 Refs Galxe/gravity-audit#1033
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
Fixes the dynamic discovery gap exposed by the deterministic four-validator Binance E2E after #418 merged.
sourceType=3inRELAYER_BACKED_SOURCE_TYPESfetch_relayer_task_uris()instead of the source-type-0-only helper[BLOCKCHAIN, PRICE_FEED]in a focused regression testWithout this wiring, the Binance provider and execution callback from #418 compile and run, but epoch reconfiguration publishes an empty JWK provider set for price tasks, so no validator starts a
gravity://3/...observer.Scope and compatibility
Validation
cargo test -p reth-pipe-exec-layer-ext-v2 onchain_config::oracle_task_helpers::tests: passedcargo fmt --all -- --check: passed1 passedin 40.15s)--lib: 95 passed; the only failure is the pre-existingsystem_caller_migration::tests::test_migration_defensive_when_system_caller_absentalready documented on refactor(oracle): split generic relayer core #416/feat(oracle): add deterministic Binance index feed #418 and unrelated to these filesRefs Galxe/gravity-audit#1038 and Galxe/gravity-audit#1033.