Skip to main content

Crate sentri_dynamic_core

Crate sentri_dynamic_core 

Source
Expand description

Chain-agnostic dynamic/coverage-guided invariant fuzzing engine.

This crate contains no VM: it only knows how to generate call sequences, drive an ExecutionBackend, check Invariants after every call, and shrink a failing sequence to a minimal reproduction. Chain-specific crates (starting with sentri-dynamic-evm, backed by revm) provide the ExecutionBackend implementation; this crate’s own test suite proves the engine logic correct against an in-memory mock so it never depends on a real VM being available to be verified.

Re-exports§

pub use backend::CallOutcome;
pub use backend::EncodedCall;
pub use backend::ExecutionBackend;
pub use backend::FunctionSpec;
pub use backend::ParamKind;
pub use invariant::AccessControlInvariant;
pub use invariant::CheckContext;
pub use invariant::ConservationInvariant;
pub use invariant::Invariant;
pub use invariant::MonotonicInvariant;
pub use invariant::ReentrancyInvariant;
pub use poc::format_poc;
pub use sequence::generate_random_sequence;
pub use sequence::run_sequence;
pub use sequence::CallSequence;
pub use sequence::Violation;
pub use shrink::shrink;
pub use trace::detect_reentrancy;
pub use trace::ReentrancyReport;
pub use trace::TraceEvent;

Modules§

abi_encode
Minimal static-type ABI encoding and edge-biased random argument generation.
backend
Chain-agnostic execution backend abstraction.
invariant
Invariant oracles: properties checked after every call in a sequence.
poc
Renders a Violation as a human-readable proof-of-concept — the thing a bug-bounty submission actually needs: a minimal, ordered list of calls that reproduces the broken invariant, not just “detector X fired”.
sequence
Call-sequence generation and execution.
shrink
Delta-debugging shrinker: reduces a failing call sequence to a minimal one that still reproduces the same violation, so the PoC handed to a human is “call mint(), call transfer()” instead of forty interleaved random calls.
trace
Execution-trace model and reentrancy analysis.
u256
Minimal big-endian 256-bit unsigned integer helpers.

Structs§

FuzzConfig
Search parameters for a fuzzing run. seed makes runs reproducible — the same seed against the same contract always generates the same sequences, so a violation found once can be found again for debugging.

Functions§

fuzz
Run the search loop: generate random call sequences, execute each against a fresh backend instance, check invariants after every call, and on the first violation, shrink it to a minimal reproduction before returning.