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
//! Path **investigation toolkit** — reusable building blocks for reproducing a
//! captured failing settlement-arbitrage path (the `path<N>_…_block<B>` fixtures written by
//! `scripts/capture_*_fixture.py`).
//!
//! **Layering.** This is degenbot's OWN pool-level scaffold (its capture format,
//! its V2/V3/V4 pool reconstruction, its per-hop pool oracle). It contains NO
//! executor logic and is NOT the deep reusable primitive. The genuinely reusable,
//! contract-agnostic EVM spine is [`degenbot_simulation::oracle`] — deploy a
//! pinned contract into revm, seed storage slots, drive a call, classify
//! Revert-vs-Halt — which any individual/a user's OWN contract harness builds on
//! via `scripts/scaffold_revm_harness.py` (emits a standalone per-contract
//! project at the user layer). This module's per-hop oracle checks currently use
//! the fast Rust twins; a deep bytecode-level probe would replace them with
//! `degenbot_simulation::oracle` verds.
//!
//! The historical `path*_solver_fixture.rs` examples each copy-pasted the same
//! ~200-line preamble (fixture structs, `tick_map`, `register_v2/v3`,
//! `build_v3/v4_state`, `v4_pool_id_bytes`) with only the family-specific fee
//! and report logic left to the example. That preamble now lives here as three
//! deep modules:
//!
//! - [`fixture`] — the superset capture schema + `PathFixture::load` (accepts
//! every historical file, amounts as number or string).
//! - [`reconstruct`] — register captured pools into a `BotState` or build
//! standalone `V3PoolState`/`V4PoolState`.
//! - [`hop_oracle`] — drive each hop's input through the tier-3-validated
//! oracle twin (V2 `getAmountOut` / `v3_simulate_swap` / `v4_simulate_swap`)
//! and compare the output to the solver's, per hop.
//!
//! A new investigation then needs only: load the fixture, register the pools,
//! run the Möbius solver, and call the per-hop oracle check — no re-derivation.
//! Investigation tooling: allowed to sidestep the pedantic doc/must_use
//! discipline applied to production core crates (analogous to the tier-3 test
//! files' own lint gates) — these are run-once diagnostic helpers, not library
//! surface that future API consumers depend on.
/// Ignore pedantic doc/must_use/hasher nits for this run-once tooling (see
/// module comment for rationale).
// `real_oracle` carries its own module-level `#![allow]` (it's self-contained
// run-once diagnostic tooling), so it needs no wrapper here.
pub use ;
pub use ;
pub use ;