cosmos-sdk/x/simulation/doc.go

26 lines
1.3 KiB
Go
Raw Normal View History

/*
Package simulation implements a simulation framework for any state machine
built on the SDK which utilizes auth.
2018-11-08 07:32:53 -08:00
It is primarily intended for fuzz testing the integration of modules. It will
2018-11-07 07:28:18 -08:00
test that the provided operations are interoperable, and that the desired
2018-11-08 07:32:53 -08:00
invariants hold. It can additionally be used to detect what the performance
2018-11-07 07:28:18 -08:00
benchmarks in the system are, by using benchmarking mode and cpu / mem
2018-11-08 07:32:53 -08:00
profiling. If it detects a failure, it provides the entire log of what was ran.
2018-11-07 07:28:18 -08:00
The simulator takes as input: a random seed, the set of operations to run, the
invariants to test, and additional parameters to configure how long to run, and
misc. parameters that affect simulation speed.
2018-11-07 07:28:18 -08:00
It is intended that every module provides a list of Operations which will
randomly create and run a message / tx in a manner that is interesting to fuzz,
and verify that the state transition was executed as exported. Each module
2018-11-07 07:28:18 -08:00
should additionally provide methods to assert that the desired invariants hold.
Then to perform a randomized simulation, select the set of desired operations,
2018-11-07 07:28:18 -08:00
the weightings for each, the invariants you want to test, and how long to run
2018-11-08 07:32:53 -08:00
it for. Then run simulation.Simulate! The simulator will handle things like
2018-11-07 07:28:18 -08:00
ensuring that validators periodically double signing, or go offline.
*/
package simulation