Commit cbe7fb9
fix(oracle): bump greth to b0ec42c, verified by new e2e cases (#725)
## Summary
- Bump `gravity-reth` to `b0ec42c647fb397b1887a5d41bc76441f545c5fa`. The
new rev carries an oracle / JWK nonce conversion fix that resolves a `No
JWK entries to convert oracle nonce` error inside a single epoch (see
"Regression reproduction" below).
- Add two new bridge e2e cases that exercise the oracle pipeline under
scenarios the existing `bridge` suite doesn't cover:
- **`bridge_multi_round`** — 5 oracle update rounds within a single
epoch (`epoch_interval = 4h`). Validates that repeated in-epoch oracle
updates settle without JWK/state regressions. Asserts every `jwk txn
epoch …` row from the test window shares the same epoch.
- **`bridge_cross_epoch`** — bridge events spanning an epoch transition
(`epoch_interval = 60s`). Validates that batches dispatched in
consecutive epochs each settle correctly. Asserts the two `jwk txn epoch
…` rows fall in strictly increasing epochs.
- Supporting infrastructure (used by both new cases):
- **`gravity_e2e/utils/mock_anvil.py`** — new `set_finalized()` helper +
`mock_setFinalized` JSON-RPC, so tests can stage event visibility
(preload all events, then advance `finalized` block in phases) without
restarting Anvil.
- **`gravity_e2e/utils/bridge_utils.py`** — `poll_all_native_minted` now
performs incremental log scans inside the polling loop and
short-circuits the moment every expected `NativeMinted` event is
observed. `isProcessed(nonce)` reverts for unprocessed nonces in this
setup, so relying on it alone forced the full timeout per round —
multi-round wall-clock dropped from ~25 min (5 × 300 s) to ~1 min after
this fix.
## Regression reproduction (old greth vs new greth)
Re-pointed `bin/gravity_node/Cargo.toml` at the previous rev
`364b851665cad891b9cc3cfbc0f958cb21f62bdd`, rebuilt `gravity_node`, and
ran `bridge_multi_round` with the **same** test code as this PR
(`--bridge-count 10 --rounds 5`). The bug surfaces deterministically:
| | Old greth `364b851` | New greth `b0ec42c` (this PR) |
|---|---|---|
| `bridge_multi_round` suite | **FAILED** in 197 s | PASSED |
| Round 1 (nonces 1–2) | ✅ settled in 6.1 s | ✅ settled in seconds |
| Round 2 (nonces 3–4) | ❌ timed out at 180 s; later rounds never ran |
✅ |
| Rounds 3–5 | not reached | ✅ all in epoch 2 |
| `No JWK entries to convert oracle nonce` log lines | **≥18
occurrences**, repeating every ~10 s from the start of round 2 onward,
all tagged `{"epoch":2}` | **0 occurrences** |
| Error source | `aptos-jwk-consensus/src/jwk_manager/mod.rs:154`
(reached via the old greth rev's pinned `gravity-aptos`) | — |
Representative log line from the failing run (one of many, all identical
apart from timestamp/thread):
```
2026-05-20T06:24:58.057902Z [jwk-1] ERROR
…/aptos-jwk-consensus/src/jwk_manager/mod.rs:154
JWKManager handling error: No JWK entries to convert oracle nonce {"epoch":2}
```
Round 1 succeeds because the JWK state is initialised cleanly at the
start of the epoch; round 2's oracle nonce push then fails to find JWK
entries to convert, and `jwk_observer`'s 10 s retry loop keeps logging
the same error until the test timeout. New `b0ec42c` cleanly handles
repeated in-epoch oracle pushes — both `bridge_multi_round` (5 rounds,
same epoch) and `bridge_cross_epoch` (epoch 2 → 3 transition) pass with
the error absent from the logs.
After the reproduction, `Cargo.toml` was reverted to `b0ec42c` and the
binary was rebuilt; no working-tree changes were left behind.
## Test plan
All verified locally on `linux/x86_64`, against this branch's binaries
(`RUSTC_WRAPPER=` to bypass a flaky sccache server):
- [x] `cargo build -p gravity_node --profile quick-release` clean
- [x] `cargo build -p gravity_cli --profile quick-release` clean
- [x] `python3 gravity_e2e/runner.py bridge --force-init --bridge-count
10` → PASSED (1.09 s with the incremental-scan short-circuit)
- [x] `python3 gravity_e2e/runner.py bridge_multi_round --force-init
--bridge-count 10 --rounds 5` → PASSED — all 5 rounds in epoch `[2]`
(verified by `jwk txn epoch …` row scan in `validator.log`; nonce
cumulatively advanced `0 → 2 → 4 → 6 → 8 → 10`)
- [x] `python3 gravity_e2e/runner.py bridge_cross_epoch --force-init
--bridge-count 10 --first-batch-fraction 0.5` → PASSED — first batch
`jwk txn` in epoch 2 (block 74), second batch in epoch 3 (block 273),
10/10 minted
- [x] Targeted search of `validator.log` / `reth.log` / `debug.log`
across both new cases for `No JWK entries to convert oracle nonce` /
`JWK entries to convert` — no occurrences with the new greth rev
- [x] Regression: reverting `greth` to `364b851` reproduces the bug in
`bridge_multi_round` (round 2 hangs, ≥18 `No JWK entries to convert
oracle nonce` log lines in epoch 2 — see table above)
- [ ] CI: full `e2e-docker` workflow with the new suites picked up
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d2f0ca8 commit cbe7fb9
18 files changed
Lines changed: 2223 additions & 118 deletions
File tree
- bin/gravity_node
- gravity_e2e
- cluster_test_cases
- bridge_cross_epoch
- bridge_multi_round
- gravity_e2e/utils
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
Lines changed: 107 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments