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

feat(relayer): Relayer multihop #15000

Merged
merged 18 commits into from
Oct 23, 2023
Merged

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented Oct 20, 2023

This Pr adds functionality for multihop relayer bridge processing.

Main functionality:

  • Waits for headers to sync between the source chain, all intermediary hop chains, and finally, the last hop chain to the destination chain, so all the proofs will be valid when calling bridge.proveMessageReceived.
  • Generate the main proof
  • If hops exist, generate the hop proofs, using the previous signalroot of the previous hop proof as the storage slot.
  • Encode the new Signalproof with hops and submit.

TODO in future PR:

  • Need to index CrossChainSynced events for source, all hops, and destination, so I can easily query when a block hash was synced, to make sure we wait for that header to be synced instead of "latest". on L1 to L3 it wont slow down anything too much, just a few blocks, becasue they sync in anchor tx. for L2 to L2 it will slow things down right now.

Example of L1-L3 hop on interval devnet processed: https://l3blockscoutapi.internal.taiko.xyz/tx/0x66fe2932d700b400df578614e7646c5a5e33cd13126ccf5166326a367e034ce5

@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bridge-ui-v2-a5 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2023 9:14am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
bridge-ui-v2-internal ⬜️ Ignored (Inspect) Visit Preview Oct 23, 2023 9:14am

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

❗ No coverage uploaded for pull request base (contestable-zkrollup@8ba512b). Click here to learn what that means.
The diff coverage is n/a.

@@                   Coverage Diff                   @@
##             contestable-zkrollup   #15000   +/-   ##
=======================================================
  Coverage                        ?   27.69%           
=======================================================
  Files                           ?       76           
  Lines                           ?     4784           
  Branches                        ?        0           
=======================================================
  Hits                            ?     1325           
  Misses                          ?     3314           
  Partials                        ?      145           
Flag Coverage Δ *Carryforward flag
eventindexer 18.30% <0.00%> (?) Carriedforward from a228acc
relayer 40.32% <0.00%> (?)

*This pull request uses carry forward flags. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dantaik
Copy link
Contributor

dantaik commented Oct 22, 2023

@cyberhorsey I notice there is an example TX, which is great, I was wondering if it works... :D

@cyberhorsey
Copy link
Contributor Author

@cyberhorsey I notice there is an example TX, which is great, I was wondering if it works... :D

yep, I have ran it L1 to L3, but not L2 to L2 yet, or anything with more than a single hop (L1 to L4, etc). theoretically it should work since it's configured to support an arbitrary number of hops that should be encoded the same way the contract expects.

packages/relayer/cmd/flags/processor.go Outdated Show resolved Hide resolved
packages/relayer/proof/encoded_signal_proof.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants