juno
juno copied to clipboard
RPC08 - starknet_getMessagesStatus
https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/#l1-l2-messages
see: https://github.com/eqlabs/pathfinder/issues/2182
Solution:
- Listen to LogMessageToL2 logs from the core contract on L1. Compute the associated message hash, and store the eth transaction hash. Note that a single L1 transaction can induce multiple messages.
Populate db with:
map[eth transaction hash][]message hash - When syncing L2. Compute the message hash for l1 handler transactions.
Populate db with:
map[message hash]l1_handler_transaction_hash
Overall this allows us to map eth_txn_hash to l1_handler_txn_hash, which we can then serve over RPC.