diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 7b51e3b41140..f13ec3d49da9 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -239,7 +239,7 @@ func TestGatherForks(t *testing.T) { }{ { params.ClassicChainConfig, - []uint64{1150000, 2500000, 3000000, 5000000, 5900000, 8772000, 9573000}, + []uint64{1150000, 2500000, 3000000, 5000000, 5900000, 8772000, 9573000, 10500839}, }, { params.MainnetChainConfig, diff --git a/params/config_classic.go b/params/config_classic.go index a38e91bd50f9..5fdad6a92fea 100644 --- a/params/config_classic.go +++ b/params/config_classic.go @@ -26,31 +26,50 @@ import ( var ( // ClassicChainConfig is the chain parameters to run a node on the Classic main network. ClassicChainConfig = &multigeth.MultiGethChainConfig{ - NetworkID: 1, - Ethash: new(ctypes.EthashConfig), - ChainID: big.NewInt(61), + NetworkID: 1, + Ethash: new(ctypes.EthashConfig), + ChainID: big.NewInt(61), + EIP2FBlock: big.NewInt(1150000), EIP7FBlock: big.NewInt(1150000), + //DAOForkBlock: big.NewInt(1920000), - EIP150Block: big.NewInt(2500000), - EIP155Block: big.NewInt(3000000), - EIP160FBlock: big.NewInt(3000000), - EIP161FBlock: big.NewInt(8772000), - EIP170FBlock: big.NewInt(8772000), - EIP100FBlock: big.NewInt(8772000), - EIP140FBlock: big.NewInt(8772000), - EIP198FBlock: big.NewInt(8772000), - EIP211FBlock: big.NewInt(8772000), - EIP212FBlock: big.NewInt(8772000), - EIP213FBlock: big.NewInt(8772000), - EIP214FBlock: big.NewInt(8772000), - EIP658FBlock: big.NewInt(8772000), - EIP145FBlock: big.NewInt(9573000), - EIP1014FBlock: big.NewInt(9573000), - EIP1052FBlock: big.NewInt(9573000), - EIP1283FBlock: nil, - PetersburgBlock: nil, // Un1283 - EIP2200FBlock: nil, // RePetersburg (== re-1283) + + EIP150Block: big.NewInt(2500000), + + EIP155Block: big.NewInt(3000000), + EIP160FBlock: big.NewInt(3000000), + + // EIP158~ + EIP161FBlock: big.NewInt(8772000), + EIP170FBlock: big.NewInt(8772000), + + // Byzantium eq + EIP100FBlock: big.NewInt(8772000), + EIP140FBlock: big.NewInt(8772000), + EIP198FBlock: big.NewInt(8772000), + EIP211FBlock: big.NewInt(8772000), + EIP212FBlock: big.NewInt(8772000), + EIP213FBlock: big.NewInt(8772000), + EIP214FBlock: big.NewInt(8772000), + EIP658FBlock: big.NewInt(8772000), + + // Constantinople eq + EIP145FBlock: big.NewInt(9573000), + EIP1014FBlock: big.NewInt(9573000), + EIP1052FBlock: big.NewInt(9573000), + + // Istanbul eq + EIP152FBlock: big.NewInt(10500839), + EIP1108FBlock: big.NewInt(10500839), + EIP1344FBlock: big.NewInt(10500839), + EIP1884FBlock: nil, + EIP2028FBlock: big.NewInt(10500839), + EIP2200FBlock: big.NewInt(10500839), // RePetersburg (=~ re-1283) + + EIP1283FBlock: nil, + PetersburgBlock: nil, // Un1283 + DisposalBlock: big.NewInt(5900000), ECIP1017FBlock: big.NewInt(5000000), ECIP1017EraRounds: big.NewInt(5000000), diff --git a/params/config_kotti.go b/params/config_kotti.go index 103d3aef4e1a..0cb182b90c95 100644 --- a/params/config_kotti.go +++ b/params/config_kotti.go @@ -20,39 +20,65 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params/types/ctypes" - "github.com/ethereum/go-ethereum/params/types/goethereum" + "github.com/ethereum/go-ethereum/params/types/multigeth" ) var ( // Genesis hashes to enforce below configs on. KottiGenesisHash = common.HexToHash("0x14c2283285a88fe5fce9bf5c573ab03d6616695d717b12a127188bcacfc743c4") - KottiNetworkID uint64 = 6 - //KottiDisposalBlock = uint64(0) - //KottiECIP1017FBlock = uint64(5000000) - //KottiECIP1017EraRounds = uint64(5000000) - //KottiEIP160FBlock = uint64(0) - //KottiECIP1010PauseBlock = uint64(0) - //KottiECIP1010Length = uint64(2000000) - - KottiChainConfig = func() ctypes.ChainConfigurator { - c := &goethereum.ChainConfig{ - ChainID: big.NewInt(6), - HomesteadBlock: big.NewInt(0), - EIP150Block: big.NewInt(0), - EIP150Hash: common.HexToHash("0x14c2283285a88fe5fce9bf5c573ab03d6616695d717b12a127188bcacfc743c4"), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(716617), - ByzantiumBlock: big.NewInt(716617), - ConstantinopleBlock: big.NewInt(1705549), - PetersburgBlock: big.NewInt(1705549), - Clique: &ctypes.CliqueConfig{ - Period: 15, - Epoch: 30000, - }, - } - c.SetNetworkID(&KottiNetworkID) - - return c - }() + KottiChainConfig = &multigeth.MultiGethChainConfig{ + NetworkID: 6, + ChainID: big.NewInt(6), + Clique: &ctypes.CliqueConfig{ + Period: 15, + Epoch: 30000, + }, + + EIP2FBlock: big.NewInt(0), + EIP7FBlock: big.NewInt(0), + + EIP150Block: big.NewInt(0), + + EIP155Block: big.NewInt(0), + + // EIP158 eq + EIP160FBlock: big.NewInt(0), + EIP161FBlock: big.NewInt(716617), + EIP170FBlock: big.NewInt(716617), + + // Byzantium eq + EIP100FBlock: big.NewInt(716617), + EIP140FBlock: big.NewInt(716617), + EIP198FBlock: big.NewInt(716617), + EIP211FBlock: big.NewInt(716617), + EIP212FBlock: big.NewInt(716617), + EIP213FBlock: big.NewInt(716617), + EIP214FBlock: big.NewInt(716617), + EIP658FBlock: big.NewInt(716617), + + // Constantinople eq + EIP145FBlock: big.NewInt(1705549), + EIP1014FBlock: big.NewInt(1705549), + EIP1052FBlock: big.NewInt(1705549), + + // Istanbul eq + EIP152FBlock: big.NewInt(2058191), + EIP1108FBlock: big.NewInt(2058191), + EIP1344FBlock: big.NewInt(2058191), + EIP1884FBlock: nil, + EIP2028FBlock: big.NewInt(2058191), + EIP2200FBlock: big.NewInt(2058191), // RePetersburg (== re-1283) + + ECIP1017FBlock: big.NewInt(5000000), + ECIP1017EraRounds: big.NewInt(5000000), + + DisposalBlock: big.NewInt(0), + ECIP1010PauseBlock: big.NewInt(0), + ECIP1010Length: big.NewInt(2000000), + + RequireBlockHashes: map[uint64]common.Hash{ + 0: KottiGenesisHash, + }, + } ) diff --git a/params/config_mordor.go b/params/config_mordor.go index 8e772c617719..d54e7eb7d55f 100644 --- a/params/config_mordor.go +++ b/params/config_mordor.go @@ -23,67 +23,51 @@ import ( ) var ( - //MordorNetworkID uint64 = 7 - //MordorDisposalBlock = uint64(0) - //MordorECIP1017FBlock = uint64(2000000) - //MordorECIP1017EraRounds = uint64(2000000) - //MordorEIP160FBlock = uint64(0) - // MordorChainConfig is the chain parameters to run a node on the Ethereum Classic Mordor test network (PoW). - MordorChainConfig = func() ctypes.ChainConfigurator { - //c := &goethereum.ChainConfig{ - // ChainID: big.NewInt(63), - // HomesteadBlock: big.NewInt(0), - // EIP150Block: big.NewInt(0), - // EIP155Block: big.NewInt(0), - // EIP158Block: big.NewInt(0), - // ByzantiumBlock: big.NewInt(0), - // ConstantinopleBlock: big.NewInt(301243), - // PetersburgBlock: big.NewInt(301243), - // Ethash: new(goethereum.EthashConfig), - //} - //cc := ¶mtypes.MultiGethChainConfig{} - //err := convert.Convert(c, cc) - //if err != nil { - // panic(err) - //} - // - //cc.SetNetworkID(&MordorNetworkID) - //cc.SetEthashECIP1041Transition(&MordorDisposalBlock) - //cc.SetEthashECIP1017Transition(&MordorECIP1017FBlock) - //cc.SetEthashECIP1017EraRounds(&MordorECIP1017EraRounds) + MordorChainConfig = &multigeth.MultiGethChainConfig{ + NetworkID: 7, + ChainID: big.NewInt(63), + Ethash: new(ctypes.EthashConfig), + + EIP2FBlock: big.NewInt(0), + EIP7FBlock: big.NewInt(0), + + EIP150Block: big.NewInt(0), + + EIP155Block: big.NewInt(0), + + // EIP158 eq + EIP160FBlock: big.NewInt(0), + EIP161FBlock: big.NewInt(0), + EIP170FBlock: big.NewInt(0), + + // Byzantium eq + 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), + + // Constantinople eq + EIP145FBlock: big.NewInt(301243), + EIP1014FBlock: big.NewInt(301243), + EIP1052FBlock: big.NewInt(301243), + + // Istanbul eq + EIP152FBlock: big.NewInt(778507), + EIP1108FBlock: big.NewInt(778507), + EIP1344FBlock: big.NewInt(778507), + EIP1884FBlock: nil, + EIP2028FBlock: big.NewInt(778507), + EIP2200FBlock: big.NewInt(778507), // RePetersburg (== re-1283) - return &multigeth.MultiGethChainConfig{ - NetworkID: 7, - ChainID: big.NewInt(63), - Ethash: new(ctypes.EthashConfig), - EIP2FBlock: big.NewInt(0), - EIP7FBlock: big.NewInt(0), - //DAOForkBlock: big.NewInt(1920000), - 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(301243), - EIP1014FBlock: big.NewInt(301243), - EIP1052FBlock: big.NewInt(301243), - EIP1283FBlock: nil, - PetersburgBlock: nil, // Disable 1283 - EIP2200FBlock: nil, // RePetersburg - DisposalBlock: big.NewInt(0), - ECIP1017FBlock: big.NewInt(0), - ECIP1017EraRounds: big.NewInt(2000000), - ECIP1010PauseBlock: nil, - ECIP1010Length: nil, - } - }() + DisposalBlock: big.NewInt(0), + ECIP1017FBlock: big.NewInt(0), + ECIP1017EraRounds: big.NewInt(2000000), + ECIP1010PauseBlock: nil, + ECIP1010Length: nil, + } ) diff --git a/params/confp/internal/convert_test.go b/params/confp/internal/convert_test.go index e26a3f4d96c8..77a28747e946 100644 --- a/params/confp/internal/convert_test.go +++ b/params/confp/internal/convert_test.go @@ -25,7 +25,6 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params/confp" "github.com/ethereum/go-ethereum/params/confp/tconvert" "github.com/ethereum/go-ethereum/params/types/aleth" @@ -151,38 +150,3 @@ func TestCompatible(t *testing.T) { } t.Log(fns) } - -func TestGatherForks(t *testing.T) { - cases := []struct { - config *multigeth.MultiGethChainConfig - wantNs []uint64 - }{ - { - params.ClassicChainConfig, - []uint64{1150000, 2500000, 3000000, 5000000, 5900000, 8772000, 9573000}, - }, - } - sliceContains := func(sl []uint64, u uint64) bool { - for _, s := range sl { - if s == u { - return true - } - } - return false - } - for ci, c := range cases { - gotForkNs := confp.Forks(c.config) - if len(gotForkNs) != len(c.wantNs) { - for _, n := range c.wantNs { - if !sliceContains(gotForkNs, n) { - t.Errorf("config.i=%d missing wanted fork at block number: %d", ci, n) - } - } - for _, n := range gotForkNs { - if !sliceContains(c.wantNs, n) { - t.Errorf("config.i=%d gathered unwanted fork at block number: %d", ci, n) - } - } - } - } -}