From 098692dc3e335a0efed0b430535b5102b858ab88 Mon Sep 17 00:00:00 2001 From: mpetrun5 Date: Wed, 18 Sep 2024 14:30:22 +0200 Subject: [PATCH] fix: add generic call gas limit buffer --- chains/evm/executor/executor.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chains/evm/executor/executor.go b/chains/evm/executor/executor.go index 6b283454..26a1982b 100644 --- a/chains/evm/executor/executor.go +++ b/chains/evm/executor/executor.go @@ -25,7 +25,10 @@ import ( "github.com/sygmaprotocol/sygma-core/relayer/proposal" ) -const TRANSFER_GAS_COST = 200000 +const ( + TRANSFER_GAS_COST uint64 = 200000 + GENERIC_CALL_COST uint64 = 100000 +) type Batch struct { proposals []*transfer.TransferProposal @@ -212,9 +215,9 @@ func (e *Executor) proposalBatches(proposals []*proposal.Proposal) ([]*Batch, er var propGasLimit uint64 l, ok := transferProposal.Data.Metadata["gasLimit"] if ok { - propGasLimit = l.(uint64) + propGasLimit = l.(uint64) + GENERIC_CALL_COST } else { - propGasLimit = uint64(TRANSFER_GAS_COST) + propGasLimit = TRANSFER_GAS_COST } currentBatch.gasLimit += propGasLimit if currentBatch.gasLimit >= e.transactionMaxGas {