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

Tendermint34Client maxAge #1394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

codehans
Copy link
Contributor

On the Kujira dapps we use a community sourced set of RPC clients to provide chain connections for users, in order to promote redundancy and decentralisation. We use a Promise.any approach to selecting an RPC provider when a UI initialises, in order to pick one with low latency to the user. Sometimes some of these clients fall behind yet still have a fast response time, particularly when you're accessing from a geographically underserved location. This results in stale data, account sequence mismatches, etc.

This PR adds an optional maxAge parameter to the connect function of Tendermint34Client, and throws the connection if the reported latest_block_time is stale.

@webmaster128 - will sort out tests etc for this if you feel it's a useful addition. As it stands, we're pushing for decentralisation of infrastructure, but this is making the dApps unusable for some connections.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Very interesting idea and sane implementation. I like not making a single Tendermint client responsible for the balancing but having that at a higher level.

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.

2 participants