Skip to main content

Crate replay_core

Crate replay_core 

Source
Expand description

§replay-core

The engine for Replay — a time-travel debugger for Solana transactions.

The public surface is intentionally small:

  • replay — one-shot replay of a mainnet transaction.
  • fork — create a session you can mutate and re-execute.

Everything else is a private implementation detail. If you find yourself reaching for internals from outside this crate, that’s a signal to widen the public API here rather than bypass it.

Re-exports§

pub use error::ReplayError;
pub use types::AccountDelta;
pub use types::AccountMutation;
pub use types::CpiFrame;
pub use types::FetchedTx;
pub use types::FrameAccount;
pub use types::LogDivergence;
pub use types::ProgramInfo;
pub use types::ProgramLoader;
pub use types::ReconstructedState;
pub use types::Trace;
pub use types::TraceDiff;
pub use types::TxContext;
pub use types::TxResult;
pub use rpc::HeliusClient;
pub use rpc::HeliusRpcClient;
pub use session::ForkedSession;

Modules§

error
Error types. Fail loudly, fail specifically — every variant carries the context a user needs to understand and act on the failure.
fetch
Fetch a transaction and turn the raw Helius response into a structured TxContext ready for state reconstruction and replay.
idl
IDL-aware account decoder.
reconstruct
Reconstruct the pre-slot state of every account a transaction touches.
rpc
Helius RPC client. A trait + concrete impl so tests can mock.
session
ForkedSession — a replayable, mutable sandbox around a single transaction.
svm
The litesvm wrapper. Responsible for seeding reconstructed state, setting sysvars, and running the replay transaction.
trace
Trace tree builder. Takes a flat log list + execution result and produces a tree of CpiFrames, one per CPI invocation, nested according to call depth.
types
Shared data types.

Functions§

decode_account_deltas
Walk trace.account_deltas and populate decoded_before / decoded_after (and idl_type_name when available) by running the decoder against each pre/post snapshot. Idempotent and side-effect-free outside the trace.
fork
Create a forked session seeded from a mainnet transaction.
replay
Replay a mainnet transaction against litesvm with historical state.