@@ -841,17 +841,20 @@ func (s *Sender) getBlockNumberAndTimestampAndBaseFeeAndBlobFee(ctx context.Cont
841841 baseFee = header .BaseFee .Uint64 ()
842842 }
843843
844- // Leave it up to the L1 node to compute the correct blob base fee.
845- // Previously we would compute it locally using `CalcBlobFee`, but
846- // that approach requires syncing any future L1 configuration changes.
847- // Note: The fetched blob base fee might not correspond to the block
848- // that we fetched in the previous step, but this is acceptable.
849- var blobBaseFeeHex hexutil.Big
850- if err := s .rpcClient .CallContext (ctx , & blobBaseFeeHex , "eth_blobBaseFee" ); err != nil {
851- return 0 , 0 , 0 , 0 , fmt .Errorf ("failed to call eth_blobBaseFee, err: %w" , err )
852- }
853- // A correct L1 node could not return a value that overflows uint64
854- blobBaseFee := blobBaseFeeHex .ToInt ().Uint64 ()
844+ var blobBaseFee uint64
845+ if excess := header .ExcessBlobGas ; excess != nil {
846+ // Leave it up to the L1 node to compute the correct blob base fee.
847+ // Previously we would compute it locally using `CalcBlobFee`, but
848+ // that approach requires syncing any future L1 configuration changes.
849+ // Note: The fetched blob base fee might not correspond to the block
850+ // that we fetched in the previous step, but this is acceptable.
851+ var blobBaseFeeHex hexutil.Big
852+ if err := s .rpcClient .CallContext (ctx , & blobBaseFeeHex , "eth_blobBaseFee" ); err != nil {
853+ return 0 , 0 , 0 , 0 , fmt .Errorf ("failed to call eth_blobBaseFee, err: %w" , err )
854+ }
855+ // A correct L1 node could not return a value that overflows uint64
856+ blobBaseFee = blobBaseFeeHex .ToInt ().Uint64 ()
857+ }
855858
856859 // header.Number.Uint64() returns the pendingBlockNumber, so we minus 1 to get the latestBlockNumber.
857860 return header .Number .Uint64 () - 1 , header .Time , baseFee , blobBaseFee , nil
0 commit comments