ava-labs / subnet-evm

Launch your own EVM as an Avalanche Subnet
https://docs.avax.network/subnets/create-a-fuji-subnet
GNU Lesser General Public License v3.0
243 stars 220 forks source link

Question on Warp precompiler contract. #1210

Closed shanb1605 closed 3 months ago

shanb1605 commented 3 months ago

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

shanb1605 commented 3 months ago

@ceyonur @darioush

darioush commented 3 months ago

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.