tests

package
v1.12.18-0...-f7272fa Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Overview

Package tests implements execution of Ethereum JSON tests.

Index

Constants

This section is empty.

Variables

View Source
var (
	CG_GENERATE_STATE_TESTS_KEY             = "COREGETH_TESTS_GENERATE_STATE_TESTS"
	CG_GENERATE_DIFFICULTY_TESTS_KEY        = "COREGETH_TESTS_GENERATE_DIFFICULTY_TESTS"
	CG_GENERATE_DIFFICULTY_TEST_CONFIGS_KEY = "COREGETH_TESTS_GENERATE_DIFFICULTY_TESTS_CONFIGS"

	// Feature Equivalence tests use convert.Convert to
	// run tests using alternating ChainConfig data type implementations.
	CG_CHAINCONFIG_FEATURE_EQ_COREGETH_KEY = "COREGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_COREGETH"

	CG_CHAINCONFIG_CONSENSUS_EQ_CLIQUE = "COREGETH_TESTS_CHAINCONFIG_CONSENSUS_EQUIVALENCE_CLIQUE"

	// CG_CHAINCONFIG_CHAINSPECS_COREGETH_KEY uses core-geth config data (in params/core-geth.json.d)
	// when applicable as equivalent config implementations for the default Go data type
	// configs.
	CG_CHAINCONFIG_CHAINSPECS_COREGETH_KEY = "COREGETH_TESTS_CHAINCONFIG_COREGETH_SPECS"
)
View Source
var Forks = map[string]ctypes.ChainConfigurator{
	"Frontier": &goethereum.ChainConfig{
		Ethash:  new(ctypes.EthashConfig),
		ChainID: big.NewInt(1),
	},
	"Homestead": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
	},
	"EIP150": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		EIP150Block:    big.NewInt(0),
	},
	"EIP158": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		EIP150Block:    big.NewInt(0),
		EIP155Block:    big.NewInt(0),
		EIP158Block:    big.NewInt(0),
	},
	"Byzantium": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		EIP150Block:    big.NewInt(0),
		EIP155Block:    big.NewInt(0),
		EIP158Block:    big.NewInt(0),
		ByzantiumBlock: big.NewInt(0),
	},
	"ETC_Atlantis": &coregeth.CoreGethChainConfig{
		NetworkID:          1,
		Ethash:             new(ctypes.EthashConfig),
		ChainID:            big.NewInt(61),
		EIP2FBlock:         big.NewInt(0),
		EIP7FBlock:         big.NewInt(0),
		EIP150Block:        big.NewInt(0),
		EIP155Block:        big.NewInt(0),
		EIP160FBlock:       big.NewInt(0),
		EIP161FBlock:       big.NewInt(0),
		EIP170FBlock:       big.NewInt(0),
		EIP100FBlock:       big.NewInt(0),
		EIP140FBlock:       big.NewInt(0),
		EIP198FBlock:       big.NewInt(0),
		EIP211FBlock:       big.NewInt(0),
		EIP212FBlock:       big.NewInt(0),
		EIP213FBlock:       big.NewInt(0),
		EIP214FBlock:       big.NewInt(0),
		EIP658FBlock:       big.NewInt(0),
		EIP145FBlock:       nil,
		EIP1014FBlock:      nil,
		EIP1052FBlock:      nil,
		EIP1283FBlock:      nil,
		EIP2200FBlock:      nil,
		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"Constantinople": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     nil,
	},
	"ConstantinopleFix": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
	},
	"ETC_Agharta": &coregeth.CoreGethChainConfig{
		NetworkID:          1,
		Ethash:             new(ctypes.EthashConfig),
		ChainID:            big.NewInt(61),
		EIP2FBlock:         big.NewInt(0),
		EIP7FBlock:         big.NewInt(0),
		EIP150Block:        big.NewInt(0),
		EIP155Block:        big.NewInt(0),
		EIP160FBlock:       big.NewInt(0),
		EIP161FBlock:       big.NewInt(0),
		EIP170FBlock:       big.NewInt(0),
		EIP100FBlock:       big.NewInt(0),
		EIP140FBlock:       big.NewInt(0),
		EIP198FBlock:       big.NewInt(0),
		EIP211FBlock:       big.NewInt(0),
		EIP212FBlock:       big.NewInt(0),
		EIP213FBlock:       big.NewInt(0),
		EIP214FBlock:       big.NewInt(0),
		EIP658FBlock:       big.NewInt(0),
		EIP145FBlock:       big.NewInt(0),
		EIP1014FBlock:      big.NewInt(0),
		EIP1052FBlock:      big.NewInt(0),
		EIP1283FBlock:      big.NewInt(0),
		PetersburgBlock:    big.NewInt(0),
		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"Istanbul": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
	},
	"ETC_Phoenix": &coregeth.CoreGethChainConfig{
		NetworkID:       1,
		Ethash:          new(ctypes.EthashConfig),
		ChainID:         big.NewInt(61),
		EIP2FBlock:      big.NewInt(0),
		EIP7FBlock:      big.NewInt(0),
		EIP150Block:     big.NewInt(0),
		EIP155Block:     big.NewInt(0),
		EIP160FBlock:    big.NewInt(0),
		EIP161FBlock:    big.NewInt(0),
		EIP170FBlock:    big.NewInt(0),
		EIP100FBlock:    big.NewInt(0),
		EIP140FBlock:    big.NewInt(0),
		EIP198FBlock:    big.NewInt(0),
		EIP211FBlock:    big.NewInt(0),
		EIP212FBlock:    big.NewInt(0),
		EIP213FBlock:    big.NewInt(0),
		EIP214FBlock:    big.NewInt(0),
		EIP658FBlock:    big.NewInt(0),
		EIP145FBlock:    big.NewInt(0),
		EIP1014FBlock:   big.NewInt(0),
		EIP1052FBlock:   big.NewInt(0),
		EIP1283FBlock:   big.NewInt(0),
		PetersburgBlock: big.NewInt(0),

		EIP152FBlock:  big.NewInt(0),
		EIP1108FBlock: big.NewInt(0),
		EIP1344FBlock: big.NewInt(0),
		EIP1884FBlock: big.NewInt(0),
		EIP2028FBlock: big.NewInt(0),
		EIP2200FBlock: big.NewInt(0),

		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"FrontierToHomesteadAt5": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(5),
	},
	"HomesteadToEIP150At5": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		EIP150Block:    big.NewInt(5),
	},
	"HomesteadToDaoAt5": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		DAOForkBlock:   big.NewInt(5),
		DAOForkSupport: true,
	},
	"EIP158ToByzantiumAt5": &goethereum.ChainConfig{
		Ethash:         new(ctypes.EthashConfig),
		ChainID:        big.NewInt(1),
		HomesteadBlock: big.NewInt(0),
		EIP150Block:    big.NewInt(0),
		EIP155Block:    big.NewInt(0),
		EIP158Block:    big.NewInt(0),
		ByzantiumBlock: big.NewInt(5),
	},
	"ByzantiumToConstantinopleAt5": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(5),
	},
	"ByzantiumToConstantinopleFixAt5": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(5),
		PetersburgBlock:     big.NewInt(5),
	},
	"ConstantinopleFixToIstanbulAt5": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(5),
	},
	"MuirGlacier": &goethereum.ChainConfig{
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		DAOForkBlock:        big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
	},
	"Berlin": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
		BerlinBlock:         big.NewInt(0),
	},
	"BerlinToLondonAt5": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
		BerlinBlock:         big.NewInt(0),
		LondonBlock:         big.NewInt(5),
	},
	"London": &goethereum.ChainConfig{
		Ethash:              new(ctypes.EthashConfig),
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
		BerlinBlock:         big.NewInt(0),
		LondonBlock:         big.NewInt(0),
	},
	"ArrowGlacier": &goethereum.ChainConfig{
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
		BerlinBlock:         big.NewInt(0),
		LondonBlock:         big.NewInt(0),
		ArrowGlacierBlock:   big.NewInt(0),
	},
	"ArrowGlacierToMergeAtDiffC0000": &goethereum.ChainConfig{
		ChainID:                 big.NewInt(1),
		HomesteadBlock:          big.NewInt(0),
		EIP150Block:             big.NewInt(0),
		EIP155Block:             big.NewInt(0),
		EIP158Block:             big.NewInt(0),
		ByzantiumBlock:          big.NewInt(0),
		ConstantinopleBlock:     big.NewInt(0),
		PetersburgBlock:         big.NewInt(0),
		IstanbulBlock:           big.NewInt(0),
		MuirGlacierBlock:        big.NewInt(0),
		BerlinBlock:             big.NewInt(0),
		LondonBlock:             big.NewInt(0),
		ArrowGlacierBlock:       big.NewInt(0),
		GrayGlacierBlock:        big.NewInt(0),
		MergeNetsplitBlock:      big.NewInt(0),
		TerminalTotalDifficulty: big.NewInt(0xC0000),
	},
	"GrayGlacier": &goethereum.ChainConfig{
		ChainID:             big.NewInt(1),
		HomesteadBlock:      big.NewInt(0),
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		MuirGlacierBlock:    big.NewInt(0),
		BerlinBlock:         big.NewInt(0),
		LondonBlock:         big.NewInt(0),
		ArrowGlacierBlock:   big.NewInt(0),
		GrayGlacierBlock:    big.NewInt(0),
	},
	"Merge": &goethereum.ChainConfig{
		ChainID:                       big.NewInt(1),
		HomesteadBlock:                big.NewInt(0),
		EIP150Block:                   big.NewInt(0),
		EIP155Block:                   big.NewInt(0),
		EIP158Block:                   big.NewInt(0),
		ByzantiumBlock:                big.NewInt(0),
		ConstantinopleBlock:           big.NewInt(0),
		PetersburgBlock:               big.NewInt(0),
		IstanbulBlock:                 big.NewInt(0),
		MuirGlacierBlock:              big.NewInt(0),
		BerlinBlock:                   big.NewInt(0),
		LondonBlock:                   big.NewInt(0),
		ArrowGlacierBlock:             big.NewInt(0),
		MergeNetsplitBlock:            big.NewInt(0),
		TerminalTotalDifficulty:       big.NewInt(0),
		TerminalTotalDifficultyPassed: true,
	},
	"ETC_Magneto": &coregeth.CoreGethChainConfig{
		NetworkID:       1,
		Ethash:          new(ctypes.EthashConfig),
		ChainID:         big.NewInt(61),
		EIP2FBlock:      big.NewInt(0),
		EIP7FBlock:      big.NewInt(0),
		EIP150Block:     big.NewInt(0),
		EIP155Block:     big.NewInt(0),
		EIP160FBlock:    big.NewInt(0),
		EIP161FBlock:    big.NewInt(0),
		EIP170FBlock:    big.NewInt(0),
		EIP100FBlock:    big.NewInt(0),
		EIP140FBlock:    big.NewInt(0),
		EIP198FBlock:    big.NewInt(0),
		EIP211FBlock:    big.NewInt(0),
		EIP212FBlock:    big.NewInt(0),
		EIP213FBlock:    big.NewInt(0),
		EIP214FBlock:    big.NewInt(0),
		EIP658FBlock:    big.NewInt(0),
		EIP145FBlock:    big.NewInt(0),
		EIP1014FBlock:   big.NewInt(0),
		EIP1052FBlock:   big.NewInt(0),
		EIP1283FBlock:   big.NewInt(0),
		PetersburgBlock: big.NewInt(0),

		EIP152FBlock:  big.NewInt(0),
		EIP1108FBlock: big.NewInt(0),
		EIP1344FBlock: big.NewInt(0),
		EIP1884FBlock: big.NewInt(0),
		EIP2028FBlock: big.NewInt(0),
		EIP2200FBlock: big.NewInt(0),

		EIP2565FBlock: big.NewInt(0),
		EIP2929FBlock: big.NewInt(0),
		EIP2718FBlock: big.NewInt(0),
		EIP2930FBlock: big.NewInt(0),

		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"ETC_Mystique": &coregeth.CoreGethChainConfig{
		NetworkID:       1,
		Ethash:          new(ctypes.EthashConfig),
		ChainID:         big.NewInt(61),
		EIP2FBlock:      big.NewInt(0),
		EIP7FBlock:      big.NewInt(0),
		EIP150Block:     big.NewInt(0),
		EIP155Block:     big.NewInt(0),
		EIP160FBlock:    big.NewInt(0),
		EIP161FBlock:    big.NewInt(0),
		EIP170FBlock:    big.NewInt(0),
		EIP100FBlock:    big.NewInt(0),
		EIP140FBlock:    big.NewInt(0),
		EIP198FBlock:    big.NewInt(0),
		EIP211FBlock:    big.NewInt(0),
		EIP212FBlock:    big.NewInt(0),
		EIP213FBlock:    big.NewInt(0),
		EIP214FBlock:    big.NewInt(0),
		EIP658FBlock:    big.NewInt(0),
		EIP145FBlock:    big.NewInt(0),
		EIP1014FBlock:   big.NewInt(0),
		EIP1052FBlock:   big.NewInt(0),
		EIP1283FBlock:   big.NewInt(0),
		PetersburgBlock: big.NewInt(0),

		EIP152FBlock:  big.NewInt(0),
		EIP1108FBlock: big.NewInt(0),
		EIP1344FBlock: big.NewInt(0),
		EIP1884FBlock: big.NewInt(0),
		EIP2028FBlock: big.NewInt(0),
		EIP2200FBlock: big.NewInt(0),

		EIP2565FBlock: big.NewInt(0),
		EIP2929FBlock: big.NewInt(0),
		EIP2718FBlock: big.NewInt(0),
		EIP2930FBlock: big.NewInt(0),

		EIP3529FBlock: big.NewInt(0),
		EIP3541FBlock: big.NewInt(0),
		EIP1559FBlock: nil,
		EIP3198FBlock: nil,
		EIP3554FBlock: nil,

		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"Shanghai": &goethereum.ChainConfig{
		ChainID:                 big.NewInt(1),
		HomesteadBlock:          big.NewInt(0),
		EIP150Block:             big.NewInt(0),
		EIP155Block:             big.NewInt(0),
		EIP158Block:             big.NewInt(0),
		ByzantiumBlock:          big.NewInt(0),
		ConstantinopleBlock:     big.NewInt(0),
		PetersburgBlock:         big.NewInt(0),
		IstanbulBlock:           big.NewInt(0),
		MuirGlacierBlock:        big.NewInt(0),
		BerlinBlock:             big.NewInt(0),
		LondonBlock:             big.NewInt(0),
		ArrowGlacierBlock:       big.NewInt(0),
		MergeNetsplitBlock:      big.NewInt(0),
		TerminalTotalDifficulty: big.NewInt(0),
		ShanghaiTime:            u64(0),
	},
	"MergeToShanghaiAtTime15k": &goethereum.ChainConfig{
		ChainID:                 big.NewInt(1),
		HomesteadBlock:          big.NewInt(0),
		EIP150Block:             big.NewInt(0),
		EIP155Block:             big.NewInt(0),
		EIP158Block:             big.NewInt(0),
		ByzantiumBlock:          big.NewInt(0),
		ConstantinopleBlock:     big.NewInt(0),
		PetersburgBlock:         big.NewInt(0),
		IstanbulBlock:           big.NewInt(0),
		MuirGlacierBlock:        big.NewInt(0),
		BerlinBlock:             big.NewInt(0),
		LondonBlock:             big.NewInt(0),
		ArrowGlacierBlock:       big.NewInt(0),
		MergeNetsplitBlock:      big.NewInt(0),
		TerminalTotalDifficulty: big.NewInt(0),
		ShanghaiTime:            u64(15_000),
	},
	"ETC_Spiral": &coregeth.CoreGethChainConfig{
		NetworkID:       1,
		Ethash:          new(ctypes.EthashConfig),
		ChainID:         big.NewInt(61),
		EIP2FBlock:      big.NewInt(0),
		EIP7FBlock:      big.NewInt(0),
		EIP150Block:     big.NewInt(0),
		EIP155Block:     big.NewInt(0),
		EIP160FBlock:    big.NewInt(0),
		EIP161FBlock:    big.NewInt(0),
		EIP170FBlock:    big.NewInt(0),
		EIP100FBlock:    big.NewInt(0),
		EIP140FBlock:    big.NewInt(0),
		EIP198FBlock:    big.NewInt(0),
		EIP211FBlock:    big.NewInt(0),
		EIP212FBlock:    big.NewInt(0),
		EIP213FBlock:    big.NewInt(0),
		EIP214FBlock:    big.NewInt(0),
		EIP658FBlock:    big.NewInt(0),
		EIP145FBlock:    big.NewInt(0),
		EIP1014FBlock:   big.NewInt(0),
		EIP1052FBlock:   big.NewInt(0),
		EIP1283FBlock:   big.NewInt(0),
		PetersburgBlock: big.NewInt(0),

		EIP152FBlock:  big.NewInt(0),
		EIP1108FBlock: big.NewInt(0),
		EIP1344FBlock: big.NewInt(0),
		EIP1884FBlock: big.NewInt(0),
		EIP2028FBlock: big.NewInt(0),
		EIP2200FBlock: big.NewInt(0),

		EIP2565FBlock: big.NewInt(0),
		EIP2929FBlock: big.NewInt(0),
		EIP2718FBlock: big.NewInt(0),
		EIP2930FBlock: big.NewInt(0),

		EIP3529FBlock: big.NewInt(0),
		EIP3541FBlock: big.NewInt(0),
		EIP1559FBlock: nil,
		EIP3198FBlock: nil,
		EIP3554FBlock: nil,

		EIP4399FBlock: nil,
		EIP3651FBlock: big.NewInt(0),
		EIP3855FBlock: big.NewInt(0),
		EIP3860FBlock: big.NewInt(0),
		EIP4895FBlock: nil,
		EIP6049FBlock: big.NewInt(0),

		DisposalBlock:      big.NewInt(0),
		ECIP1017FBlock:     big.NewInt(5000000),
		ECIP1017EraRounds:  big.NewInt(5000000),
		ECIP1010PauseBlock: nil,
		ECIP1010Length:     nil,
	},
	"Cancun": &goethereum.ChainConfig{
		ChainID:                 big.NewInt(1),
		HomesteadBlock:          big.NewInt(0),
		EIP150Block:             big.NewInt(0),
		EIP155Block:             big.NewInt(0),
		EIP158Block:             big.NewInt(0),
		ByzantiumBlock:          big.NewInt(0),
		ConstantinopleBlock:     big.NewInt(0),
		PetersburgBlock:         big.NewInt(0),
		IstanbulBlock:           big.NewInt(0),
		MuirGlacierBlock:        big.NewInt(0),
		BerlinBlock:             big.NewInt(0),
		LondonBlock:             big.NewInt(0),
		ArrowGlacierBlock:       big.NewInt(0),
		MergeNetsplitBlock:      big.NewInt(0),
		TerminalTotalDifficulty: big.NewInt(0),
		ShanghaiTime:            u64(0),
		CancunTime:              u64(0),
	},
}

Forks table defines supported forks and their chain config.

View Source
var MapForkNameChainspecFileState = map[string]string{
	"Frontier":             "frontier_test.json",
	"Homestead":            "homestead_test.json",
	"EIP150":               "eip150_test.json",
	"EIP158":               "eip161_test.json",
	"Byzantium":            "byzantium_test.json",
	"Constantinople":       "constantinople_test.json",
	"ConstantinopleFix":    "constantinople_fix_test.json",
	"EIP158ToByzantiumAt5": "eip_158_to_byzantium_at_5_test.json",
	"Istanbul":             "istanbul_test.json",
	"Berlin":               "berlin_test.json",
	"ETC_Atlantis":         "etc_atlantis_test.json",
	"ETC_Agharta":          "etc_agharta_test.json",
	"ETC_Phoenix":          "etc_phoenix_test.json",
	"ETC_Magneto":          "etc_magneto_test.json",
}

MapForkNameChainspecFileState is a dictionary pairing Fork names with respective file base names. These are used for StateTests, BlockchainTests, but not Difficulty tests. These files are expected to be found in coregethSpecsDir.

Functions

func AvailableForks

func AvailableForks() []string

AvailableForks returns the set of defined fork names

func FromHex

func FromHex(s string) ([]byte, error)

FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x". This is copy-pasted from bytes.go, which does not return the error

func GetChainConfig

func GetChainConfig(forkString string) (baseConfig ctypes.ChainConfigurator, eips []int, err error)

GetChainConfig takes a fork definition and returns a chain config. The fork definition can be - a plain forkname, e.g. `Byzantium`, - a fork basename, and a list of EIPs to enable; e.g. `Byzantium+1884+1283`.

func MakePreState

func MakePreState(db ethdb.Database, accounts genesisT.GenesisAlloc, snapshotter bool) (*snapshot.Tree, *state.StateDB)

Types

type BlockTest

type BlockTest struct {
	// contains filtered or unexported fields
}

A BlockTest checks handling of entire blocks.

func (*BlockTest) Run

func (t *BlockTest) Run(snapshotter bool, tracer vm.EVMLogger) error

func (*BlockTest) UnmarshalJSON

func (t *BlockTest) UnmarshalJSON(in []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type DifficultyTest

type DifficultyTest struct {
	ParentTimestamp    uint64   `json:"parentTimestamp"`
	ParentDifficulty   *big.Int `json:"parentDifficulty"`
	ParentUncles       uint64   `json:"parentUncles"`
	CurrentTimestamp   uint64   `json:"currentTimestamp"`
	CurrentBlockNumber uint64   `json:"currentBlockNumber"`
	CurrentDifficulty  *big.Int `json:"currentDifficulty"`
}

func (DifficultyTest) MarshalJSON

func (d DifficultyTest) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*DifficultyTest) Run

func (test *DifficultyTest) Run(config ctypes.ChainConfigurator) error

func (*DifficultyTest) UnmarshalJSON

func (d *DifficultyTest) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type RLPTest

type RLPTest struct {
	// If the value of In is "INVALID" or "VALID", the test
	// checks whether Out can be decoded into a value of
	// type interface{}.
	//
	// For other JSON values, In is treated as a driver for
	// calls to rlp.Stream. The test also verifies that encoding
	// In produces the bytes in Out.
	In interface{}

	// Out is a hex-encoded RLP value.
	Out string
}

RLPTest is the JSON structure of a single RLP test.

func (*RLPTest) Run

func (t *RLPTest) Run() error

Run executes the test.

type StateSubtest

type StateSubtest struct {
	Fork  string
	Index int
}

StateSubtest selects a specific configuration of a General State Test.

type StateTest

type StateTest struct {
	// Name is only used for writing tests (Marshaling).
	// It is set by inference, using the test's filepath base.
	Name string
	// contains filtered or unexported fields
}

StateTest checks transaction processing without block context. See https://github.com/ethereum/EIPs/issues/176 for the test format specification.

func (StateTest) MarshalJSON

func (t StateTest) MarshalJSON() ([]byte, error)

func (*StateTest) Run

func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bool) (*snapshot.Tree, *state.StateDB, error)

Run executes a specific subtest and verifies the post-state and logs

func (*StateTest) RunNoVerify

func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapshotter bool) (*snapshot.Tree, *state.StateDB, common.Hash, error)

RunNoVerify runs a specific subtest and returns the statedb and post-state root

func (*StateTest) RunNoVerifyWithPost

func (t *StateTest) RunNoVerifyWithPost(subtest StateSubtest, vmconfig vm.Config, snapshotter bool, post stPostState) (*snapshot.Tree, *state.StateDB, common.Hash, error)

RunNoVerify runs a specific subtest and returns the statedb and post-state root

func (*StateTest) RunSetPost

func (t *StateTest) RunSetPost(subtest StateSubtest, vmconfig vm.Config) error

RunSetPost runs the state subtest for a given config, and writes the resulting state to the corresponding subtest post field.

func (*StateTest) Subtests

func (t *StateTest) Subtests(skipForks []*regexp.Regexp) []StateSubtest

Subtests returns all valid subtests of the test.

func (*StateTest) UnmarshalJSON

func (t *StateTest) UnmarshalJSON(in []byte) error

type TransactionTest

type TransactionTest struct {
	RLP            hexutil.Bytes `json:"rlp"`
	Byzantium      ttFork
	Constantinople ttFork
	Istanbul       ttFork
	EIP150         ttFork
	EIP158         ttFork
	Frontier       ttFork
	Homestead      ttFork
}

TransactionTest checks RLP decoding and sender derivation of transactions.

func (*TransactionTest) Run

type UnsupportedForkError

type UnsupportedForkError struct {
	Name string
}

UnsupportedForkError is returned when a test requests a fork that isn't implemented.

func (UnsupportedForkError) Error

func (e UnsupportedForkError) Error() string

Jump to

Keyboard shortcuts

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