diff --git a/Makefile b/Makefile index 09f9953f501e..762366542a92 100644 --- a/Makefile +++ b/Makefile @@ -37,16 +37,20 @@ sync-clients: test-multigeth: test-multigeth-features test-multigeth-chainspecs ## Runs all tests specific to multi-geth. -test-multigeth-features: test-multigeth-features-parity test-multigeth-features-multigeth ## Runs tests specific to multi-geth using Fork/Feature configs. +test-multigeth-features: test-multigeth-features-parity test-multigeth-features-multigeth test-multigeth-features-multigethv0 ## Runs tests specific to multi-geth using Fork/Feature configs. -test-multigeth-features-multigeth: +test-multigeth-features-parity: @echo "Testing fork/feature/datatype implementation; equivalence - PARITY." env MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_PARITY=on go test -count=1 ./tests -test-multigeth-features-parity: +test-multigeth-features-multigeth: @echo "Testing fork/feature/datatype implementation; equivalence - MULTIGETH." env MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_MULTIGETH=on go test -count=1 ./tests +test-multigeth-features-multigethv0: + @echo "Testing fork/feature/datatype implementation; equivalence - MULTIGETHv0." + env MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_MULTIGETHV0=on go test -count=1 ./tests + test-multigeth-chainspecs: ## Run tests specific to multi-geth using chainspec file configs. @echo "Testing Parity JSON chainspec equivalence." env MULTIGETH_TESTS_CHAINCONFIG_PARITY_SPECS=on go test -count=1 ./tests diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 212bfd0d0937..683b66a9ee2e 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -384,14 +384,8 @@ func CalcDifficulty(config ctypes.ChainConfigurator, time uint64, parent *types. exPeriodRef.Set(fakeBlockNumber) } else if config.IsForked(config.GetEthashEIP2384Transition, next) { - // calcDifficultyEIP1234 is the difficulty adjustment algorithm for Constantinople. - // The calculation uses the Byzantium rules, but with bomb offset 5M. - // Specification EIP-1234: https://eips.ethereum.org/EIPS/eip-1234 - // Note, the calculations below looks at the parent number, which is 1 below - // the block number. Thus we remove one from the delay given - - // calculate a fake block number for the ice-age delay - // Specification: https://eips.ethereum.org/EIPS/eip-1234 + // calcDifficultyEIP2384 is the difficulty adjustment algorithm for Muir Glacier. + // The calculation uses the Byzantium rules, but with bomb offset 9M. fakeBlockNumber := new(big.Int) delayWithOffset := new(big.Int).Sub(vars.EIP2384DifficultyBombDelay, common.Big1) if parent.Number.Cmp(delayWithOffset) >= 0 { diff --git a/core/genesis_test.go b/core/genesis_test.go index beee403e1c74..5b6075dfae52 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -29,7 +29,7 @@ import ( "github.com/ethereum/go-ethereum/params/confp" "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/multigeth" - "github.com/ethereum/go-ethereum/params/types/oldmultigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" ) func TestSetupGenesisBlock(t *testing.T) { @@ -71,7 +71,7 @@ func TestSetupGenesisBlockOldVsNewMultigeth(t *testing.T) { // Setup a genesis mocking <=v1.9.6, aka "old". genA := params.DefaultGenesisBlock() - genA.Config = &oldmultigeth.ChainConfig{ + genA.Config = &multigethv0.ChainConfig{ ChainID: big.NewInt(61), HomesteadBlock: big.NewInt(1150000), DAOForkBlock: big.NewInt(1920000), @@ -256,7 +256,7 @@ func TestSetupGenesisBlock2(t *testing.T) { if storedConf == nil { t.Fatal("nil stored conf") } - wantType := reflect.TypeOf(&oldmultigeth.ChainConfig{}) + wantType := reflect.TypeOf(&multigethv0.ChainConfig{}) if reflect.TypeOf(storedConf) != wantType { t.Fatalf("mismatch, want: %v, got: %v", wantType, reflect.TypeOf(storedConf)) } diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 4ee7cfabf66a..a5655bc9c3e5 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -189,7 +189,7 @@ func instructionSetForConfig(config ctypes.ChainConfigurator, bn *big.Int) JumpT if config.IsForked(config.GetECIP1080Transition, bn) { enableSelfBalance(&instructionSet) } - if config.IsForked(config.GetEIP2200Transition, bn) { + if config.IsForked(config.GetEIP2200Transition, bn) && !config.IsForked(config.GetEIP2200DisableTransition, bn) { enable2200(&instructionSet) // Net metered SSTORE - https://eips.ethereum.org/EIPS/eip-2200 } return instructionSet diff --git a/params/config_test.go b/params/config_test.go index 386d1240ebe2..75a6a85967cc 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -25,7 +25,7 @@ import ( "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/goethereum" "github.com/ethereum/go-ethereum/params/types/multigeth" - "github.com/ethereum/go-ethereum/params/types/oldmultigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" ) func uint64P(n uint64) *uint64 { @@ -219,7 +219,7 @@ func TestCheckCompatible(t *testing.T) { { stored: func() ctypes.ChainConfigurator { // ClassicChainConfig is the chain parameters to run a node on the Classic main network. - c := &oldmultigeth.ChainConfig{ + c := &multigethv0.ChainConfig{ ChainID: big.NewInt(61), HomesteadBlock: big.NewInt(1150000), DAOForkBlock: big.NewInt(1920000), @@ -252,7 +252,7 @@ func TestCheckCompatible(t *testing.T) { { stored: func() ctypes.ChainConfigurator { // ClassicChainConfig is the chain parameters to run a node on the Classic main network. - c := &oldmultigeth.ChainConfig{ + c := &multigethv0.ChainConfig{ ChainID: big.NewInt(61), HomesteadBlock: big.NewInt(1150000), DAOForkBlock: big.NewInt(1920000), diff --git a/params/confp/generic/generic.go b/params/confp/generic/generic.go index 3efd4c36cdd3..88b3ed2e6f84 100644 --- a/params/confp/generic/generic.go +++ b/params/confp/generic/generic.go @@ -24,7 +24,7 @@ import ( "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/goethereum" "github.com/ethereum/go-ethereum/params/types/multigeth" - "github.com/ethereum/go-ethereum/params/types/oldmultigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" "github.com/ethereum/go-ethereum/params/types/parity" "github.com/ethereum/go-ethereum/params/vars" "github.com/tidwall/gjson" @@ -47,7 +47,7 @@ func (c GenericCC) DAOSupport() bool { if gc, ok := c.ChainConfigurator.(*goethereum.ChainConfig); ok { return gc.DAOForkSupport } - if omg, ok := c.ChainConfigurator.(*oldmultigeth.ChainConfig); ok { + if omg, ok := c.ChainConfigurator.(*multigethv0.ChainConfig); ok { return omg.DAOForkSupport } if mg, ok := c.ChainConfigurator.(*multigeth.MultiGethChainConfig); ok { @@ -114,7 +114,7 @@ func UnmarshalChainConfigurator(input []byte) (ctypes.ChainConfigurator, error) }{ {&parity.ParityChainSpec{}, paritySchemaKeysSuffice, paritySchemaKeysMustNot}, {&multigeth.MultiGethChainConfig{}, multigethSchemaSuffice, multigethSchemaMustNot}, - {&oldmultigeth.ChainConfig{}, oldmultigethSchemaSuffice, oldmultigethSchemaMustNot}, + {&multigethv0.ChainConfig{}, oldmultigethSchemaSuffice, oldmultigethSchemaMustNot}, {&goethereum.ChainConfig{}, goethereumSchemaSuffice, goethereumSchemaMustNot}, } for _, c := range cases { diff --git a/params/confp/generic/generic_test.go b/params/confp/generic/generic_test.go index 10054e53feee..01028cc44e31 100644 --- a/params/confp/generic/generic_test.go +++ b/params/confp/generic/generic_test.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/goethereum" "github.com/ethereum/go-ethereum/params/types/multigeth" - "github.com/ethereum/go-ethereum/params/types/oldmultigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" "github.com/ethereum/go-ethereum/params/types/parity" ) @@ -68,7 +68,7 @@ result: } } - om := &oldmultigeth.ChainConfig{ + om := &multigethv0.ChainConfig{ ChainID: big.NewInt(61), HomesteadBlock: big.NewInt(1150000), DAOForkBlock: big.NewInt(1920000), @@ -101,8 +101,8 @@ result: if err != nil { t.Fatal(err) } - if reflect.TypeOf(got) != reflect.TypeOf(&oldmultigeth.ChainConfig{}) { - t.Fatalf("mismatch, want: %v, got: %v", reflect.TypeOf(&oldmultigeth.ChainConfig{}), reflect.TypeOf(got)) + if reflect.TypeOf(got) != reflect.TypeOf(&multigethv0.ChainConfig{}) { + t.Fatalf("mismatch, want: %v, got: %v", reflect.TypeOf(&multigethv0.ChainConfig{}), reflect.TypeOf(got)) } if tr := got.GetEIP7Transition(); tr == nil || *tr != 1150000 { @@ -233,12 +233,12 @@ func TestUnmarshalChainConfigurator2(t *testing.T) { { versionid: "v196", raw: cc_v196_a, - wantType: reflect.TypeOf(&oldmultigeth.ChainConfig{}), + wantType: reflect.TypeOf(&multigethv0.ChainConfig{}), }, { versionid: "v197", raw: cc_v197_a, - wantType: reflect.TypeOf(&oldmultigeth.ChainConfig{}), + wantType: reflect.TypeOf(&multigethv0.ChainConfig{}), }, { versionid: "v198", diff --git a/params/types/ctypes/configurator_iface.go b/params/types/ctypes/configurator_iface.go index e5a5389b7e8f..3e9293dc0f2d 100644 --- a/params/types/ctypes/configurator_iface.go +++ b/params/types/ctypes/configurator_iface.go @@ -108,6 +108,8 @@ type CatHerder interface { SetEIP1108Transition(n *uint64) error GetEIP2200Transition() *uint64 SetEIP2200Transition(n *uint64) error + GetEIP2200DisableTransition() *uint64 + SetEIP2200DisableTransition(n *uint64) error GetEIP1344Transition() *uint64 SetEIP1344Transition(n *uint64) error GetEIP1884Transition() *uint64 diff --git a/params/types/genesisT/gen_genesis.go b/params/types/genesisT/gen_genesis.go index add8e450e914..fc35d8c3a29f 100644 --- a/params/types/genesisT/gen_genesis.go +++ b/params/types/genesisT/gen_genesis.go @@ -31,7 +31,7 @@ import ( common0 "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/goethereum" "github.com/ethereum/go-ethereum/params/types/multigeth" - "github.com/ethereum/go-ethereum/params/types/oldmultigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" ) var _ = (*genesisSpecMarshaling)(nil) @@ -101,8 +101,8 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { switch conf.(type) { case *multigeth.MultiGethChainConfig: dec.Config = &multigeth.MultiGethChainConfig{} - case *oldmultigeth.ChainConfig: - dec.Config = &oldmultigeth.ChainConfig{} + case *multigethv0.ChainConfig: + dec.Config = &multigethv0.ChainConfig{} case *goethereum.ChainConfig: dec.Config = &goethereum.ChainConfig{} default: diff --git a/params/types/genesisT/genesis.go b/params/types/genesisT/genesis.go index 396f8a4cbfbb..c7890289343c 100644 --- a/params/types/genesisT/genesis.go +++ b/params/types/genesisT/genesis.go @@ -488,6 +488,14 @@ func (g *Genesis) SetEIP2200Transition(n *uint64) error { return g.Config.SetEIP2200Transition(n) } +func (g *Genesis) GetEIP2200DisableTransition() *uint64 { + return g.Config.GetEIP2200DisableTransition() +} + +func (g *Genesis) SetEIP2200DisableTransition(n *uint64) error { + return g.Config.SetEIP2200DisableTransition(n) +} + func (g *Genesis) GetEIP1344Transition() *uint64 { return g.Config.GetEIP1344Transition() } diff --git a/params/types/goethereum/goethereum_configurator.go b/params/types/goethereum/goethereum_configurator.go index e943cebf3de2..bfd773dfab16 100644 --- a/params/types/goethereum/goethereum_configurator.go +++ b/params/types/goethereum/goethereum_configurator.go @@ -326,6 +326,17 @@ func (c *ChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *ChainConfig) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (c *ChainConfig) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (c *ChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.IstanbulBlock) } diff --git a/params/types/multigeth/chain_config.go b/params/types/multigeth/chain_config.go index f81b518c27b9..f18821af4b0d 100644 --- a/params/types/multigeth/chain_config.go +++ b/params/types/multigeth/chain_config.go @@ -151,7 +151,8 @@ type MultiGethChainConfig struct { // EIP-2200: Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change // It's a combined version of EIP-1283 + EIP-1706, with a structured definition so as to make it // interoperable with other gas changes such as EIP-1884. - EIP2200FBlock *big.Int `json:"eip2200FBlock,omitempty"` + EIP2200FBlock *big.Int `json:"eip2200FBlock,omitempty"` + EIP2200DisableFBlock *big.Int `json:"eip2200DisableFBlock,omitempty"` // EIP-2384: Difficulty Bomb Delay (Muir Glacier) eip2384Inferred bool diff --git a/params/types/multigeth/chain_config_configurator.go b/params/types/multigeth/chain_config_configurator.go index 039ce8274a9a..c2d3d5d5b796 100644 --- a/params/types/multigeth/chain_config_configurator.go +++ b/params/types/multigeth/chain_config_configurator.go @@ -318,6 +318,15 @@ func (c *MultiGethChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *MultiGethChainConfig) GetEIP2200DisableTransition() *uint64 { + return bigNewU64(c.EIP2200DisableFBlock) +} + +func (c *MultiGethChainConfig) SetEIP2200DisableTransition(n *uint64) error { + c.EIP2200DisableFBlock = setBig(c.EIP2200DisableFBlock, n) + return nil +} + func (c *MultiGethChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.EIP1344FBlock) } diff --git a/params/types/multigethv0/doc.go b/params/types/multigethv0/doc.go new file mode 100644 index 000000000000..8145deaf7d9b --- /dev/null +++ b/params/types/multigethv0/doc.go @@ -0,0 +1,9 @@ +/* +Package multigethv0 implements the data type fitting +the original iteration of the multigeth client configuration structure. + +It is mostly used for managing upgrades between client versions, +and is not encouraged for real use. +*/ + +package multigethv0 diff --git a/params/types/oldmultigeth/oldmultigeth_chain_config.go b/params/types/multigethv0/multigethv0_chain_config.go similarity index 94% rename from params/types/oldmultigeth/oldmultigeth_chain_config.go rename to params/types/multigethv0/multigethv0_chain_config.go index f307b617a76f..e4ec86b5dd02 100644 --- a/params/types/oldmultigeth/oldmultigeth_chain_config.go +++ b/params/types/multigethv0/multigethv0_chain_config.go @@ -1,4 +1,4 @@ -package oldmultigeth +package multigethv0 import ( "math/big" @@ -112,8 +112,9 @@ type ChainConfig struct { PetersburgBlock *big.Int `json:"petersburgBlock,omitempty"` // Petersburg switch block (nil = same as Constantinople) - IstanbulBlock *big.Int `json:"istanbulBlock,omitempty"` // Istanbul switch block (nil = no fork, 0 = already on istanbul) - EWASMBlock *big.Int `json:"ewasmBlock,omitempty"` // EWASM switch block (nil = no fork, 0 = already activated) + IstanbulBlock *big.Int `json:"istanbulBlock,omitempty"` // Istanbul switch block (nil = no fork, 0 = already on istanbul) + MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated) + EWASMBlock *big.Int `json:"ewasmBlock,omitempty"` // EWASM switch block (nil = no fork, 0 = already activated) ECIP1010PauseBlock *big.Int `json:"ecip1010PauseBlock,omitempty"` // ECIP1010 pause HF block ECIP1010Length *big.Int `json:"ecip1010Length,omitempty"` // ECIP1010 length diff --git a/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go b/params/types/multigethv0/multigethv0_chain_config_configurator.go similarity index 96% rename from params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go rename to params/types/multigethv0/multigethv0_chain_config_configurator.go index d5e7916691f1..846bc83316a1 100644 --- a/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go +++ b/params/types/multigethv0/multigethv0_chain_config_configurator.go @@ -1,4 +1,4 @@ -package oldmultigeth +package multigethv0 import ( "math/big" @@ -314,6 +314,17 @@ func (c *ChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *ChainConfig) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (c *ChainConfig) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (c *ChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.IstanbulBlock) } @@ -526,15 +537,14 @@ func (c *ChainConfig) SetEthashEIP1234Transition(n *uint64) error { return nil } +// Muir Glacier difficulty bomb delay func (c *ChainConfig) GetEthashEIP2384Transition() *uint64 { - return nil + return bigNewU64(c.MuirGlacierBlock) } func (c *ChainConfig) SetEthashEIP2384Transition(n *uint64) error { - if n == nil { - return nil - } - return ctypes.ErrUnsupportedConfigFatal + c.MuirGlacierBlock = setBig(c.MuirGlacierBlock, n) + return nil } func (c *ChainConfig) GetEthashECIP1010PauseTransition() *uint64 { @@ -600,9 +610,11 @@ func (c *ChainConfig) SetEthashECIP1017EraRounds(n *uint64) error { } func (c *ChainConfig) GetEthashEIP100BTransition() *uint64 { - x := bigNewU64(bigMax(c.EIP100FBlock, c.ByzantiumBlock)) + // Because the Ethereum Foundation network (and client... and tests) assume that if Constantinople + // is activated, then Byzantium must be (have been) as well. + x := bigMax(c.EIP100FBlock, c.ByzantiumBlock) if x != nil { - return x + return bigNewU64(x) } return bigNewU64(bigMax(c.EIP100FBlock, c.ConstantinopleBlock)) } diff --git a/params/types/oldmultigeth/oldmultigeth_chain_config_test.go b/params/types/multigethv0/multigethv0_chain_config_test.go similarity index 98% rename from params/types/oldmultigeth/oldmultigeth_chain_config_test.go rename to params/types/multigethv0/multigethv0_chain_config_test.go index 0897f27e4341..1245e032d74b 100644 --- a/params/types/oldmultigeth/oldmultigeth_chain_config_test.go +++ b/params/types/multigethv0/multigethv0_chain_config_test.go @@ -1,4 +1,4 @@ -package oldmultigeth +package multigethv0 import ( "math/big" diff --git a/params/types/parity/parity_configurator.go b/params/types/parity/parity_configurator.go index f999bdb240a2..6a3bdb123f5f 100644 --- a/params/types/parity/parity_configurator.go +++ b/params/types/parity/parity_configurator.go @@ -250,6 +250,17 @@ func (spec *ParityChainSpec) SetEIP2200Transition(i *uint64) error { return nil } +func (spec *ParityChainSpec) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (spec *ParityChainSpec) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (spec *ParityChainSpec) GetEIP1344Transition() *uint64 { return spec.Params.EIP1344Transition.Uint64P() } diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go index 9091aa80c5cd..99e477b3d489 100644 --- a/tests/difficulty_test_util.go +++ b/tests/difficulty_test_util.go @@ -139,10 +139,11 @@ func (test *DifficultyTest) Run(config ctypes.ChainConfigurator) error { actual := ethash.CalcDifficulty(config, test.CurrentTimestamp, parent) exp := test.CurrentDifficulty + b, _ := json.Marshal(config) if actual.Cmp(exp) != 0 { return fmt.Errorf(`%s got: %v, want: %v test: %v -config: %s`, test.Name, actual, exp, test, config) +config: %s`, test.Name, actual, exp, test, string(b)) } return nil diff --git a/tests/init_mgen.go b/tests/init_mgen.go index 92b38888752b..8c431f78a09e 100644 --- a/tests/init_mgen.go +++ b/tests/init_mgen.go @@ -34,8 +34,9 @@ var ( // Feature Equivalence tests use convert.Convert to // run tests using alternating ChainConfig data type implementations. - MG_CHAINCONFIG_FEATURE_EQ_MULTIGETH_KEY = "MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_MULTIGETH" - MG_CHAINCONFIG_FEATURE_EQ_PARITY_KEY = "MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_PARITY" + MG_CHAINCONFIG_FEATURE_EQ_MULTIGETH_KEY = "MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_MULTIGETH" + MG_CHAINCONFIG_FEATURE_EQ_MULTIGETHV0_KEY = "MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_MULTIGETHV0" + MG_CHAINCONFIG_FEATURE_EQ_PARITY_KEY = "MULTIGETH_TESTS_CHAINCONFIG_FEATURE_EQUIVALENCE_PARITY" // Parity specs tests use Parity JSON config data (in params/parity.json.d/) // when applicable as equivalent config implementations for the default Go data type diff --git a/tests/init_test.go b/tests/init_test.go index fe6171e77174..d7e393be46a7 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -210,7 +210,7 @@ func (tm *testMatcher) walk(t *testing.T, dir string, runTest interface{}) { dirinfo, err := os.Stat(dir) if os.IsNotExist(err) || !dirinfo.IsDir() { fmt.Fprintf(os.Stderr, "can't find test files in %s, did you clone the tests submodule?\n", dir) - t.Skip("missing test files") + t.Fatal("missing test files") } err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { name := filepath.ToSlash(strings.TrimPrefix(path, dir+string(filepath.Separator))) diff --git a/tests/params.go b/tests/params.go index 4058383325d1..40ca3c64ff0f 100644 --- a/tests/params.go +++ b/tests/params.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/params/confp" "github.com/ethereum/go-ethereum/params/types/ctypes" "github.com/ethereum/go-ethereum/params/types/multigeth" + "github.com/ethereum/go-ethereum/params/types/multigethv0" "github.com/ethereum/go-ethereum/params/types/parity" ) @@ -130,6 +131,25 @@ func init() { difficultyChainConfigurations[k] = mgc } + } else if os.Getenv(MG_CHAINCONFIG_FEATURE_EQ_MULTIGETHV0_KEY) != "" { + log.Println("converting to MultiGethV0 data type.") + + for i, config := range Forks { + pspec := &multigethv0.ChainConfig{} + if err := confp.Convert(config, pspec); ctypes.IsFatalUnsupportedErr(err) { + panic(err) + } + Forks[i] = pspec + } + + for k, v := range difficultyChainConfigurations { + pspec := &multigethv0.ChainConfig{} + if err := confp.Convert(v, pspec); ctypes.IsFatalUnsupportedErr(err) { + panic(err) + } + difficultyChainConfigurations[k] = pspec + } + } else if os.Getenv(MG_CHAINCONFIG_FEATURE_EQ_PARITY_KEY) != "" { log.Println("converting to Parity data type.")