Commit 22513b5f authored by Mark Tyneway's avatar Mark Tyneway

op-batcher: use default 2gwei instead of error

parent bd6acdc7
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
) )
const networkTimeout = 2 * time.Second // How long a single network request can take. TODO: put in a config somewhere const networkTimeout = 2 * time.Second // How long a single network request can take. TODO: put in a config somewhere
...@@ -74,10 +75,15 @@ func (t *TransactionManager) calcGasTipAndFeeCap(ctx context.Context) (gasTipCap ...@@ -74,10 +75,15 @@ func (t *TransactionManager) calcGasTipAndFeeCap(ctx context.Context) (gasTipCap
childCtx, cancel := context.WithTimeout(ctx, networkTimeout) childCtx, cancel := context.WithTimeout(ctx, networkTimeout)
gasTipCap, err = t.l1Client.SuggestGasTipCap(childCtx) gasTipCap, err = t.l1Client.SuggestGasTipCap(childCtx)
cancel() cancel()
if err != nil || gasTipCap == nil { if err != nil {
return nil, nil, fmt.Errorf("failed to get suggested gas tip cap: %w", err) return nil, nil, fmt.Errorf("failed to get suggested gas tip cap: %w", err)
} }
if gasTipCap == nil {
t.log.Warn("unexpected unset gasTipCap, using default 2 gwei")
gasTipCap = new(big.Int).SetUint64(params.GWei * 2)
}
childCtx, cancel = context.WithTimeout(ctx, networkTimeout) childCtx, cancel = context.WithTimeout(ctx, networkTimeout)
head, err := t.l1Client.HeaderByNumber(childCtx, nil) head, err := t.l1Client.HeaderByNumber(childCtx, nil)
cancel() cancel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment