@@ -839,6 +839,11 @@ func (b *BlockChainAPI) FeeHistory(
839839 blockRewards := make ([]* hexutil.Big , len (rewardPercentiles ))
840840 feeParams , err := b .feeParameters .Get ()
841841 if err != nil {
842+ b .logger .Warn ().
843+ Uint64 ("height" , blockHeight ).
844+ Err (err ).
845+ Msg ("failed to get fee parameters for block in fee history" )
846+
842847 continue
843848 }
844849 gasPrice := feeParams .CalculateGasPrice (b .config .GasPrice )
@@ -1028,9 +1033,9 @@ func (b *BlockChainAPI) Coinbase(ctx context.Context) (common.Address, error) {
10281033func (b * BlockChainAPI ) GasPrice (ctx context.Context ) (* hexutil.Big , error ) {
10291034 feeParams , err := b .feeParameters .Get ()
10301035 if err != nil {
1031- return nil , err
1036+ b .logger .Warn ().Err (err ).Msg ("fee parameters unavailable; falling back to base gas price" )
1037+ return (* hexutil .Big )(b .config .GasPrice ), nil
10321038 }
1033-
10341039 gasPrice := feeParams .CalculateGasPrice (b .config .GasPrice )
10351040 return (* hexutil .Big )(gasPrice ), nil
10361041}
@@ -1075,9 +1080,9 @@ func (b *BlockChainAPI) GetUncleByBlockNumberAndIndex(
10751080func (b * BlockChainAPI ) MaxPriorityFeePerGas (ctx context.Context ) (* hexutil.Big , error ) {
10761081 feeParams , err := b .feeParameters .Get ()
10771082 if err != nil {
1078- return nil , err
1083+ b .logger .Warn ().Err (err ).Msg ("fee parameters unavailable; falling back to base gas price" )
1084+ return (* hexutil .Big )(b .config .GasPrice ), nil
10791085 }
1080-
10811086 gasPrice := feeParams .CalculateGasPrice (b .config .GasPrice )
10821087 return (* hexutil .Big )(gasPrice ), nil
10831088}
0 commit comments