Documentation ¶
Index ¶
- Variables
- func ConvertToStateTest(name, fork string, alloc types.GenesisAlloc, gasLimit uint64, ...) error
- func Copy(src, dst string) error
- func ExecuteFuzzer(c *cli.Context, allClients bool, providerFn TestProviderFn, cleanupFiles bool) error
- func GenerateAndExecute(c *cli.Context, generatorFn GeneratorFn, name string) error
- func NewEmptyStateDB() *state.StateDB
- func NewMemStateDB() state.Database
- func RootsEqual(path string, c *cli.Context) (bool, error)
- func RunSingleTest(path string, c *cli.Context) (bool, error)
- func StateDBWithAlloc(alloc types.GenesisAlloc) *state.StateDB
- func TestSpeed(dir string, c *cli.Context) error
- type BasicTracer
- type GeneratorFn
- type PrintingTracer
- type TestProviderFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GethFlag = &cli.StringSliceFlag{ Name: "geth", Usage: "Location of go-ethereum 'evm' binary", } GethBatchFlag = &cli.StringSliceFlag{ Name: "gethbatch", Usage: "Location of go-ethereum 'evm' binary", } EelsFlag = &cli.StringSliceFlag{ Name: "eels", Usage: "Location of 'ethereum-spec-evm' binary", } EelsBatchFlag = &cli.StringSliceFlag{ Name: "eelsbatch", Usage: "Location of 'ethereum-spec-evm' binary", } NethermindFlag = &cli.StringSliceFlag{ Name: "nethermind", Usage: "Location of nethermind 'nethtest' binary", } NethBatchFlag = &cli.StringSliceFlag{ Name: "nethbatch", Usage: "Location of nethermind 'nethtest' binary", } BesuFlag = &cli.StringSliceFlag{ Name: "besu", Usage: "Location of besu vm binary", } BesuBatchFlag = &cli.StringSliceFlag{ Name: "besubatch", Usage: "Location of besu vm binary", } ErigonFlag = &cli.StringSliceFlag{ Name: "erigon", Usage: "Location of erigon 'evm' binary", } ErigonBatchFlag = &cli.StringSliceFlag{ Name: "erigonbatch", Usage: "Location of erigon 'evm' binary", } NimbusFlag = &cli.StringSliceFlag{ Name: "nimbus", Usage: "Location of nimbus 'evmstate' binary", } EvmoneFlag = &cli.StringSliceFlag{ Name: "evmone", Usage: "Location of evmone 'evmone' binary", } RethFlag = &cli.StringSliceFlag{ Name: "revme", Usage: "Location of reth 'revme' binary", } ThreadFlag = &cli.IntFlag{ Name: "parallel", Usage: "Number of parallel executions to use.", Value: runtime.NumCPU(), } LocationFlag = &cli.StringFlag{ Name: "outdir", Usage: "Location to place artefacts", Value: "/tmp", } NotifyFlag = &cli.StringFlag{ Name: "ntfy", Usage: "Topic to sent 'https://ntfy.sh/'-ping on exit (e.g. due to consensus issue)", } PrefixFlag = &cli.StringFlag{ Name: "prefix", Usage: "prefix of output files", } CountFlag = &cli.IntFlag{ Name: "count", Usage: "number of tests to generate", Value: 100, } TraceFlag = &cli.BoolFlag{ Name: "trace", Usage: "if true, a trace will be generated along with the tests. \n" + "This is useful for debugging the usefulness of the tests", } SkipTraceFlag = &cli.BoolFlag{ Name: "skiptrace", Usage: "If 'skiptrace' is set to true, then the evms will execute _without_ tracing, and only the final stateroot will be compared after execution.\n" + "This mode is faster, and can be used even if the clients-under-test has known errors in the trace-output, \n" + "but has a very high chance of missing cases which could be exploitable.", } VerbosityFlag = &cli.IntFlag{ Name: "verbosity", Usage: "sets the verbosity level (-4: DEBUG, 0: INFO, 4: WARN, 8: ERROR)", Value: 0, } VmFlags = []cli.Flag{ GethFlag, GethBatchFlag, EelsFlag, EelsBatchFlag, NethermindFlag, NethBatchFlag, BesuFlag, BesuBatchFlag, ErigonFlag, ErigonBatchFlag, NimbusFlag, EvmoneFlag, RethFlag, } )
Functions ¶
func ConvertToStateTest ¶
func ConvertToStateTest(name, fork string, alloc types.GenesisAlloc, gasLimit uint64, target common.Address) error
ConvertToStateTest is a utility to turn stuff into sharable state tests.
func Copy ¶
Copy the src file to dst. Any existing file will be overwritten and will not copy file attributes.
func ExecuteFuzzer ¶
func ExecuteFuzzer(c *cli.Context, allClients bool, providerFn TestProviderFn, cleanupFiles bool) error
func GenerateAndExecute ¶
func GenerateAndExecute(c *cli.Context, generatorFn GeneratorFn, name string) error
func NewEmptyStateDB ¶
StateDBWithAlloc creates an empty statedb, or panics on error
func NewMemStateDB ¶
func RootsEqual ¶
RootsEqual executes the test on the given path on all vms, and returns true if they all report the same post stateroot.
func RunSingleTest ¶
RunTests runs a test on all clients. Return values are : - true, nil: no consensus issue - true, err: test execution failed - false, err: a consensus issue found - false, nil: a consensus issue found
func StateDBWithAlloc ¶
func StateDBWithAlloc(alloc types.GenesisAlloc) *state.StateDB
StateDBWithAlloc creates a statedb and populates with the given alloc.
Types ¶
type BasicTracer ¶
type BasicTracer struct{}
func (*BasicTracer) CaptureFault ¶
func (*BasicTracer) GetResult ¶
func (n *BasicTracer) GetResult() (json.RawMessage, error)
func (*BasicTracer) Hooks ¶
func (n *BasicTracer) Hooks() *tracing.Hooks
func (*BasicTracer) Stop ¶
func (n *BasicTracer) Stop(err error)
type GeneratorFn ¶
type PrintingTracer ¶
type PrintingTracer struct {
BasicTracer
}
func (*PrintingTracer) CaptureStart ¶
func (n *PrintingTracer) CaptureStart(vm *tracing.VMContext, tx *types.Transaction, from common.Address)
func (*PrintingTracer) CaptureState ¶
func (*PrintingTracer) Hooks ¶
func (n *PrintingTracer) Hooks() *tracing.Hooks
type TestProviderFn ¶
Click to show internal directories.
Click to hide internal directories.