Skip to content

Commit

Permalink
chore(taiko-client): improve proposer gas estimation (#18727)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jan 7, 2025
1 parent 640a712 commit 6aed5b3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/taiko-client/proposer/transaction_builder/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,18 @@ func (b *TxBuilderWithFallback) estimateCandidateCost(

gasFeeCap := new(big.Int).Add(baseFee, gasTipCap)
msg := ethereum.CallMsg{
From: txMgr.From(),
To: candidate.To,
Gas: candidate.GasLimit,
GasFeeCap: gasFeeCap,
GasTipCap: gasTipCap,
Value: candidate.Value,
Data: candidate.TxData,
From: txMgr.From(),
To: candidate.To,
Gas: candidate.GasLimit,
Value: candidate.Value,
Data: candidate.TxData,
}
if len(candidate.Blobs) != 0 {
var blobHashes []common.Hash
if _, blobHashes, err = txmgr.MakeSidecar(candidate.Blobs); err != nil {
return nil, fmt.Errorf("failed to make sidecar: %w", err)
}
msg.BlobHashes = blobHashes
msg.BlobGasFeeCap = blobBaseFee
}

gasUsed, err := b.rpc.L1.EstimateGas(ctx, msg)
Expand Down

0 comments on commit 6aed5b3

Please sign in to comment.