Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theconnect
function ofTendermint34Client
, and throws the connection if the reportedlatest_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.