Skip to content

Commit

Permalink
core/types: sanity check the basefee length inside a header (ethereum…
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Jul 6, 2021
1 parent d21a069 commit e13d14e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/types/block.go
Expand Up @@ -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
}

Expand Down

0 comments on commit e13d14e

Please sign in to comment.