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: use multiple RPCs for relayer #527

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

aloknerurkar
Copy link
Collaborator

@aloknerurkar aloknerurkar commented Dec 9, 2024

Describe your changes

Use multiple RPC URLs for bridge for failover incase one of them is down.

Issue ticket number and link

Fixes # (issue)

Checklist before requesting a review

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@@ -100,7 +100,7 @@ func NewNode(opts *Options) (*Node, error) {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()

client, err := ethclient.DialContext(ctx, opts.L1RPCURL)
client, err := ethclient.DialContext(ctx, opts.L1RPCURLs[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point to submit an array, if we just take the first value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we assume, that first one will work and in wrapped client use the array

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, technically all work. If the first one doesnt work, we will fail in the initialization itself. This is mostly needed if we get rate-limited or if the RPC is down at some later point.

For the initial call we only do it to get the chain-id. We dont configure it in the CLI.

@aloknerurkar aloknerurkar force-pushed the relayer-multiple-rpcs branch from 2771836 to 3297f29 Compare December 9, 2024 22:11
@aloknerurkar aloknerurkar merged commit b7a79a4 into main Dec 10, 2024
5 checks passed
@aloknerurkar aloknerurkar deleted the relayer-multiple-rpcs branch December 10, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants