Skip to content

Gate D: real-prestate fixture — leg reproduces & anti-stub confirmed#1

Open
psyto wants to merge 1 commit into
masterfrom
task/015-gate-d-capture
Open

Gate D: real-prestate fixture — leg reproduces & anti-stub confirmed#1
psyto wants to merge 1 commit into
masterfrom
task/015-gate-d-capture

Conversation

@psyto

@psyto psyto commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Gate D — the one RPC-gated gate — is unblocked and captured

The blocker was finding a free trace endpoint, not paying for one. https://eth.drpc.org serves debug_traceTransaction with both prestateTracer (pre-mode) and callTracer for free — zero spend.

Frozen decisions (provenance in docs/tasks/015)

  • Q1 endpoint: drpc.org (free debug_*). capture_fixture.py now sends an explicit User-Agent (drpc 403s urllib default) and retries 429/5xx with backoff (free LB flakes). Pure transform untouched — 3 transform tests green.
  • Q2 tx: mainnet 0x4a8f5f07e3f1019db5ddc46b344a6af9ffc3895d5128ba5f1b16a54568542f8f (block 25499896). UniV2 swapExactTokensForETHSupportingFeeOnTransferTokens, type-2 / empty access list / value 0 — satisfies the block_env freeze. Router does WETH.withdraw then forwards native ETH to the subject via a plain value-CALL (no Transfer log) — exactly one clean log-invisible leg.
  • Fixture: probatio-evm/tests/fixtures/gate-d-real-swap.json — 6 prestate accounts, full block_env, expected_subject_eth_wei = 19173706984341863 (~0.01917 ETH) from callTracer.

CC smoke (manual, frame-thin — NOT yet a committed test; this is Codex's job)

  • Driving the built reexec-server with the fixture (capture_inner=true) reproduces the leg exactly: recovered == expected == 19173706984341863 wei. Both hops present (WETH→router unwrap, router→subject). Native ETH has no log, yet re-execution recovers it — the moat, on real mainnet data.
  • Anti-stub confirmed: mutating the pair's reserves slot 0x08 diverges the leg (…341863 → …263682); mutating slots 0x06/0x07/0x0c breaks the swap → leg 0 (revert-equivalent). Use pair slot 0x08 as the canonical perturbation.

Remaining (Codex, frame-thick; CC reviews)

  1. Offline reproduction test in probatio-evm (no RPC): load fixture → drive reexec-server → assert recovered inbound leg to subject == expected_subject_eth_wei.
  2. Anti-stub test: clone fixture, mutate pair slot 0x08, assert leg diverges (or execute reverts). Keep the revm/c-kzg-free lockfile invariant intact.
  3. Flip Gate D to ✅ in probatio-evm/README.md + STAGE1.5_EVM_REEXEC.md.

🤖 Generated with Claude Code

…tub confirmed

Gate D was the one RPC-gated gate. Q1/Q2 now frozen; the fixture is captured and
the capability is proven end-to-end on real mainnet data.

- Q1 (endpoint): drpc.org serves debug_traceTransaction (prestate+callTracer) FREE.
  capture_fixture.py: send explicit User-Agent (drpc 403s urllib default) + retry
  429/5xx with backoff (free LB flakes transiently). Pure transform untouched (3 tests green).
- Q2 (tx): mainnet 0x4a8f5f07… (blk 25499896), UniV2 swapExactTokensForETH…FeeOnTransfer,
  type-2 / empty access list / value 0 — WETH.withdraw then a plain value-CALL forwarding
  native ETH to the subject (no Transfer log): exactly one clean log-invisible leg.
- Fixture: 6 prestate accts, full block_env, expected_subject_eth_wei = 19173706984341863.

CC smoke (manual, frame-thin — not yet a committed test): reexec-server reproduces the
leg EXACTLY (recovered == expected). Anti-stub premise holds: mutating the pair reserves
slot 0x08 diverges the leg; slots 0x06/0x07/0x0c break the swap → leg 0.

Remaining (Codex, frame-thick; CC reviews): encode the offline reproduction test + the
anti-stub test in probatio-evm, then flip Gate D to green. See docs/tasks/015.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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