diff --git a/.github/workflows/relayer.yml b/.github/workflows/relayer.yml index 8bf582e8fab..6252c9a5408 100644 --- a/.github/workflows/relayer.yml +++ b/.github/workflows/relayer.yml @@ -61,6 +61,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} - name: Login to GCR uses: docker/login-action@v2 diff --git a/packages/relayer/processor/estimate_gas.go b/packages/relayer/processor/estimate_gas.go index f5bf9793a14..7542d6603e6 100644 --- a/packages/relayer/processor/estimate_gas.go +++ b/packages/relayer/processor/estimate_gas.go @@ -2,6 +2,7 @@ package processor import ( "context" + "log/slog" "math/big" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -9,6 +10,10 @@ import ( "github.com/taikoxyz/taiko-mono/packages/relayer/bindings/bridge" ) +var ( + gasPaddingAmt uint64 = 80000 +) + func (p *Processor) estimateGas( ctx context.Context, message bridge.IBridgeMessage, proof []byte) (uint64, *big.Int, error) { auth, err := bind.NewKeyedTransactorWithChainID(p.ecdsaKey, message.DestChainId) @@ -26,5 +31,7 @@ func (p *Processor) estimateGas( return 0, nil, errors.Wrap(err, "p.destBridge.ProcessMessage") } - return tx.Gas(), tx.Cost(), nil + slog.Info("estimated gas", "gas", tx.Gas(), "paddingAmt", gasPaddingAmt) + + return tx.Gas() + gasPaddingAmt, tx.Cost(), nil } diff --git a/packages/relayer/processor/process_message.go b/packages/relayer/processor/process_message.go index 48a322cd6c6..c5ea370a860 100644 --- a/packages/relayer/processor/process_message.go +++ b/packages/relayer/processor/process_message.go @@ -251,6 +251,8 @@ func (p *Processor) sendProcessMessageCall( if err != nil { return nil, errors.Wrap(err, "p.hardcodeGasLimit") } + } else { + auth.GasLimit = gas } }