Feature/lit 2407 js sdk add timestamp on each handshake to alert for when we #349
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.
Description
Adds an expiration check for
latestBlockhash
as after30 seconds
the hash is expired on the nodes and we should no longer generate new auth materials using the stale hash.getLatestBlockhash
will now reconnect to nodes to fetch the latest hash. we need to connect to all nodes to assure thelatestBlockhash
returned is the same from all network participants.Unfortunately this does break backwards compatibility as we now need to make
getLatestBlockhash
and async implementation as it calls async implementation internally. Since we must wait for the hash to refresh the method signature has now been madeasync
Type of change
How Has This Been Tested?
New
e2e
test has been made to force the blockhash to expire and cause the system to refresh its sate.e2e-nodejs/group-latest-blockhash-update/test-block-has-update-after-exp.mjs
Checklist: