eqlabs / pathfinder

A Starknet full node written in Rust
https://eqlabs.github.io/pathfinder/
Other
631 stars 234 forks source link

JSON-RPC 0.8.0: `starknet_getMessagesStatus` method #2182

Closed kkovaacs closed 1 week ago

kkovaacs commented 2 months ago

To add support for the starknet_getMessagesStatus method (https://github.com/starkware-libs/starknet-specs/pull/223) we'd need to revamp our Ethereum client. We need access to events, both for getting historical stuff and ideally a Websocket subscription too so that we don't have to poll.

I've done some research using alloy and its API seems to be OK: https://github.com/eqlabs/pathfinder/compare/main...krisztian/poc-associate-l1-tx-with-l2-tx

The idea is that using alloy we would fetch the relevant Ethereum logs from the Starknet core contract and store the Ethereum tx hash -> message association in our database (maybe using the message hash?). We would then use that association when syncing L1 handler transactions to store the Starknet transaction hash associated with the Ethereum transaction hash.