Skip to content

Commit

Permalink
fix(taiko-client): fix proposing fee estimation (#18702)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jan 3, 2025
1 parent dff1ef4 commit 13a5b1b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,12 @@ func (b *TxBuilderWithFallback) estimateCandidateCost(
}
log.Debug("Suggested gas price", "gasTipCap", gasTipCap, "baseFee", baseFee, "blobBaseFee", blobBaseFee)

gasPrice := new(big.Int).Add(baseFee, gasTipCap)
gasFeeCap := new(big.Int).Add(baseFee, gasTipCap)
gasUsed, err := b.rpc.L1.EstimateGas(ctx, ethereum.CallMsg{
From: txmgr.From(),
To: candidate.To,
Gas: candidate.GasLimit,
GasPrice: gasPrice,
GasFeeCap: gasPrice,
GasFeeCap: gasFeeCap,
GasTipCap: gasTipCap,
Value: candidate.Value,
Data: candidate.TxData,
Expand All @@ -165,7 +164,7 @@ func (b *TxBuilderWithFallback) estimateCandidateCost(
return nil, fmt.Errorf("failed to estimate gas used: %w", err)
}

feeWithoutBlob := new(big.Int).Mul(gasPrice, new(big.Int).SetUint64(gasUsed))
feeWithoutBlob := new(big.Int).Mul(gasFeeCap, new(big.Int).SetUint64(gasUsed))

// If its a type-2 transaction, we won't calculate blob fee.
if len(candidate.Blobs) == 0 {
Expand Down

0 comments on commit 13a5b1b

Please sign in to comment.