Documentation ¶
Index ¶
- Constants
- Variables
- func CompareFiles(vms []Evm, readers []io.Reader) (bool, int)
- func CustomMarshal(log *logger.StructLog) []byte
- func JsonMarshal(log *logger.StructLog) []byte
- func StdErrOutput(c *exec.Cmd) ([]byte, error)
- type BesuBatchVM
- type BesuVM
- func (vm *BesuVM) Close()
- func (evm *BesuVM) Copy(out io.Writer, input io.Reader)
- func (vm *BesuVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *BesuVM) Instance(int) Evm
- func (evm *BesuVM) Name() string
- func (vm *BesuVM) ParseStateRoot(data []byte) (string, error)
- func (evm *BesuVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *BesuVM) Stats() []any
- type ErigonBatchVM
- type ErigonVM
- func (vm *ErigonVM) Close()
- func (evm *ErigonVM) Copy(out io.Writer, input io.Reader)
- func (evm *ErigonVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *ErigonVM) Instance(int) Evm
- func (evm *ErigonVM) Name() string
- func (evm *ErigonVM) ParseStateRoot(data []byte) (string, error)
- func (evm *ErigonVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *ErigonVM) Stats() []any
- type Evm
- type EvmoneVM
- func (vm *EvmoneVM) Close()
- func (evm *EvmoneVM) Copy(out io.Writer, input io.Reader)
- func (evm *EvmoneVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *EvmoneVM) Instance(int) Evm
- func (evm *EvmoneVM) Name() string
- func (evm *EvmoneVM) ParseStateRoot(data []byte) (root string, err error)
- func (evm *EvmoneVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *EvmoneVM) Stats() []any
- type GethBatchVM
- type GethEVM
- func (vm *GethEVM) Close()
- func (evm *GethEVM) Copy(out io.Writer, input io.Reader)
- func (evm *GethEVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *GethEVM) Instance(int) Evm
- func (evm *GethEVM) Name() string
- func (evm *GethEVM) ParseStateRoot(data []byte) (string, error)
- func (evm *GethEVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *GethEVM) Stats() []any
- type NethermindBatchVM
- type NethermindVM
- func (vm *NethermindVM) Close()
- func (evm *NethermindVM) Copy(out io.Writer, input io.Reader)
- func (evm *NethermindVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *NethermindVM) Instance(threadId int) Evm
- func (evm *NethermindVM) Name() string
- func (evm *NethermindVM) ParseStateRoot(data []byte) (string, error)
- func (evm *NethermindVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *NethermindVM) Stats() []any
- type NimbusEVM
- func (vm *NimbusEVM) Close()
- func (evm *NimbusEVM) Copy(out io.Writer, input io.Reader)
- func (evm *NimbusEVM) GetStateRoot(path string) (root, command string, err error)
- func (evm *NimbusEVM) Instance(int) Evm
- func (evm *NimbusEVM) Name() string
- func (evm *NimbusEVM) ParseStateRoot(data []byte) (string, error)
- func (evm *NimbusEVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
- func (evm *NimbusEVM) Stats() []any
- type VmStat
Constants ¶
const ( // Nethermind does not support refundcounter ClearRefunds = true // Nethermind reports the change in memory on step earlier than others. E.g. // MSTORE shows the _new_ memory, besu/geth shows the old memory until the next op. // This could be handled differently, e.g. clearing only on mem-expanding ops. ClearMemSize = true // Nethermind reports the change in memory on step earlier than others. E.g. // MSTORE shows the _new_ memory, besu/geth shows the old memory until the next op. // Unfortunately, nethermind also "forgets" the memsize when an error occurs, reporting // memsize zero (see testdata/traces/stackUnderflow_nonzeroMem.json). So we use // ClearMemSize instead ClearMemSizeOnExpand = true // Nethermind is missing returnData ClearReturndata = true // Besu sometimes reports GasCost of 0x7fffffffffffffff, along with ,"error":"Out of gas" ClearGascost = true )
Variables ¶
var FastMarshal = CustomMarshal
Functions ¶
func CompareFiles ¶
CompareFiles returns true if the files are equal, along with the number of line s compared
func CustomMarshal ¶
CustomMarshal writes a logger.Structlog element into a concise json format. OBS! This output format will omit all stack element except the last 6 items.
func JsonMarshal ¶
Types ¶
type BesuBatchVM ¶
type BesuBatchVM struct { BesuVM // contains filtered or unexported fields }
BesuBatchVM is s Evm-interface wrapper around the `evmtool` binary, based on Besu. The BatchVM spins up one 'master' instance of the VM, and uses that to execute tests
func NewBesuBatchVM ¶
func NewBesuBatchVM(path, name string) *BesuBatchVM
func (*BesuBatchVM) Close ¶
func (vm *BesuBatchVM) Close()
func (*BesuBatchVM) GetStateRoot ¶
func (evm *BesuBatchVM) GetStateRoot(path string) (root, command string, err error)
func (*BesuBatchVM) Instance ¶
func (evm *BesuBatchVM) Instance(threadId int) Evm
func (*BesuBatchVM) RunStateTest ¶
func (evm *BesuBatchVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
RunStateTest implements the Evm interface
type BesuVM ¶
type BesuVM struct {
// contains filtered or unexported fields
}
BesuVM is s Evm-interface wrapper around the `evmtool` binary, based on Besu.
func (*BesuVM) Copy ¶
feed reads from the reader, does some geth-specific filtering and outputs items onto the channel
func (*BesuVM) GetStateRoot ¶
func (*BesuVM) ParseStateRoot ¶
ParseStateRoot reads the stateroot from the combined output.
func (*BesuVM) RunStateTest ¶
RunStateTest implements the Evm interface
type ErigonBatchVM ¶
type ErigonBatchVM struct { ErigonVM // contains filtered or unexported fields }
The ErigonBatchVM spins up one 'master' instance of the VM, and uses that to execute tests
func NewErigonBatchVM ¶
func NewErigonBatchVM(path, name string) *ErigonBatchVM
func (*ErigonBatchVM) Close ¶
func (vm *ErigonBatchVM) Close()
func (*ErigonBatchVM) GetStateRoot ¶
func (evm *ErigonBatchVM) GetStateRoot(path string) (root, command string, err error)
func (*ErigonBatchVM) Instance ¶
func (evm *ErigonBatchVM) Instance(threadId int) Evm
func (*ErigonBatchVM) RunStateTest ¶
func (evm *ErigonBatchVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
RunStateTest implements the Evm interface
type ErigonVM ¶
type ErigonVM struct {
// contains filtered or unexported fields
}
ErigonVM is s Evm-interface wrapper around the eroigon `evm` binary
func NewErigonVM ¶
func (*ErigonVM) Copy ¶
Copy reads from the reader, does some geth-specific filtering and outputs items onto the channel
func (*ErigonVM) GetStateRoot ¶
GetStateRoot runs the test and returns the stateroot This currently only works for non-filled statetests. TODO: make it work even if the test is filled. Either by getting the whole trace, or adding stateroot to exec std output even in success-case
func (*ErigonVM) ParseStateRoot ¶
ParseStateRoot reads the stateroot from the combined output.
type Evm ¶
type Evm interface { // RunStateTest runs the statetest on the underlying EVM, and writes // the output to the given writer RunStateTest(path string, writer io.Writer, skipTrace bool) (*tracingResult, error) // GetStateRoot runs the test and returns the stateroot GetStateRoot(path string) (root, command string, err error) // ParseStateRoot reads the stateroot from the combined output. ParseStateRoot([]byte) (string, error) // Copy takes the 'raw' output from the VM, and writes the // canonical output to the given writer Copy(out io.Writer, input io.Reader) //Open() // Preparare for execution Close() // Tear down processes Name() string Stats() []any // Instance delivers an instance of the EVM which will be executed per-thread. // This method may deliver the same instance each time, but it may also // deliver e.g. a unique version which has preallocated buffers. Such an instance // is not concurrency-safe, but is fine to deliver in this method. Instance(threadId int) Evm }
The Evm interface represents external EVM implementations, which can be e.g. docker instances or binaries
type EvmoneVM ¶
type EvmoneVM struct {
// contains filtered or unexported fields
}
func NewEvmoneVM ¶
func (*EvmoneVM) GetStateRoot ¶
func (*EvmoneVM) ParseStateRoot ¶
func (*EvmoneVM) RunStateTest ¶
type GethBatchVM ¶
type GethBatchVM struct { GethEVM // contains filtered or unexported fields }
The GethBatchVM spins up one 'master' instance of the VM, and uses that to execute tests
func NewGethBatchVM ¶
func NewGethBatchVM(path, name string) *GethBatchVM
func (*GethBatchVM) Close ¶
func (vm *GethBatchVM) Close()
func (*GethBatchVM) GetStateRoot ¶
func (evm *GethBatchVM) GetStateRoot(path string) (root, command string, err error)
func (*GethBatchVM) Instance ¶
func (evm *GethBatchVM) Instance(threadId int) Evm
func (*GethBatchVM) RunStateTest ¶
func (evm *GethBatchVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
RunStateTest implements the Evm interface
type GethEVM ¶
type GethEVM struct {
// contains filtered or unexported fields
}
GethEVM is s Evm-interface wrapper around the `evm` binary, based on go-ethereum.
func NewGethEVM ¶
func (*GethEVM) Copy ¶
Copy reads from the reader, does some geth-specific filtering and outputs items onto the channel
func (*GethEVM) GetStateRoot ¶
GetStateRoot runs the test and returns the stateroot This currently only works for non-filled statetests. TODO: make it work even if the test is filled. Either by getting the whole trace, or adding stateroot to exec std output even in success-case
func (*GethEVM) ParseStateRoot ¶
ParseStateRoot reads geth's stateroot from the combined output.
type NethermindBatchVM ¶
type NethermindBatchVM struct { NethermindVM // contains filtered or unexported fields }
The NethermindBatchVM spins up one 'master' instance of the VM, and uses that to execute tests
func NewNethermindBatchVM ¶
func NewNethermindBatchVM(path, name string) *NethermindBatchVM
func (*NethermindBatchVM) Close ¶
func (vm *NethermindBatchVM) Close()
func (*NethermindBatchVM) GetStateRoot ¶
func (evm *NethermindBatchVM) GetStateRoot(path string) (root, command string, err error)
func (*NethermindBatchVM) Instance ¶
func (evm *NethermindBatchVM) Instance(threadId int) Evm
func (*NethermindBatchVM) RunStateTest ¶
func (evm *NethermindBatchVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
RunStateTest implements the Evm interface
type NethermindVM ¶
type NethermindVM struct {
// contains filtered or unexported fields
}
NethermindVM is s Evm-interface wrapper around the `nethtest` binary, based on Nethermind.
func NewNethermindVM ¶
func NewNethermindVM(path, name string) *NethermindVM
func (*NethermindVM) Close ¶
func (vm *NethermindVM) Close()
func (*NethermindVM) Copy ¶
func (evm *NethermindVM) Copy(out io.Writer, input io.Reader)
feed reads from the reader, does some geth-specific filtering and outputs items onto the channel
func (*NethermindVM) GetStateRoot ¶
func (evm *NethermindVM) GetStateRoot(path string) (root, command string, err error)
GetStateRoot runs the test and returns the stateroot
func (*NethermindVM) Instance ¶
func (evm *NethermindVM) Instance(threadId int) Evm
func (*NethermindVM) Name ¶
func (evm *NethermindVM) Name() string
func (*NethermindVM) ParseStateRoot ¶
func (evm *NethermindVM) ParseStateRoot(data []byte) (string, error)
getStateRoot reads the stateroot from the combined output.
func (*NethermindVM) RunStateTest ¶
func (evm *NethermindVM) RunStateTest(path string, out io.Writer, speedTest bool) (*tracingResult, error)
RunStateTest implements the Evm interface
func (*NethermindVM) Stats ¶
func (evm *NethermindVM) Stats() []any
type NimbusEVM ¶
type NimbusEVM struct {
// contains filtered or unexported fields
}
NimbusEVM is s Evm-interface wrapper around the `evmstate` binary, based on nimbus-eth1.
func NewNimbusEVM ¶
func (*NimbusEVM) GetStateRoot ¶
GetStateRoot runs the test and returns the stateroot This currently only works for non-filled statetests. TODO: make it work even if the test is filled. Either by getting the whole trace, or adding stateroot to exec std output even in success-case
func (*NimbusEVM) ParseStateRoot ¶
ParseStateRoot reads geth's stateroot from the combined output.