core: fix blob fee checker

This commit is contained in:
Péter Szilágyi 2023-11-07 12:10:47 +02:00
parent 5f39342a76
commit 9da87f8b99

View file

@ -327,7 +327,7 @@ func (st *StateTransition) preCheck() error {
if st.evm.ChainConfig().IsCancun(st.evm.Context.BlockNumber, st.evm.Context.Time) {
if st.blobGasUsed() > 0 {
// Skip the checks if gas fields are zero and blobBaseFee was explicitly disabled (eth_call)
if !st.evm.Config.NoBaseFee && msg.BlobGasFeeCap.BitLen() > 0 {
if !st.evm.Config.NoBaseFee || msg.BlobGasFeeCap.BitLen() > 0 {
if l := msg.BlobGasFeeCap.BitLen(); l > 256 {
return fmt.Errorf("%w: address %v, blobGasFeeCap bit length: %d", ErrFeeCapVeryHigh,
msg.From.Hex(), l)