diff --git a/messages/teleporter/message_handler.go b/messages/teleporter/message_handler.go index 434d0546..8a3f8ea3 100644 --- a/messages/teleporter/message_handler.go +++ b/messages/teleporter/message_handler.go @@ -163,15 +163,15 @@ func (m *messageHandler) ShouldSendMessage(destinationClient vms.DestinationClie return false, fmt.Errorf("failed to calculate Teleporter message ID: %w", err) } requiredGasLimit := m.teleporterMessage.RequiredGasLimit.Uint64() - maxGasLimit := destinationClient.BlockGasLimit() + destBlockGasLimit := destinationClient.BlockGasLimit() // Check if the specified gas limit is below the maximum threshold - if requiredGasLimit > maxGasLimit { + if requiredGasLimit > destBlockGasLimit { m.logger.Info( "Gas limit exceeds maximum threshold", zap.String("destinationBlockchainID", destinationBlockchainID.String()), zap.String("teleporterMessageID", teleporterMessageID.String()), zap.Uint64("requiredGasLimit", m.teleporterMessage.RequiredGasLimit.Uint64()), - zap.Uint64("maxGasLimit", maxGasLimit), + zap.Uint64("blockGasLimit", destBlockGasLimit), ) return false, nil } diff --git a/messages/teleporter/message_handler_test.go b/messages/teleporter/message_handler_test.go index fd7b0208..f0df869b 100644 --- a/messages/teleporter/message_handler_test.go +++ b/messages/teleporter/message_handler_test.go @@ -233,6 +233,7 @@ func TestShouldSendMessage(t *testing.T) { SenderAddress(). Return(test.senderAddressResult). Times(test.senderAddressTimes) + mockClient.EXPECT().BlockGasLimit().Return(uint64(config.DefaultBlockGasLimit)).AnyTimes() mockClient.EXPECT().DestinationBlockchainID().Return(destinationBlockchainID).AnyTimes() if test.messageReceivedCall != nil { messageReceivedInput := interfaces.CallMsg{ diff --git a/relayer/config/destination_blockchain.go b/relayer/config/destination_blockchain.go index 3e2c5418..c5e68e03 100644 --- a/relayer/config/destination_blockchain.go +++ b/relayer/config/destination_blockchain.go @@ -14,7 +14,7 @@ import ( ) const ( - // The maximum gas limit that can be specified for a Teleporter message + // The block gas limit that can be specified for a Teleporter message // Based on the C-Chain 15_000_000 gas limit per block, with other Warp message gas overhead conservatively estimated. DefaultBlockGasLimit = 12_000_000 ) @@ -29,7 +29,7 @@ type DestinationBlockchain struct { KMSKeyID string `mapstructure:"kms-key-id" json:"kms-key-id"` KMSAWSRegion string `mapstructure:"kms-aws-region" json:"kms-aws-region"` AccountPrivateKey string `mapstructure:"account-private-key" json:"account-private-key"` - BlockGasLimit uint64 `mapstructure:"teleporter-max-gas-limit" json:"teleporter-max-gas-limit"` + BlockGasLimit uint64 `mapstructure:"block-gas-limit" json:"block-gas-limit"` // Fetched from the chain after startup warpConfig WarpConfig @@ -80,7 +80,7 @@ func (s *DestinationBlockchain) Validate() error { if s.subnetID == constants.PrimaryNetworkID && s.BlockGasLimit > DefaultBlockGasLimit { - return fmt.Errorf("C-Chain max-gas-limit '%d' exceeded", s.BlockGasLimit) + return fmt.Errorf("C-Chain block-gas-limit '%d' exceeded", s.BlockGasLimit) } return nil