feat(oracle): wire generic relayer runtime - #803
Merged
Conversation
Read fixed-size OracleState snapshots at the latest committed block, reconcile each URI by source identity, retain pending observations until the authoritative nonce catches up, and suppress already-committed duplicates. Pin the merged Aptos API and Reth generic relayer revisions and align the node CLI with Reth 2.3.
6 tasks
nekomoto911
added a commit
to nekomoto911/gravity-sdk
that referenced
this pull request
Aug 3, 2026
…th-v2.3.0 Resolve conflicts with Galxe#803 (generic oracle relayer + greth 53a9df97): - Keep main's greth pin 53a9df97 (bc817c64 + Galxe#416/Galxe#417) and EthTransactionPool / alloy / tokio pins from main - Keep PR unique work: apply_node_defaults, prague betaTime, stop LOCK wait - Cargo.lock: take main's lock (same greth rev)
4 tasks
nekomoto911
added a commit
that referenced
this pull request
Aug 3, 2026
## Summary Port of [#802](#802) onto **`branch-v1.9`**. - **Base:** `branch-v1.9` (not `main`) - **Explicitly excludes [#803](#803 (`feat(oracle): wire generic relayer runtime`), which was merged to `main` but must not land on v1.9. That PR rewires the oracle relayer + pins different greth/gaptos revs (`53a9df97` / `a64f8adc`). - Cherry-picked the three #802 commits cleanly onto `upstream/branch-v1.9` @ `6c233dfc` (same merge-base as the original #802 head). ### Greth pin - `greth` / workspace `reth-primitives-traits` patch → [`bc817c642c9c3816cc4e22754e13e3c9633419dd`](Galxe/gravity-reth@bc817c6) (Galxe/gravity-reth#414 — block-gas last gate at Beta; includes #413/#412/#410) - `gaptos` remains the v1.9 pin (`b1f68dc…`), **not** the #803 Aptos rev ### Key changes (same as #802) 1. **Deps:** greth v2.3.0 pin + lockfile; alloy pins aligned (`alloy-primitives` 1.6.0, `alloy-*` 2.0.5); tokio `taskdump` enabled for `gravity_node` 2. **CLI:** `cli.rs` / `reth_cli.rs` adapted to reth v2.3.0 command signatures (`Runtime` / `CliContext`) and greth node log defaults / `TracingGuards` 3. **Prague e2e:** set `betaTime` with `pragueTime` so greth #412 EIP-7702 lockdown is released for SetCode txs 4. **Stop LOCK race:** wait for real process exit in `cluster/stop.sh`, `cluster/deploy.sh` stop templates, and `node.py` so greth v2.3+ RocksDB LOCK flush after SIGTERM does not race e2e restart ### Out of scope (same as #802) - No `gravity_e2e` storage_v2 baseline/upgrade/fresh_sync work - No #803 oracle relayer rewrite ## Test plan - [ ] File set matches #802: `Cargo.toml`, `Cargo.lock`, `bin/gravity_node/Cargo.toml`, `cli.rs`, `reth_cli.rs`, `cluster/deploy.sh`, `cluster/stop.sh`, prague `genesis.toml`, `node.py` - [ ] Greth rev is `bc817c64…`; no `53a9df97` / `a64f8adc` (#803) pins; `relayer.rs` unchanged vs `branch-v1.9` - [ ] `RUSTFLAGS="--cfg tokio_unstable" cargo check -p gravity_node` - [ ] Smoke: node starts and writes log files with default node log settings - [ ] Local e2e batch stop / restart no longer hits RocksDB LOCK `Resource temporarily unavailable` - [ ] CI e2e (incl. prague suite with `betaTime`)
nekomoto911
added a commit
that referenced
this pull request
Aug 3, 2026
…a9df97) (#802) ## Summary Follow-up on top of **main after #803** (which already lands greth **v2.3.0** at [`53a9df97`](Galxe/gravity-reth@53a9df9)). This PR does **not** re-pin greth relative to current `main`. Greth stays at the same rev as main (`53a9df97` = `bc817c64` + gravity-reth#416 + #417). The open work is **SDK e2e / node lifecycle** so CI passes and file logging works under the new greth behavior. ### What changed (vs current `main`) 1. **prague e2e — `betaTime`** - greth#412 fail-closes EIP-7702 type-4 packing until Gravity Beta. - Missing `betaTime` → lockdown forever → SetCode receipt timeouts in the prague suite. - Set `betaTime = pragueTime` in `gravity_e2e/cluster_test_cases/prague/genesis.toml`. 2. **stop / restart — wait for real process exit (RocksDB LOCK race)** - greth v2.3+ can hold RocksDB LOCK for several seconds after SIGTERM while flushing. - Old stop path deleted the pid file / returned before the process was gone; restart then failed with `Resource temporarily unavailable` on `.../db/state/LOCK` (single_node `BATCH_COMMIT_SIZE`, pfn_chain blackhole phase). - Fix: `cluster/stop.sh` + generated per-node stop in `deploy.sh` wait until `kill -0` fails (SIGTERM then SIGKILL); `Node.stop()` captures PID before stop and waits for exit. 3. **node log defaults** - `cli.rs`: `apply_node_defaults()` so greth node-subcommand file logging is actually installed. ### Greth pin (for clarity) | Tree | greth rev | |------|-----------| | `main` / this PR after merge with #803 | [`53a9df97`](Galxe/gravity-reth@53a9df9) | | Earlier draft of this PR (superseded) | `bc817c64` (strict ancestor of `53a9df97`) | Includes greth#412 (7702 lockdown @ Beta), #413, #414 (block-gas last gate), #416 (oracle relayer), #417 (alloy-trie). ### Out of scope - `bridge_cross_epoch` jwk `[-2:]` oracle (pre-existing brittle assert; mint path OK) - storage_v2 e2e suite (separate branch) ## Test plan - [x] Local: prague suite **13 passed** with `betaTime` - [x] Local: `test_batch_execution` + `test_batch_exec_restart` **passed** after stop wait fix - [ ] CI e2e-docker after approval - [x] `cargo metadata --locked` clean after merge with main
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
gravity_nodeto the merged generic Reth Oracle relayer APIOracleStatesnapshot from the latest committed Gravity block(source_type, source_id)URI identityRuntime behavior
add_urinow requires an authoritative on-chain source state before warming the Reth provider with itslatest_nonceandlatest_position.get_last_statefollows the same snapshot and fails closed whenOracleStateis unavailable, malformed, or missing the requested source.After a provider returns an update, the wrapper caches that exact
PollResult. While its nonce is ahead of the committed state, later observations return the cached payload instead of polling again. Once execution catches up, polling resumes. A provider result withobserved_nonce <= onchain_nonceis marked unchanged so it cannot inject arecordBatchthat must revert withNonceNotSequential.The state-read error path does not mutate the pending tracker, so a transient committed-state failure cannot erase an observation waiting for execution.
Dependency alignment
The lockfile is necessarily large because the existing SDK branch moves from its older Reth/Aptos dependency graphs to those merged revisions.
Non-goals
Those remain isolated provider and E2E slices in the split plan.
Validation
RUSTFLAGS='--cfg tokio_unstable' cargo +1.93.0 check -p gravity_node --tests --lockedRUSTFLAGS='--cfg tokio_unstable' cargo +1.93.0 test -p gravity_node relayer::tests --locked(12 passed)cargo +nightly fmt --all -- --checkcargo +1.93.0 metadata --locked --no-deps --format-version 1Tracking