You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently experimenting with the AWM relayer + Teleporter on a local development network and I have trouble debugging message delivery on the destination chain as transactions fail.
My setup is the following:
Avalanche network
5 Avalanche nodes with BLS keys registered on a custom network running:
AvalancheGo v1.10.17
Subnet EVM v0.5.10
On Ubuntu 22.04
Note: I had to create a custom network to specify the signer config in the genesis file (as they are not in the genesis_local.json provided in AvalancheGo). Here is an example of the configuration of one node in the initialStakers list:
The BLS key file is uploaded on each node and specified through the staking-signer-key-file flag.
Subnets and chains
I created 2 Subnets on the network, each containing one Subnet EVM chain with the warp precompile enabled. Here is the genesis data used to create a chain (in YAML):
The TeleporterMessenger contract in v0.1.0 has been deployed to both EVM chains at 0x1b0505EaC728Efc30414ce0035BcC4DC5994a563.
I have an AWM relayer in v0.2.8 configured to forward the messages between both chains (bi-directional). Attaching the config file: relayer.json
Messaging smart contracts
To test the setup, I have deployed the MessageSender and MessageReceiver contracts (inspired by the Avalanche Academy Teleporter class):
pragma solidity0.8.18;
import"@teleporter/ITeleporterMessenger.sol";
/** * @dev ExampleCrossChainMessenger is an example contract that demonstrates how to send a messages cross chain. */contractMessageSender {
ITeleporterMessenger publicimmutable teleporterMessenger =ITeleporterMessenger(0x1b0505EaC728Efc30414ce0035BcC4DC5994a563);
/** * @dev Sends a message to another chain. */function sendMessage(
bytes32destinationBlockchainID,
addressdestinationAddress,
stringcalldatamessage
) externalreturns (uint256messageID) {
returnuint256(
teleporterMessenger.sendCrossChainMessage(
TeleporterMessageInput({
destinationBlockchainID: destinationBlockchainID,
destinationAddress: destinationAddress,
feeInfo: TeleporterFeeInfo({
feeTokenAddress: address(0),
amount: 0
}),
requiredGasLimit: 100000,
allowedRelayerAddresses: newaddress[](0),
message: abi.encode(message)
})
)
);
}
}
pragma solidity0.8.18;
import"@teleporter/ITeleporterMessenger.sol";
import"@teleporter/ITeleporterReceiver.sol";
/** * @dev ExampleCrossChainMessenger is an example contract that demonstrates how to send and receive * messages cross chain. */contractMessageReceiverisITeleporterReceiver {
ITeleporterMessenger publicimmutable teleporterMessenger =ITeleporterMessenger(0x1b0505EaC728Efc30414ce0035BcC4DC5994a563);
stringpublic lastMessage;
// Errorserror Unauthorized();
/** * @dev See {ITeleporterReceiver-receiveTeleporterMessage}. * * Receives a message from another chain. */function receiveTeleporterMessage(
bytes32sourceBlockchainID,
addressoriginSenderAddress,
bytescalldatamessage
) externaloverride {
// Only the Teleporter receiver can deliver a message.if (msg.sender!=address(teleporterMessenger)) {
revertUnauthorized();
}
// Store the message.
lastMessage =abi.decode(message, (string));
}
}
Sending messages fails
Using this setup, I can generate (send) a Warp message from the first chain using Foundry:
The transaction is successful (id 0x545776beec10d8a7aaf3cec5ea84da937fb25df7e0c70b3558a0bcf4547cb44e) and picked up by the relayer as seen in the relayer logs:
When I tried to query the MessageReceiver on the destination chain, I saw that the stored message was unchanged. And looking at the transaction receipt on the destination chain, I see that it is in status 0 = failed:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context
I am currently experimenting with the AWM relayer + Teleporter on a local development network and I have trouble debugging message delivery on the destination chain as transactions fail.
My setup is the following:
Avalanche network
5 Avalanche nodes with BLS keys registered on a custom network running:
v1.10.17
v0.5.10
22.04
Note: I had to create a custom network to specify the
signer
config in the genesis file (as they are not in thegenesis_local.json
provided in AvalancheGo). Here is an example of the configuration of one node in theinitialStakers
list:The BLS key file is uploaded on each node and specified through the
staking-signer-key-file
flag.Subnets and chains
I created 2 Subnets on the network, each containing one Subnet EVM chain with the warp precompile enabled. Here is the genesis data used to create a chain (in YAML):
I can see that the precompile is well-activated through
eth_getActivePrecompilesAt
:Teleporter & AWM relayer
The
TeleporterMessenger
contract inv0.1.0
has been deployed to both EVM chains at0x1b0505EaC728Efc30414ce0035BcC4DC5994a563
.I have an AWM relayer in
v0.2.8
configured to forward the messages between both chains (bi-directional). Attaching the config file: relayer.jsonMessaging smart contracts
To test the setup, I have deployed the
MessageSender
andMessageReceiver
contracts (inspired by the Avalanche Academy Teleporter class):Sending messages fails
Using this setup, I can generate (send) a Warp message from the first chain using Foundry:
The transaction is successful (id
0x545776beec10d8a7aaf3cec5ea84da937fb25df7e0c70b3558a0bcf4547cb44e
) and picked up by the relayer as seen in the relayer logs:After that, the relayer successfully aggregates signatures and submits a transaction on the destination chain:
Attaching the full log file: awm-relayer.log
When I tried to query the
MessageReceiver
on the destination chain, I saw that the stored message was unchanged. And looking at the transaction receipt on the destination chain, I see that it is in status0
= failed:Question: How can I debug the message delivery on the destination chain further?
From here, I don't really know where to look to understand why the transaction failed and how to fix the issue.
Beta Was this translation helpful? Give feedback.
All reactions