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 indexer/processor separation and refactor, messaging queue #14605

Merged
merged 101 commits into from
Sep 6, 2023

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented Aug 30, 2023

Closes #14528

this PR updates the relayer codebase to be inline with the taiko-client architecture, which should make it easier to onboard new people, as well as cross-share work more - once they get familiar with one codebase, they are familiar with all of our Golang applications.

It splits the relayer into two separate apps, the indexer and the processor, that now communicate asynchronosly through a Queue interface, the first implementation of which is a RabbitMQ queue (attached picture, processor is on the left reading from the queue, indexer is on the right listenign to the blockchain and adding to the queue).

This has three main advantages:

  1. The indexer will be caught up to the tip of the chain much quicker, allowing the bridge-ui to be up-to-date.
  2. The persistence of the queue will allow us to more reliably know which messages have been processed, how many behind we are, and which ones failed to be processed.
  3. We can spin up as many additional processors as we want, without affecting the indexing, if we see many messages coming in that one processor can not handle.

The main difference is all of the CLI args of the relayer can still be passed in through Environment Variables as well, for easier deployment/configuration.

Latest code is already deployed (matching k8s-config PR is open) to internal-devnet for L1-L2, L2-L1, L2-L3, L3-L2, as well as a RabbitMQ statefulset.

TODO:

  • tests for optional flag vars, current only tests requirred (can come in another PR, perhaps a task roger can do to get familiar with this Go codebase as well)
    Screenshot from 2023-08-31 12-20-06

@vercel
Copy link

vercel bot commented Aug 30, 2023

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

Name Status Preview Comments Updated (UTC)
bridge-ui-v2-internal ❌ Failed (Inspect) Sep 5, 2023 4:02pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
bridge-ui-v2 ⬜️ Ignored (Inspect) Visit Preview Sep 5, 2023 4:02pm

@dantaik
Copy link
Contributor

dantaik commented Aug 30, 2023

@cyberhorsey does this PR address this issue ?

@cyberhorsey
Copy link
Contributor Author

@cyberhorsey does this PR address this issue ?

Yes, but it's only started today and will be maybe two more days.

@dantaik dantaik requested review from KorbinianK and xiaodino and removed request for dionysuzx and RogerLamTd September 6, 2023 07:43
@davidtaikocha davidtaikocha added this pull request to the merge queue Sep 6, 2023
Merged via the queue into main with commit 15b0e50 Sep 6, 2023
@davidtaikocha davidtaikocha deleted the relayer_indexer_separation branch September 6, 2023 08:02
@github-actions github-actions bot mentioned this pull request Sep 6, 2023
2manslkh pushed a commit that referenced this pull request Sep 14, 2023
…saging queue (#14605)

Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com>
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.

feat(relayer): bridge relayer messaging queue
4 participants