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

Use connectivity store to manage connections to endpoints #1603

Closed
clangenb opened this issue Dec 9, 2023 · 4 comments · Fixed by #1693
Closed

Use connectivity store to manage connections to endpoints #1603

clangenb opened this issue Dec 9, 2023 · 4 comments · Fixed by #1693
Assignees
Labels
enhancement New feature or request

Comments

@clangenb
Copy link
Member

clangenb commented Dec 9, 2023

We have already several issues regarding fail over connections to endpoints, or tracking block production of our chain, I would like to aggregate those issues here, and formulate an idea for tackling these. I found the currently unused connectivity_store implemented by @azackmatoff. While it doesn't fulfil the all the specs, I believe that this approach is what we want.

Connectivity Store Specs:

  • Needs to know all RPC nodes of a network
  • Needs to track block production of the nodes and return a bestEndpoint which is the one with the highest best block number. This endpoint is used for all networking.
  • In case the bestEndpoint changes, it handles resubscription of all websocket subscriptions.
  • Needs to identify block production issues, aka if all nodes stop producing blocks
  • Needs to know when the app/phone itself is offline

Maybe specs:

  • Handle the extrinsic queue
@clangenb
Copy link
Member Author

@brenzi other specs?

@brenzi
Copy link
Member

brenzi commented Dec 14, 2023

I think the extrinsic queue is a separate concern, shouldn't mix.

Do we need to test rpc endpoints to see if indexing is enabled? Or do we assume hardcoding good endpoints only?

Is the set dynamic? Can the user change the endpoint set manually?

@brenzi
Copy link
Member

brenzi commented Dec 14, 2023

I might suggest randomizing the updated endpoints instead of finding the BEST one and direct all traffic there by this choice

@clangenb
Copy link
Member Author

clangenb commented Dec 15, 2023

I think the extrinsic queue is a separate concern, shouldn't mix.

I think so too.

Do we need to test rpc endpoints to see if indexing is enabled? Or do we assume hardcoding good endpoints only?

I think we should hardcode in the beginning, as it is simpler. Yes, I think we should only use endpoints that have offchain indexing enabled. Good point.

Is the set dynamic? Can the user change the endpoint set manually?

I think we should not be dynamic in the beginning. User can choose IMO, but this is also an extension.

I might suggest randomizing the updated endpoints instead of finding the BEST one and direct all traffic there by this choice

This is a good idea, although I would rather do: randomize "good" endpoints, good implying that they are producing blocks and are within close range of the bestHeader number known by the store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants