Skip to content

Commit

Permalink
Merge pull request #310 from ava-labs/gas-updates
Browse files Browse the repository at this point in the history
update relayer gas estimate
  • Loading branch information
minghinmatthewlam authored May 31, 2024
2 parents 8a6775c + 4c44249 commit 8109650
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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.27.0
github.com/aws/aws-sdk-go-v2/config v1.27.9
github.com/aws/aws-sdk-go-v2/service/kms v1.32.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo=
github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
github.com/aws/aws-sdk-go-v2/config v1.27.9 h1:gRx/NwpNEFSk+yQlgmk1bmxxvQ5TyJ76CWXs9XScTqg=
Expand Down
10 changes: 8 additions & 2 deletions messages/teleporter/message_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 8109650

Please sign in to comment.