Skip to content

Commit

Permalink
fix: add generic call gas limit buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Sep 18, 2024
1 parent 8164d7e commit 098692d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chains/evm/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 098692d

Please sign in to comment.