core/types: fix CopyHeader missing BlockAccessListHash deep copy

CopyHeader copies all pointer-typed header fields (WithdrawalsHash,
RequestsHash, SlotNumber, etc.) but was missing the deep copy for
BlockAccessListHash added by EIP-7928. This caused the BAL hash
to be silently shared between the original and the copy, leading
to potential data races and incorrect nil-checks on copied headers.
This commit is contained in:
CPerezz 2026-02-14 11:15:48 +01:00 committed by MariusVanDerWijden
parent a46bd22ba9
commit e1521be67a

View file

@ -333,6 +333,10 @@ func CopyHeader(h *Header) *Header {
cpy.RequestsHash = new(common.Hash)
*cpy.RequestsHash = *h.RequestsHash
}
if h.BlockAccessListHash != nil {
cpy.BlockAccessListHash = new(common.Hash)
*cpy.BlockAccessListHash = *h.BlockAccessListHash
}
if h.SlotNumber != nil {
cpy.SlotNumber = new(uint64)
*cpy.SlotNumber = *h.SlotNumber