Skip to content

test(oracle): add deterministic Polymarket quorum E2E - #806

Merged
ByteYue merged 1 commit into
mainfrom
codex/oracle-polymarket-deterministic-e2e
Aug 3, 2026
Merged

test(oracle): add deterministic Polymarket quorum E2E#806
ByteYue merged 1 commit into
mainfrom
codex/oracle-polymarket-deterministic-e2e

Conversation

@ByteYue

@ByteYue ByteYue commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pin the SDK runtime to merged gravity-reth fix: remove some unused call in mempool #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

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

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

Pin gravity-reth to the merged Polymarket settlement transport and add a localhost Polygon JSON-RPC fixture with an independently controlled finalized head.

Exercise dynamic task registration across four validators, verify empty-scan cursor persistence before finality, then assert JWK quorum, NativeOracle delivery, resolver provenance, terminal relayer checkpoints, and identical replica state.
@ByteYue
ByteYue merged commit cec7c69 into main Aug 3, 2026
4 checks passed
@ByteYue
ByteYue deleted the codex/oracle-polymarket-deterministic-e2e branch August 3, 2026 16:18
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