mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
core, params: replace time based hardforks in config to block based
This commit is contained in:
parent
6bb20a79e4
commit
aee9a5cc07
5 changed files with 61 additions and 60 deletions
|
|
@ -380,9 +380,9 @@ func TestTimeBasedForkInGenesis(t *testing.T) {
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
MergeNetsplitBlock: big.NewInt(0),
|
MergeNetsplitBlock: big.NewInt(0),
|
||||||
ShanghaiTime: &shanghai,
|
// ShanghaiBlock: &shanghai,
|
||||||
CancunTime: &cancun,
|
// CancunBlock: &cancun,
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -283,10 +283,10 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
||||||
ArrowGlacierBlock: big.NewInt(0),
|
ArrowGlacierBlock: big.NewInt(0),
|
||||||
GrayGlacierBlock: big.NewInt(0),
|
GrayGlacierBlock: big.NewInt(0),
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: &verkleTime,
|
ShanghaiBlock: big.NewInt(0),
|
||||||
CancunTime: &verkleTime,
|
CancunBlock: big.NewInt(0),
|
||||||
PragueTime: &verkleTime,
|
PragueBlock: big.NewInt(0),
|
||||||
VerkleTime: &verkleTime,
|
VerkleBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
ShanghaiTime: new(uint64),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
CancunTime: new(uint64),
|
CancunBlock: big.NewInt(0),
|
||||||
Bor: ¶ms.BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
Bor: ¶ms.BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
||||||
}
|
}
|
||||||
signer = types.LatestSigner(config)
|
signer = types.LatestSigner(config)
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ var (
|
||||||
BerlinBlock: big.NewInt(0),
|
BerlinBlock: big.NewInt(0),
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
ShanghaiTime: u64(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
VerkleTime: u64(0),
|
VerkleBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: common.Big0,
|
TerminalTotalDifficulty: common.Big0,
|
||||||
// TODO uncomment when proof generation is merged
|
// TODO uncomment when proof generation is merged
|
||||||
// ProofInBlocks: true,
|
// ProofInBlocks: true,
|
||||||
|
|
@ -74,13 +74,14 @@ var (
|
||||||
BerlinBlock: big.NewInt(0),
|
BerlinBlock: big.NewInt(0),
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
ShanghaiTime: u64(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
VerkleTime: u64(0),
|
VerkleBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: common.Big0,
|
TerminalTotalDifficulty: common.Big0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestProcessVerkle(t *testing.T) {
|
func TestProcessVerkle(t *testing.T) {
|
||||||
|
t.Skip("verkle trie is not yet supported in bor")
|
||||||
var (
|
var (
|
||||||
code = common.FromHex(`6060604052600a8060106000396000f360606040526008565b00`)
|
code = common.FromHex(`6060604052600a8060106000396000f360606040526008565b00`)
|
||||||
intrinsicContractCreationGas, _ = IntrinsicGas(code, nil, true, true, true, true)
|
intrinsicContractCreationGas, _ = IntrinsicGas(code, nil, true, true, true, true)
|
||||||
|
|
@ -112,7 +113,7 @@ func TestProcessVerkle(t *testing.T) {
|
||||||
// genesis := gspec.MustCommit(bcdb, triedb)
|
// genesis := gspec.MustCommit(bcdb, triedb)
|
||||||
cacheConfig := DefaultCacheConfigWithScheme(rawdb.PathScheme)
|
cacheConfig := DefaultCacheConfigWithScheme(rawdb.PathScheme)
|
||||||
cacheConfig.SnapshotLimit = 0
|
cacheConfig.SnapshotLimit = 0
|
||||||
blockchain, _ := NewBlockChain(bcdb, cacheConfig, gspec, nil, beacon.New(ethash.NewFaker()), vm.Config{}, nil)
|
blockchain, _ := NewBlockChain(bcdb, cacheConfig, gspec, nil, beacon.New(ethash.NewFaker()), vm.Config{}, nil, nil, nil)
|
||||||
defer blockchain.Stop()
|
defer blockchain.Stop()
|
||||||
|
|
||||||
txCost1 := params.TxGas
|
txCost1 := params.TxGas
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ var (
|
||||||
var (
|
var (
|
||||||
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)
|
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)
|
||||||
|
|
||||||
|
// Note: for "eth" based chains, all hardforks post merge are removed as they're timebased while
|
||||||
|
// our configs are block based.
|
||||||
|
|
||||||
// MainnetChainConfig is the chain parameters to run a node on the main network.
|
// MainnetChainConfig is the chain parameters to run a node on the main network.
|
||||||
MainnetChainConfig = &ChainConfig{
|
MainnetChainConfig = &ChainConfig{
|
||||||
ChainID: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
|
|
@ -62,8 +65,6 @@ var (
|
||||||
ArrowGlacierBlock: big.NewInt(13_773_000),
|
ArrowGlacierBlock: big.NewInt(13_773_000),
|
||||||
GrayGlacierBlock: big.NewInt(15_050_000),
|
GrayGlacierBlock: big.NewInt(15_050_000),
|
||||||
TerminalTotalDifficulty: MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
|
TerminalTotalDifficulty: MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
|
||||||
ShanghaiTime: newUint64(1681338455),
|
|
||||||
CancunTime: newUint64(1710338135),
|
|
||||||
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cbb839cbe05303d7705fa"),
|
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cbb839cbe05303d7705fa"),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
|
|
@ -87,8 +88,6 @@ var (
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: newUint64(1696000704),
|
|
||||||
CancunTime: newUint64(1707305664),
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
// SepoliaChainConfig contains the chain parameters to run a node on the Sepolia test network.
|
// SepoliaChainConfig contains the chain parameters to run a node on the Sepolia test network.
|
||||||
|
|
@ -111,29 +110,26 @@ var (
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
|
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
|
||||||
MergeNetsplitBlock: big.NewInt(1735371),
|
MergeNetsplitBlock: big.NewInt(1735371),
|
||||||
ShanghaiTime: newUint64(1677557088),
|
|
||||||
CancunTime: newUint64(1706655072),
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
// GoerliChainConfig contains the chain parameters to run a node on the Görli test network.
|
// GoerliChainConfig contains the chain parameters to run a node on the Görli test network.
|
||||||
GoerliChainConfig = &ChainConfig{
|
GoerliChainConfig = &ChainConfig{
|
||||||
ChainID: big.NewInt(5),
|
ChainID: big.NewInt(5),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
DAOForkBlock: nil,
|
DAOForkBlock: nil,
|
||||||
DAOForkSupport: true,
|
DAOForkSupport: true,
|
||||||
EIP150Block: big.NewInt(0),
|
EIP150Block: big.NewInt(0),
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
EIP158Block: big.NewInt(0),
|
EIP158Block: big.NewInt(0),
|
||||||
ByzantiumBlock: big.NewInt(0),
|
ByzantiumBlock: big.NewInt(0),
|
||||||
ConstantinopleBlock: big.NewInt(0),
|
ConstantinopleBlock: big.NewInt(0),
|
||||||
PetersburgBlock: big.NewInt(0),
|
PetersburgBlock: big.NewInt(0),
|
||||||
IstanbulBlock: big.NewInt(1_561_651),
|
IstanbulBlock: big.NewInt(1_561_651),
|
||||||
MuirGlacierBlock: nil,
|
MuirGlacierBlock: nil,
|
||||||
BerlinBlock: big.NewInt(4_460_644),
|
BerlinBlock: big.NewInt(4_460_644),
|
||||||
LondonBlock: big.NewInt(5_062_605),
|
LondonBlock: big.NewInt(5_062_605),
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(10_790_000),
|
TerminalTotalDifficulty: big.NewInt(10_790_000),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
Clique: &CliqueConfig{
|
Clique: &CliqueConfig{
|
||||||
Period: 15,
|
Period: 15,
|
||||||
Epoch: 30000,
|
Epoch: 30000,
|
||||||
|
|
@ -175,6 +171,8 @@ var (
|
||||||
"0": "0x00000000000000000000000000000000000000000",
|
"0": "0x00000000000000000000000000000000000000000",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
ShanghaiBlock: big.NewInt(0),
|
||||||
|
CancunBlock: big.NewInt(0),
|
||||||
}
|
}
|
||||||
BorUnittestChainConfig = &ChainConfig{
|
BorUnittestChainConfig = &ChainConfig{
|
||||||
ChainID: big.NewInt(80003),
|
ChainID: big.NewInt(80003),
|
||||||
|
|
@ -210,6 +208,8 @@ var (
|
||||||
"0": "0x00000000000000000000000000000000000000000",
|
"0": "0x00000000000000000000000000000000000000000",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
ShanghaiBlock: big.NewInt(0),
|
||||||
|
CancunBlock: big.NewInt(0),
|
||||||
}
|
}
|
||||||
|
|
||||||
// MumbaiChainConfig contains the chain parameters to run a node on the Mumbai test network.
|
// MumbaiChainConfig contains the chain parameters to run a node on the Mumbai test network.
|
||||||
|
|
@ -462,10 +462,10 @@ var (
|
||||||
GrayGlacierBlock: big.NewInt(0),
|
GrayGlacierBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: nil,
|
ShanghaiBlock: nil,
|
||||||
CancunTime: nil,
|
CancunBlock: nil,
|
||||||
PragueTime: nil,
|
PragueBlock: nil,
|
||||||
VerkleTime: nil,
|
VerkleBlock: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
Bor: &BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
Bor: &BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
||||||
|
|
@ -486,10 +486,10 @@ var (
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
ArrowGlacierBlock: big.NewInt(0),
|
ArrowGlacierBlock: big.NewInt(0),
|
||||||
GrayGlacierBlock: big.NewInt(0),
|
GrayGlacierBlock: big.NewInt(0),
|
||||||
ShanghaiTime: newUint64(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
CancunTime: newUint64(0),
|
CancunBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
PragueTime: newUint64(0),
|
PragueBlock: big.NewInt(0),
|
||||||
Bor: &BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
Bor: &BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -513,10 +513,10 @@ var (
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: nil,
|
ShanghaiBlock: nil,
|
||||||
CancunTime: nil,
|
CancunBlock: nil,
|
||||||
PragueTime: nil,
|
PragueBlock: nil,
|
||||||
VerkleTime: nil,
|
VerkleBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
||||||
|
|
@ -543,10 +543,10 @@ var (
|
||||||
ArrowGlacierBlock: big.NewInt(0),
|
ArrowGlacierBlock: big.NewInt(0),
|
||||||
GrayGlacierBlock: big.NewInt(0),
|
GrayGlacierBlock: big.NewInt(0),
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: nil,
|
ShanghaiBlock: nil,
|
||||||
CancunTime: nil,
|
CancunBlock: nil,
|
||||||
PragueTime: nil,
|
PragueBlock: nil,
|
||||||
VerkleTime: nil,
|
VerkleBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
@ -576,10 +576,10 @@ var (
|
||||||
ArrowGlacierBlock: big.NewInt(0),
|
ArrowGlacierBlock: big.NewInt(0),
|
||||||
GrayGlacierBlock: big.NewInt(0),
|
GrayGlacierBlock: big.NewInt(0),
|
||||||
MergeNetsplitBlock: big.NewInt(0),
|
MergeNetsplitBlock: big.NewInt(0),
|
||||||
ShanghaiTime: newUint64(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
CancunTime: newUint64(0),
|
CancunBlock: big.NewInt(0),
|
||||||
PragueTime: newUint64(0),
|
PragueBlock: big.NewInt(0),
|
||||||
VerkleTime: nil,
|
VerkleBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
@ -609,10 +609,10 @@ var (
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: nil,
|
ShanghaiBlock: nil,
|
||||||
CancunTime: nil,
|
CancunBlock: nil,
|
||||||
PragueTime: nil,
|
PragueBlock: nil,
|
||||||
VerkleTime: nil,
|
VerkleBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
TerminalTotalDifficulty: big.NewInt(math.MaxInt64),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue