-
Notifications
You must be signed in to change notification settings - Fork 22
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
Latest L1->L2 transactions #11
Comments
@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. |
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 |
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:
|
@danielcdz Assigning it to you, good luck! |
Thank you @saimeunt! |
Latest L1->L2 transactions
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
insrc/lib/utils.ts
.You only need to implement this util function properly to return the same transactions displayed on Etherscan.
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 byL1CrossDomainMessenger
andRelayedMessage
emitted on L2 byL2CrossDomainMessenger
.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 inRelayedMessage
from the arguments ofSentMessage
andSentMessageExtension1
.Feel free to propose and implement an alternative method if you find something more simple and straightforward.
Resources
L1CrossDomainMessenger
on Etherscan: https://etherscan.io/address/0x25ace71c97b33cc4729cf772ae268934f7ab5fa1L2CrossDomainMessenger
on Etherscan: https://optimistic.etherscan.io/address/0x4200000000000000000000000000000000000007SentMessage
andSentMessageExtension1
emitted here: https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/CrossDomainMessenger.sol#L194-L195RelayedMessage
emitted here: https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/CrossDomainMessenger.sol#L295msgHash
computed here: https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/libraries/Hashing.sol#L100The text was updated successfully, but these errors were encountered: