Skip to content

Commit

Permalink
Merge pull request ethereum#48 from s1na/prague-devnet-0
Browse files Browse the repository at this point in the history
initialize requests in genesis block body
  • Loading branch information
MariusVanDerWijden authored May 14, 2024
2 parents d0d5d53 + d182cd4 commit 140412d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,10 @@ func (g *Genesis) ToBlock() *types.Block {
head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee)
}
}
var withdrawals []*types.Withdrawal
var (
withdrawals []*types.Withdrawal
requests types.Requests
)
if conf := g.Config; conf != nil {
num := big.NewInt(int64(g.Number))
if conf.IsShanghai(num, g.Timestamp) {
Expand All @@ -477,9 +480,10 @@ func (g *Genesis) ToBlock() *types.Block {
}
if conf.IsPrague(num, g.Timestamp) {
head.RequestsHash = &types.EmptyRequestsHash
requests = make(types.Requests, 0)
}
}
return types.NewBlock(head, &types.Body{Withdrawals: withdrawals}, nil, trie.NewStackTrie(nil))
return types.NewBlock(head, &types.Body{Withdrawals: withdrawals, Requests: requests}, nil, trie.NewStackTrie(nil))
}

// Commit writes the block and state of a genesis specification to the database.
Expand Down

0 comments on commit 140412d

Please sign in to comment.