ava-labs/subnet-evm

Question on Warp precompiler contract.

Closed this issue · 2 comments

Hey, warp devs! I just need to know the further information on warp precompiler design.

I'm assuming this is the latest deployment of TeleporterMessenger => 0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf

The TeleporterMessenger::receiveCrossChainMessage() fetches warp message with messageIndex. The warp precompiles contract returns the verified message for the given messageIndex

Now the question is why index 0 is always used. you can see the last Tx on TeleporterMesssenger => https://snowtrace.io/tx/0xb3eb4eeca296106562dcd485863b722566c4185fae8731210a19c5c8bb71d43f?chainId=62707

  • Does messageIndex = 0 the default index number for storing all messages or does it vary for other contracts that interact with Warp precompiler contract?

Both warp and teleporter, which builds on warp, support dealing with multiple messages per transaction. Each transaction must name the warp messages it wants to interact with in its access list, then it can refer to those warp messages passing a 0 based index to the precompile (in the order it is specified).

Currently implemented relayers only deliver one warp message per transaction, which is why the index is observed as 0.