Skip to content

Commit e13d14e

Browse files
authored
core/types: sanity check the basefee length inside a header (#23171)
1 parent d21a069 commit e13d14e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/types/block.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ func (h *Header) SanityCheck() error {
129129
if eLen := len(h.Extra); eLen > 100*1024 {
130130
return fmt.Errorf("too large block extradata: size %d", eLen)
131131
}
132+
if h.BaseFee != nil {
133+
if bfLen := h.BaseFee.BitLen(); bfLen > 256 {
134+
return fmt.Errorf("too large base fee: bitlen %d", bfLen)
135+
}
136+
}
132137
return nil
133138
}
134139

0 commit comments

Comments
 (0)