Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC08 - starknet_getMessagesStatus #2178

Open
rianhughes opened this issue Sep 25, 2024 · 1 comment · May be fixed by #2184
Open

RPC08 - starknet_getMessagesStatus #2178

rianhughes opened this issue Sep 25, 2024 · 1 comment · May be fixed by #2184
Assignees
Labels

Comments

@rianhughes
Copy link
Contributor

rianhughes commented Sep 25, 2024

starknet_getMessagesStatus

https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/#l1-l2-messages

see: eqlabs/pathfinder#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 rianhughes self-assigned this Sep 25, 2024
@rianhughes rianhughes mentioned this issue Sep 25, 2024
15 tasks
@rianhughes
Copy link
Contributor Author

rianhughes commented Sep 25, 2024

L1 message (not transaction) hash is computed as

keccak256(
    abi.encodePacked(
        uint256(FromAddress),
        ToAddress,
        Nonce,
        Selector,
        Payload.length,
        Payload
    )
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants