From f1f8fdd20cf10e54ba851e0c7a017169cceb1173 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 19 Sep 2023 13:40:45 -0700 Subject: [PATCH 1/5] pad gas --- packages/relayer/processor/estimate_gas.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/relayer/processor/estimate_gas.go b/packages/relayer/processor/estimate_gas.go index f5bf9793a14..64230e85ebf 100644 --- a/packages/relayer/processor/estimate_gas.go +++ b/packages/relayer/processor/estimate_gas.go @@ -9,6 +9,10 @@ import ( "github.com/taikoxyz/taiko-mono/packages/relayer/bindings/bridge" ) +var ( + gasPaddingAmt uint64 = 50000 +) + 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 +30,5 @@ func (p *Processor) estimateGas( return 0, nil, errors.Wrap(err, "p.destBridge.ProcessMessage") } - return tx.Gas(), tx.Cost(), nil + return tx.Gas() + gasPaddingAmt, tx.Cost(), nil } From 897d261beeb6ed803bb2269ec7fa9130573f6383 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 19 Sep 2023 13:40:52 -0700 Subject: [PATCH 2/5] pad gas --- packages/relayer/processor/estimate_gas.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/relayer/processor/estimate_gas.go b/packages/relayer/processor/estimate_gas.go index 64230e85ebf..2a2b0bf039e 100644 --- a/packages/relayer/processor/estimate_gas.go +++ b/packages/relayer/processor/estimate_gas.go @@ -10,7 +10,7 @@ import ( ) var ( - gasPaddingAmt uint64 = 50000 + gasPaddingAmt uint64 = 80000 ) func (p *Processor) estimateGas( From 3e4de2d07f0c6f78cfc7bedb8cc3419d36413389 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 19 Sep 2023 13:51:59 -0700 Subject: [PATCH 3/5] log --- packages/relayer/processor/estimate_gas.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/relayer/processor/estimate_gas.go b/packages/relayer/processor/estimate_gas.go index 2a2b0bf039e..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" @@ -30,5 +31,7 @@ func (p *Processor) estimateGas( return 0, nil, errors.Wrap(err, "p.destBridge.ProcessMessage") } + slog.Info("estimated gas", "gas", tx.Gas(), "paddingAmt", gasPaddingAmt) + return tx.Gas() + gasPaddingAmt, tx.Cost(), nil } From c3895d7c653d6296fd32091b1f30779333f7fce2 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 19 Sep 2023 13:53:46 -0700 Subject: [PATCH 4/5] build branch --- .github/workflows/relayer.yml | 2 ++ 1 file changed, 2 insertions(+) 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 From a9baf367c779592eaf3fd88139bb3e8060ea0803 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Tue, 19 Sep 2023 14:01:02 -0700 Subject: [PATCH 5/5] . --- packages/relayer/processor/process_message.go | 2 ++ 1 file changed, 2 insertions(+) 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 } }