mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-18 12:51:39 +00:00
core: warn on unexpected pre-london genesis base fee
This commit is contained in:
parent
965bd6b6a0
commit
f252730f7d
1 changed files with 7 additions and 4 deletions
|
|
@ -510,17 +510,20 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block {
|
||||||
head.Difficulty = params.GenesisDifficulty
|
head.Difficulty = params.GenesisDifficulty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if g.Config != nil && g.Config.IsLondon(common.Big0) {
|
conf := g.Config
|
||||||
|
if conf != nil {
|
||||||
if g.BaseFee != nil {
|
if g.BaseFee != nil {
|
||||||
head.BaseFee = g.BaseFee
|
if !conf.IsLondon(common.Big0) {
|
||||||
} else {
|
log.Warn("Invalid genesis, unexpected BaseFee set before London, allowing it for testing purposes")
|
||||||
|
}
|
||||||
|
} else if conf.IsLondon(common.Big0) {
|
||||||
head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee)
|
head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
withdrawals []*types.Withdrawal
|
withdrawals []*types.Withdrawal
|
||||||
)
|
)
|
||||||
if conf := g.Config; conf != nil {
|
if conf != nil {
|
||||||
num := big.NewInt(int64(g.Number))
|
num := big.NewInt(int64(g.Number))
|
||||||
if conf.IsShanghai(num, g.Timestamp) {
|
if conf.IsShanghai(num, g.Timestamp) {
|
||||||
head.WithdrawalsHash = &types.EmptyWithdrawalsHash
|
head.WithdrawalsHash = &types.EmptyWithdrawalsHash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue