juno icon indicating copy to clipboard operation
juno copied to clipboard

RPC08 - starknet_getMessagesStatus

Open rianhughes opened this issue 1 year ago • 1 comments

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:

  1. 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
  2. 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.

rianhughes avatar Sep 25 '24 11:09 rianhughes