Skip to content

Commit

Permalink
fix(relayer): fix for profitable detection (#18134)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey authored Sep 18, 2024
1 parent 8812eb2 commit c2f59c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/relayer/processor/is_profitable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion packages/relayer/processor/is_profitable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Test_isProfitable(t *testing.T) {
{
1,
"profitable",
600000000600001,
7000000000600001,
600000,
1000000000,
1,
Expand Down

0 comments on commit c2f59c3

Please sign in to comment.