From 0a1da2965d047094c4c2aef4dbe7fca69b96e651 Mon Sep 17 00:00:00 2001 From: Matthew Lam Date: Fri, 31 May 2024 14:49:13 -0400 Subject: [PATCH] update relayer gas estimate --- go.mod | 4 ++-- go.sum | 8 ++++---- messages/teleporter/message_manager.go | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index fa32849c..e4384490 100644 --- a/go.mod +++ b/go.mod @@ -7,12 +7,12 @@ require ( github.com/ava-labs/avalanchego v1.11.1 github.com/ava-labs/coreth v0.13.0-rc.0 github.com/ava-labs/subnet-evm v0.6.1 - github.com/ava-labs/teleporter v1.0.0 + github.com/ava-labs/teleporter v1.0.1 github.com/aws/aws-sdk-go-v2 v1.26.1 github.com/aws/aws-sdk-go-v2/config v1.27.9 github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 github.com/ethereum/go-ethereum v1.12.0 - github.com/onsi/ginkgo/v2 v2.18.0 + github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.19.1 diff --git a/go.sum b/go.sum index cc9d35b3..bacbc5f1 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/ava-labs/coreth v0.13.0-rc.0 h1:V2l3qj2ek3geKDJAnF2M94mYJK8kg2kePixuj github.com/ava-labs/coreth v0.13.0-rc.0/go.mod h1:eUMbBLDhlZASJjcbf0gIcD2GMn2rRRCUxC8MXLt5QQk= github.com/ava-labs/subnet-evm v0.6.1 h1:NyknPPWBKGN9VIwfKi1+oR6NpvephiNkWEwzjGcNLkA= github.com/ava-labs/subnet-evm v0.6.1/go.mod h1:PRwf9C3KgXzrANnrCvKa/gQVvIBomKzQgZM2ucECGYE= -github.com/ava-labs/teleporter v1.0.0 h1:io209qZh3SDpwLre0oStMzOFRcPvOrmMQuLq5OFvzJo= -github.com/ava-labs/teleporter v1.0.0/go.mod h1:4Wyz/5sZDHMaaLegh2ULyrAOWnyaBk6upTmbwSrVSMs= +github.com/ava-labs/teleporter v1.0.1 h1:86bwwZCCb1lsvAqCYeT8jHvzkDRIsXmw1s63VtbCnAE= +github.com/ava-labs/teleporter v1.0.1/go.mod h1:IyxFT32sIQ/5Y5x9LrYoOUldC/VFbHS8JZTAEg6aTCw= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.9 h1:gRx/NwpNEFSk+yQlgmk1bmxxvQ5TyJ76CWXs9XScTqg= @@ -490,8 +490,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.18.0 h1:W9Y7IWXxPUpAit9ieMOLI7PJZGaW22DTKgiVAuhDTLc= -github.com/onsi/ginkgo/v2 v2.18.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= diff --git a/messages/teleporter/message_manager.go b/messages/teleporter/message_manager.go index de4e2020..35c286e8 100644 --- a/messages/teleporter/message_manager.go +++ b/messages/teleporter/message_manager.go @@ -222,10 +222,16 @@ func (m *messageManager) SendMessage(signedMessage *warp.Message, destinationBlo ) return err } - gasLimit, err := gasUtils.CalculateReceiveMessageGasLimit(numSigners, teleporterMessage.RequiredGasLimit) + gasLimit, err := gasUtils.CalculateReceiveMessageGasLimit( + numSigners, + teleporterMessage.RequiredGasLimit, + len(signedMessage.Bytes()), + len(signedMessage.Payload), + len(teleporterMessage.Receipts), + ) if err != nil { m.logger.Error( - "Gas limit required overflowed uint64 max. not relaying message", + "Failed to calculate gas limit for receiveCrossChainMessage call", zap.String("destinationBlockchainID", destinationBlockchainID.String()), zap.String("warpMessageID", signedMessage.ID().String()), zap.String("teleporterMessageID", teleporterMessageID.String()),