common

package
v0.0.0-...-a6ff567 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

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

func Copy(src, dst string) error

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 RootsEqual

func RootsEqual(path string, c *cli.Context) (bool, error)

RootsEqual executes the test on the given path on all vms, and returns true if they all report the same post stateroot.

func RunSingleTest

func RunSingleTest(path string, c *cli.Context) (bool, error)

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 TestSpeed

func TestSpeed(dir string, c *cli.Context) error

Types

type BasicTracer

type BasicTracer struct{}

func (*BasicTracer) CaptureEnd

func (n *BasicTracer) CaptureEnd([]byte, uint64, error)

func (*BasicTracer) CaptureEnter

func (n *BasicTracer) CaptureEnter(vm.OpCode, common.Address, common.Address, []byte, uint64, *big.Int)

func (*BasicTracer) CaptureExit

func (n *BasicTracer) CaptureExit([]byte, uint64, error)

func (*BasicTracer) CaptureFault

func (n *BasicTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error)

func (*BasicTracer) CaptureStart

func (n *BasicTracer) CaptureStart(*vm.EVM, common.Address, common.Address, bool, []byte, uint64, *big.Int)

func (*BasicTracer) CaptureState

func (n *BasicTracer) CaptureState(uint64, vm.OpCode, uint64, uint64, *vm.ScopeContext, []byte, int, error)

func (*BasicTracer) CaptureTxEnd

func (n *BasicTracer) CaptureTxEnd(uint64)

func (*BasicTracer) CaptureTxStart

func (n *BasicTracer) CaptureTxStart(uint64)

func (*BasicTracer) GetResult

func (n *BasicTracer) GetResult() (json.RawMessage, error)

func (*BasicTracer) Stop

func (n *BasicTracer) Stop(err error)

type GeneratorFn

type GeneratorFn func() *fuzzing.GstMaker

type PrintingTracer

type PrintingTracer struct {
	BasicTracer
}

func (*PrintingTracer) CaptureStart

func (n *PrintingTracer) CaptureStart(vm *vm.EVM, from, to common.Address, create bool, input []byte, gas uint64, value *big.Int)

func (*PrintingTracer) CaptureState

func (n *PrintingTracer) CaptureState(pc uint64, op vm.OpCode, gas uint64, cost uint64, scope *vm.ScopeContext, input []byte, depth int, err error)

type TestProviderFn

type TestProviderFn func(index, threadId int) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL