File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,10 @@ func VerifyBlockFee(
134134 if requiredBlockGasCost == nil || ! requiredBlockGasCost .IsUint64 () {
135135 return fmt .Errorf ("invalid block gas cost (%d) in apricot phase 4" , requiredBlockGasCost )
136136 }
137+ // If the required block gas cost is 0, we don't need to verify the block fee
138+ if requiredBlockGasCost .Sign () == 0 {
139+ return nil
140+ }
137141
138142 var (
139143 gasUsed = new (big.Int )
Original file line number Diff line number Diff line change 44package customheader
55
66import (
7+ "math"
78 "math/big"
89 "testing"
910
1011 "github.com/ava-labs/libevm/common"
11- "github.com/ava-labs/libevm/common/math"
1212 "github.com/ava-labs/libevm/core/types"
1313 "github.com/stretchr/testify/assert"
1414 "github.com/stretchr/testify/require"
@@ -456,6 +456,14 @@ func TestVerifyBlockFee(t *testing.T) {
456456 extraStateContribution : nil ,
457457 shouldErr : false ,
458458 },
459+ "zero block gas cost" : {
460+ baseFee : big .NewInt (100 ),
461+ parentBlockGasCost : big .NewInt (0 ),
462+ timeElapsed : testFeeConfig .TargetBlockRate + 1 ,
463+ txs : nil ,
464+ receipts : nil ,
465+ extraStateContribution : nil ,
466+ },
459467 }
460468
461469 for name , test := range tests {
You can’t perform that action at this time.
0 commit comments