Skip to content

Commit

Permalink
feat: calculate gas based on proposal count (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 authored Jul 18, 2023
1 parent 25e445d commit 3da4977
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions chains/evm/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/ChainSafe/sygma-relayer/tss/signing"
)

const TRANSFER_GAS_COST = 200000

var (
executionCheckPeriod = time.Minute
signingTimeout = 30 * time.Minute
Expand Down Expand Up @@ -189,6 +191,8 @@ func (e *Executor) executeProposal(proposals []*chains.Proposal, signatureData *
l, ok := proposals[0].Metadata.Data["gasLimit"]
if ok {
gasLimit = l.(uint64)
} else {
gasLimit = uint64(TRANSFER_GAS_COST * len(proposals))
}

hash, err := e.bridge.ExecuteProposals(proposals, sig, transactor.TransactOptions{
Expand Down
2 changes: 1 addition & 1 deletion jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func StartCommunicationHealthCheckJob(h host.Host, interval time.Duration, metri
healthComm := p2p.NewCommunication(h, "p2p/health")
for {
time.Sleep(interval)
log.Info().Msg("Starting communication health check")
log.Debug().Msg("Starting communication health check")

all := h.Peerstore().Peers()
unavailable := make(peer.IDSlice, 0)
Expand Down

0 comments on commit 3da4977

Please sign in to comment.