From 2e638e607c70c6b9f4dfec389cb494a2f4f9e453 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 20 Apr 2026 22:45:09 +0200 Subject: [PATCH] core: set empty BlockAccessListHash on Amsterdam genesis When Amsterdam is active at genesis, toBlockWithRoot set SlotNumber on the header but left BlockAccessListHash nil. Because both are rlp optional fields on Header, and BlockAccessListHash precedes SlotNumber in the encoded order, RLP writes an empty string (0x80) placeholder in the BAL hash slot. Decoding such a header then fails with "rlp: input string too short for common.Hash, decoding into (types.Header).BlockAccessListHash", preventing the node from loading its own freshly written genesis. Default BlockAccessListHash to the empty-BAL hash (keccak256(0xc0)) on the same fork gate so the optional chain stays consistent and genesis headers round-trip through RLP. --- core/genesis.go | 3 +++ core/types/hashes.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/core/genesis.go b/core/genesis.go index 25b54cdfbd..005379b88b 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -557,6 +557,9 @@ func (g *Genesis) toBlockWithRoot(root common.Hash) *types.Block { if head.SlotNumber == nil { head.SlotNumber = new(uint64) } + if head.BlockAccessListHash == nil { + head.BlockAccessListHash = &types.EmptyBlockAccessListHash + } } } return types.NewBlock(head, &types.Body{Withdrawals: withdrawals}, nil, trie.NewStackTrie(nil)) diff --git a/core/types/hashes.go b/core/types/hashes.go index 22f1f946dc..7b9a4abcef 100644 --- a/core/types/hashes.go +++ b/core/types/hashes.go @@ -43,6 +43,10 @@ var ( // EmptyRequestsHash is the known hash of an empty request set, sha256(""). EmptyRequestsHash = common.HexToHash("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") + // EmptyBlockAccessListHash is the known hash of an empty block access list, + // keccak256(rlp(empty list)) = keccak256(0xc0). + EmptyBlockAccessListHash = common.HexToHash("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") + // EmptyVerkleHash is the known hash of an empty verkle trie. EmptyVerkleHash = common.Hash{}