Documentation
¶
Overview ¶
Package engine implements the core fuzzing logic for comparing SSZ reflection-based and codegen-based implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintStats ¶
PrintStats prints current fuzzing statistics to stdout.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the core fuzz testing engine. Each Engine instance owns a private RNG and Filler (not thread-safe), but shares DynSsz instances, Stats, and Reporter across workers.
func NewEngine ¶
func NewEngine(reporter *Reporter, stats *Stats, ds, dsExtended *dynssz.DynSsz, seed int64, maxDataLen int) *Engine
NewEngine creates a new fuzz engine with its own RNG but shared DynSsz instances. The DynSsz TypeCache is thread-safe (uses sync.RWMutex), so sharing avoids duplicating large type caches across workers.
type Filler ¶
type Filler struct {
// contains filtered or unexported fields
}
Filler populates Go struct instances with random valid values using reflection. It reads SSZ struct tags to determine valid sizes for slices, bitlists, etc.
func (*Filler) Fill ¶
Fill populates the value v with random data appropriate to its type. v must be settable (typically obtained via reflect.ValueOf(&x).Elem()).
func (*Filler) FillStruct ¶
FillStruct fills a struct pointer with random values.
type Issue ¶
type Issue struct {
Type IssueType
TypeName string
Data []byte
Details string
ReflectionOutput []byte
CodegenOutput []byte
}
Issue represents a single fuzzing issue found.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter persists fuzzing issues to disk.
func NewReporter ¶
NewReporter creates a new issue reporter that writes to the given directory.
func (*Reporter) IssueCount ¶
IssueCount returns the number of unique issues reported.
type Stats ¶
type Stats struct {
Iterations atomic.Uint64
ValidFills atomic.Uint64
MutatedFills atomic.Uint64
RandomInputs atomic.Uint64
Panics atomic.Uint64
MarshalMismatches atomic.Uint64
HTRMismatches atomic.Uint64
StreamMismatches atomic.Uint64
UnmarshalDiffs atomic.Uint64
Successes atomic.Uint64
}
Stats tracks fuzzing statistics.