Skip to main content

Crate soldb_core

Crate soldb_core 

Source
Expand description

Shared vocabulary types for the SolDB workspace.

Every other crate agrees on the types defined here: a TransactionTrace and the StepTable of its steps are what an execution backend produces and what the debugger and the frontends consume. A backend builds steps as TraceSteps or appends them field by field; readers get a StepView per step. This crate deliberately has no soldb dependencies so that it can stay the single type boundary in the graph.

These types are also a serialization contract. They round-trip through serde into trace files and into the web-facing JSON document, so adding a field is additive and needs #[serde(default)], while renaming or removing one is a breaking change.

TraceCapabilities describes what the selected backend was actually able to record. Frontends should branch on those flags rather than on the backend name, so a new backend does not require changes further up the stack.

Modules§

opcode
EVM opcodes by byte, with the mnemonics a trace spells them with.

Structs§

AccountChange
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
ContractCreation
EvmWord
One 256-bit word, big-endian.
ExecutionCall
ExecutionLog
FunctionCall
GasSummary
RootKind
The kind of the top-level call that starts at entry_step.
Stack
The stack of one step, bottom first.
StepRecord
One step as a producer appends it with StepTable::append: its plain fields, and the state that changed since the step before.
StepSnapshot
The machine state one step captured.
StepSnapshotRef
A borrowed view of one step’s captured machine state.
StepTable
The steps of a trace, in columns. See the module docs.
StepView
One step of a StepTable.
Steps
The steps of a StepTable, in order.
StorageChange
TraceArtifacts
TraceCapabilities
TraceStep
One recorded EVM step, as a backend builds it.
TransactionTrace
A complete recording of one execution.
WordInterner
Hands out one Word per distinct value, so repeated stack words are stored once.

Enums§

HexError
Why a string is not hex.
MemoryWriteError
Why a memory write cannot be recorded.
SoldbError
StepError
Why a step cannot be added to a StepTable.
WordError
Why a string is not a word.

Constants§

STACK_CHECKPOINT
Every this many steps, a step stores its whole stack, so that reading a word never walks back further.

Functions§

decode_hex
Hex digits, with or without a 0x prefix and in either case, as bytes.
decode_hex_into
decode_hex appending to bytes, for a caller joining many pieces into one buffer.
encode_hex
Bytes as lowercase hex digits without a 0x prefix, the spelling trace files use for memory.
same_buffer
Whether two byte views are the same bytes in the same place, which is how a shared Bytes is recognized without comparing its contents.

Type Aliases§

SoldbResult
Word
One machine word as a backend spelled it, shared between the steps that hold it.