Skip to content

Commit

Permalink
Merge pull request ethereum#107 from etclabscore/fix/checkpoints
Browse files Browse the repository at this point in the history
Fix/checkpoints
  • Loading branch information
meowsbits committed Jan 2, 2020
2 parents aec0e07 + c0239e8 commit 3503bc5
Show file tree
Hide file tree
Showing 14 changed files with 408 additions and 261 deletions.
2 changes: 1 addition & 1 deletion core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
110 changes: 59 additions & 51 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,22 @@ var CheckpointOracles = map[common.Hash]*ctypes.CheckpointOracleConfig{
var (
// MainnetChainConfig is the chain parameters to run a node on the main network.
MainnetChainConfig = &goethereum.ChainConfig{
ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(1150000),
DAOForkBlock: big.NewInt(1920000),
DAOForkSupport: true,
EIP150Block: big.NewInt(2463000),
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
EIP155Block: big.NewInt(2675000),
EIP158Block: big.NewInt(2675000),
ByzantiumBlock: big.NewInt(4370000),
ConstantinopleBlock: big.NewInt(7280000),
PetersburgBlock: big.NewInt(7280000),
IstanbulBlock: big.NewInt(9069000),
MuirGlacierBlock: big.NewInt(9200000),
Ethash: new(ctypes.EthashConfig),
ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(1150000),
DAOForkBlock: big.NewInt(1920000),
DAOForkSupport: true,
EIP150Block: big.NewInt(2463000),
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
EIP155Block: big.NewInt(2675000),
EIP158Block: big.NewInt(2675000),
ByzantiumBlock: big.NewInt(4370000),
ConstantinopleBlock: big.NewInt(7280000),
PetersburgBlock: big.NewInt(7280000),
IstanbulBlock: big.NewInt(9069000),
MuirGlacierBlock: big.NewInt(9200000),
Ethash: new(ctypes.EthashConfig),
TrustedCheckpoint: MainnetTrustedCheckpoint,
TrustedCheckpointOracle: MainnetCheckpointOracle,
}

// MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network.
Expand All @@ -92,20 +94,22 @@ var (

// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
TestnetChainConfig = &goethereum.ChainConfig{
ChainID: big.NewInt(3),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
EIP155Block: big.NewInt(10),
EIP158Block: big.NewInt(10),
ByzantiumBlock: big.NewInt(1700000),
ConstantinopleBlock: big.NewInt(4230000),
PetersburgBlock: big.NewInt(4939394),
IstanbulBlock: big.NewInt(6485846),
MuirGlacierBlock: big.NewInt(7117117),
Ethash: new(ctypes.EthashConfig),
ChainID: big.NewInt(3),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
EIP155Block: big.NewInt(10),
EIP158Block: big.NewInt(10),
ByzantiumBlock: big.NewInt(1700000),
ConstantinopleBlock: big.NewInt(4230000),
PetersburgBlock: big.NewInt(4939394),
IstanbulBlock: big.NewInt(6485846),
MuirGlacierBlock: big.NewInt(7117117),
Ethash: new(ctypes.EthashConfig),
TrustedCheckpoint: TestnetTrustedCheckpoint,
TrustedCheckpointOracle: TestnetCheckpointOracle,
}

// TestnetTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network.
Expand All @@ -131,18 +135,20 @@ var (

// RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network.
RinkebyChainConfig = &goethereum.ChainConfig{
ChainID: big.NewInt(4),
HomesteadBlock: big.NewInt(1),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(2),
EIP150Hash: common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
EIP155Block: big.NewInt(3),
EIP158Block: big.NewInt(3),
ByzantiumBlock: big.NewInt(1035301),
ConstantinopleBlock: big.NewInt(3660663),
PetersburgBlock: big.NewInt(4321234),
IstanbulBlock: big.NewInt(5435345),
ChainID: big.NewInt(4),
HomesteadBlock: big.NewInt(1),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(2),
EIP150Hash: common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
EIP155Block: big.NewInt(3),
EIP158Block: big.NewInt(3),
ByzantiumBlock: big.NewInt(1035301),
ConstantinopleBlock: big.NewInt(3660663),
PetersburgBlock: big.NewInt(4321234),
IstanbulBlock: big.NewInt(5435345),
TrustedCheckpoint: RinkebyTrustedCheckpoint,
TrustedCheckpointOracle: RinkebyCheckpointOracle,
Clique: &ctypes.CliqueConfig{
Period: 15,
Epoch: 30000,
Expand Down Expand Up @@ -171,17 +177,19 @@ var (

// GoerliChainConfig contains the chain parameters to run a node on the Görli test network.
GoerliChainConfig = &goethereum.ChainConfig{
ChainID: big.NewInt(5),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
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(1561651),
ChainID: big.NewInt(5),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
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(1561651),
TrustedCheckpoint: GoerliTrustedCheckpoint,
TrustedCheckpointOracle: GoerliCheckpointOracle,
Clique: &ctypes.CliqueConfig{
Period: 15,
Epoch: 30000,
Expand Down
63 changes: 41 additions & 22 deletions params/config_classic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
84 changes: 55 additions & 29 deletions params/config_kotti.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
)
Loading

0 comments on commit 3503bc5

Please sign in to comment.