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
//! Composable `revm::Inspector` pair for simulation diagnostics — the
//! engine-generic primitives (ADR-019 D4/D7) that retire the settlement-arbitrage bot's
//! ad-hoc, post-hoc failure analysis.
//!
//! Two inspectors, composable with the existing
//! [`AccessListCollector`](super::access_list::AccessListCollector) via
//! revm's blanket `Inspector` impl for `(L, R)` tuples:
//!
//! - [`CallTraceInspector`] — structural call/create frame tree + the
//! revert-attribution seam (`call_end` on the deepest reverting frame).
//! - [`SwapEventCaptureInspector`] — V2 `Sync` / V3 `Swap` / V4 `Swap` LOG
//! capture + decode, replacing the onchain-recompute pipeline.
//!
//! # Composition (spike KCKGP4, finding Q2)
//!
//! revm's `Inspector` impl for `(L, R)` delegates every hook to both members.
//! The spike proved `(AccessListCollector, ProbeInspector)` composes on one
//! `inspect_one` run with no borrow-ordering issues and AL parity preserved.
//! The production `BlockEvm` inspector type widens from bare
//! `AccessListCollector` to a composed tuple `(AccessListCollector,
//! CallTraceInspector, SwapEventCaptureInspector)`.
//!
//! # Standalone-Rust claim (ADR-005 Tier 0)
//!
//! A `cargo add degenbot` consumer reaches `CallTrace` + captured swaps +
//! reverting-frame attribution from the engine directly — no Python, no
//! Multicall3 re-fetch. The inspectors are engine-generic (no
//! `SimulateContext`/`SimResult`/strategy vocabulary); the four-way
//! Drift/SolverCalc/Encoding classifier POLICY stays in the strategy
//! (`logs/permutation_analyzer.py`).
//!
//! # Status
//!
//! Prototype (ergo task `2LMT7A`): the inspectors + captured structs land here
//! as additive, test-only modules. Production wiring into `BlockEvm` +
//! `SimFailure` deepening + `diagnostic.rs` retirement is gated on the
//! JHPW5W follow-on implementation-definition task.
pub use ;
pub use ;
/// The composed inspector tuple baked into the production `BlockEvm` —
/// `AccessListCollector` paired with `(CallTraceInspector,
/// SwapEventCaptureInspector)`. revm's blanket `Inspector` impl covers
/// 2-tuples `(L, R)` only (`revm-inspector-42/src/inspector.rs:150`), so the
/// three-way composition is a nested tuple: `AccessListCollector` is `L`, and
/// the `CallTraceInspector`/`SwapEventCaptureInspector` pair is `R`.
/// Each member carries its own `Rc<RefCell<…>>` handle (mirroring
/// `AccessListCollector::new`'s `(Self, Handle)` shape) so the strategy drains
/// all three after `inspect_one` moves the tuple into the EVM.
///
/// NOT yet wired into `sim/evm/simulator.rs::BlockEvm` (the prototype is
/// test-only); the JHPW5W follow-on task flips the `BlockEvm` type parameter
/// from bare `AccessListCollector` to this alias.
pub type SimInspector = ;