Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

@holiman holiman Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to, again, look at it for a while before my brain parsed it out fully. Yeah it's ok now, but I'd prefer having it rewritten for clarity:

// skip checks if basefee was disabled and blobBaseFee is zero (eth_call) 
skipCheck := st.evm.Config.NoBaseFee && msg.BlobGasFeeCap.BitLen() == 0
if !skipCheck {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed this fix and also added it to the 1559 basefee

if l := msg.BlobGasFeeCap.BitLen(); l > 256 {
return fmt.Errorf("%w: address %v, blobGasFeeCap bit length: %d", ErrFeeCapVeryHigh,
msg.From.Hex(), l)
Expand Down