walnuthq / op-scan

Lightweight transaction explorer for the OP Stack.
7 stars 16 forks source link

Latest L1->L2 transactions #11

Closed saimeunt closed 1 day ago

saimeunt commented 1 week ago

Latest L1->L2 transactions

⚠️ Reading contributors guidelines to get assigned is MANDATORY!

Read contributors guidelines

User stories

Validation

At the moment, the frontend part is fully functional and fed with placeholder data in the accompanying util function fetchLatestL1L2Transactions in src/lib/utils.ts. You only need to implement this util function properly to return the same transactions displayed on Etherscan.

Image

Implementation

In the long run we'd like this data to be consumed from an indexer but we can build a functional POC to help us better understand how to retrieve the needed info from the blockchain. We will reuse this logic later when we build the indexer. My take on this is to fetch the logs from the latest 1000 blocks both on the L1 and L2 chain and perform a matching between the SentMessage/SentMessageExtension1 events emitted on L1 by L1CrossDomainMessenger and RelayedMessage emitted on L2 by L2CrossDomainMessenger. The contracts ABI and viem encapsulation is already available under src/lib/contracts. The correct way to perform the matching is to recompute the msgHash emitted in RelayedMessage from the arguments of SentMessage and SentMessageExtension1. Feel free to propose and implement an alternative method if you find something more simple and straightforward.

Resources

EjembiEmmanuel commented 1 week ago

@saimeunt I'd love to work on this. I'm an experienced frontend developer and have made contributions to several projects on OnlyDust. I can get it done in 2-3 working days. You can view my public profile at https://app.onlydust.com/u/EjembiEmmanuel.

melnikga commented 1 week ago

Hi, can I take this? I have been a contributor to several projects of the walnut team. My profile on onlydust: https://app.onlydust.com/u/melnikga

danielcdz commented 1 week ago

Hello, @saimeunt @mazurroman My name is Daniel Calderon I'm a software developer focused on backend and data development, in the last months I started to contribute through OnlyDust to multiple projects, here you have my OD Profile: https://app.onlydust.com/u/danielcdz, to solve this issue I will try the following:

saimeunt commented 1 week ago

@danielcdz Assigning it to you, good luck!

danielcdz commented 1 week ago

Thank you @saimeunt!