Skip to content

fix(oracle): discover price feed relayer tasks - #419

Merged
ByteYue merged 1 commit into
mainfrom
codex/oracle-price-feed-discovery
Aug 3, 2026
Merged

fix(oracle): discover price feed relayer tasks#419
ByteYue merged 1 commit into
mainfrom
codex/oracle-price-feed-discovery

Conversation

@ByteYue

@ByteYue ByteYue commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the dynamic discovery gap exposed by the deterministic four-validator Binance E2E after #418 merged.

  • includes sourceType=3 in RELAYER_BACKED_SOURCE_TYPES
  • builds JWK consensus providers through fetch_relayer_task_uris() instead of the source-type-0-only helper
  • locks the supported discovery set to [BLOCKCHAIN, PRICE_FEED] in a focused regression test

Without 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

  • two execute-layer files, one commit
  • no provider parsing, HTTP, payload, nonce, callback gas, or contract ABI changes
  • source type 0 discovery remains unchanged
  • no Polygon/source type 6, SDK, live-network, credential, or operator-specific files

Validation

  • cargo test -p reth-pipe-exec-layer-ext-v2 onchain_config::oracle_task_helpers::tests: passed
  • cargo fmt --all -- --check: passed
  • deterministic SDK integration against this exact commit: four equal-power validators independently observed two localhost Binance index-kline feeds, formed JWK voting-power quorum, wrote NativeOracle, updated PriceFeedResolver, and returned identical state from all four RPCs (1 passed in 40.15s)
  • full execute --lib: 95 passed; the only failure is the pre-existing system_caller_migration::tests::test_migration_defensive_when_system_caller_absent already documented on refactor(oracle): split generic relayer core #416/feat(oracle): add deterministic Binance index feed #418 and unrelated to these files
  • diff hygiene and credential/path scan: passed

Refs Galxe/gravity-audit#1038 and Galxe/gravity-audit#1033.

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
ByteYue force-pushed the codex/oracle-price-feed-discovery branch from f788322 to e1bb5d7 Compare August 3, 2026 11:55
@ByteYue
ByteYue merged commit 4ee9f65 into main Aug 3, 2026
29 checks passed
@ByteYue
ByteYue deleted the codex/oracle-price-feed-discovery branch August 3, 2026 12:05
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant