core/types: sanity check the basefee length inside a header (#23171)

pull/23178/head
Péter Szilágyi 3 years ago committed by GitHub
parent d21a069619
commit e13d14e6a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      core/types/block.go

@ -129,6 +129,11 @@ func (h *Header) SanityCheck() error {
if eLen := len(h.Extra); eLen > 100*1024 {
return fmt.Errorf("too large block extradata: size %d", eLen)
}
if h.BaseFee != nil {
if bfLen := h.BaseFee.BitLen(); bfLen > 256 {
return fmt.Errorf("too large base fee: bitlen %d", bfLen)
}
}
return nil
}

Loading…
Cancel
Save