Revert "core: set nil withdrawals during genesis init"

This reverts commit 3740eacb80.
This commit is contained in:
Pratik Patil 2025-06-02 13:07:14 +05:30
parent 3740eacb80
commit 4ef7701a3e
No known key found for this signature in database
GPG key ID: AFDCA496554874B3

View file

@ -518,18 +518,15 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block {
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 := g.Config; conf != nil {
num := big.NewInt(int64(g.Number)) num := big.NewInt(int64(g.Number))
if conf.IsShanghai(num) {
// Polygon/bor: EIP-4895 (withdrawals) not supported. Only set empty
// withdrawal hash if we're not using bor consensus (e.g. dev mode).
if conf.IsShanghai(num) && conf.Bor == nil {
head.WithdrawalsHash = &types.EmptyWithdrawalsHash head.WithdrawalsHash = &types.EmptyWithdrawalsHash
withdrawals = make([]*types.Withdrawal, 0) withdrawals = make([]*types.Withdrawal, 0)
} }
if conf.IsCancun(num) { if conf.IsCancun(num) {
// EIP-4788: The parentBeaconBlockRoot of the genesis block is always // EIP-4788: The parentBeaconBlockRoot of the genesis block is always
// the zero hash. This is because the genesis block does not have a parent // the zero hash. This is because the genesis block does not have a parent
@ -546,8 +543,7 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block {
} }
} }
// Polygon/bor: EIP-7685 (requests) not supported. Only set empty // Polygon/bor: EIP-7685 not supported
// withdrawal hash if we're not using bor consensus (e.g. dev mode).
if conf.IsPrague(num) && conf.Bor == nil { if conf.IsPrague(num) && conf.Bor == nil {
head.RequestsHash = &types.EmptyRequestsHash head.RequestsHash = &types.EmptyRequestsHash
} }