From 256f637cc81d0b29f2e9c28dec01c524e67a7908 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:26:01 -0700 Subject: [PATCH] fix(relayer): fix for profitable detection (#18134) --- packages/relayer/processor/is_profitable.go | 4 ++-- packages/relayer/processor/is_profitable_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/relayer/processor/is_profitable.go b/packages/relayer/processor/is_profitable.go index 8ce2436b39f..f4081a88220 100644 --- a/packages/relayer/processor/is_profitable.go +++ b/packages/relayer/processor/is_profitable.go @@ -35,9 +35,9 @@ func (p *Processor) isProfitable( return shouldProcess, errImpossible } - // if processing fee is higher than baseFee * gasLimit, + // if processing fee is higher than baseFee * 2 +gasTipCap + gasLimit, // we should process. - estimatedOnchainFee := (destChainBaseFee + gasTipCap) * uint64(gasLimit) + estimatedOnchainFee := ((destChainBaseFee * 2) + gasTipCap) * uint64(gasLimit) if fee > estimatedOnchainFee { shouldProcess = true } diff --git a/packages/relayer/processor/is_profitable_test.go b/packages/relayer/processor/is_profitable_test.go index 85df082a860..f4e942999ba 100644 --- a/packages/relayer/processor/is_profitable_test.go +++ b/packages/relayer/processor/is_profitable_test.go @@ -33,7 +33,7 @@ func Test_isProfitable(t *testing.T) { { 1, "profitable", - 600000000600001, + 7000000000600001, 600000, 1000000000, 1,