-
Notifications
You must be signed in to change notification settings - Fork 2
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
sync: fresh and existing wallets skip trial decryption #164
Conversation
|
try { | ||
const walletCreationBlockHeight = await fetchBlockHeight(randomEndpoint!); | ||
if (walletCreationBlockHeight !== undefined) { | ||
return walletCreationBlockHeight; | ||
} else { | ||
// Remove the current endpoint from the list and try again | ||
const remainingEndpoints = endpoints.filter(endpoint => endpoint !== randomEndpoint); | ||
return fetchBlockHeightWithFallback(remainingEndpoints); | ||
} | ||
} catch (error) { | ||
const remainingEndpoints = endpoints.filter(endpoint => endpoint !== randomEndpoint); | ||
return fetchBlockHeightWithFallback(remainingEndpoints); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fetches the block height by randomly querying one of the rpc endpoints in the chain registry. something to consider is whether this operation is possibly blocking or if the rpc call will eventually time out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we added timeouts to our promise clients (?). It's async, so not thread blocking, but we should have a think whether this should block the onboarding step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this approach is non-blocking at the thread level, it could still delay onboarding if the rpc requests take too long. I noticed that we don't have timeouts set for our promise clients at either the transport level or at the request level (ie. getStatus
). Consequently, should we implement a timeout at the transport level, request level within the async request in fetchBlockHeight
, or both to prevent indefinite hanging? cc @turbocrime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we construct a promise client with 2 second timeout, which should be sufficient for most rpc requests? However, do you think this timeout is short enough that it might lead to an increase in network request failures? Would it be better to extend the timeout to say 5 seconds?
I think this the only remaining consideration that's soft blocking @grod220
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start to this!
try { | ||
const walletCreationBlockHeight = await fetchBlockHeight(randomEndpoint!); | ||
if (walletCreationBlockHeight !== undefined) { | ||
return walletCreationBlockHeight; | ||
} else { | ||
// Remove the current endpoint from the list and try again | ||
const remainingEndpoints = endpoints.filter(endpoint => endpoint !== randomEndpoint); | ||
return fetchBlockHeightWithFallback(remainingEndpoints); | ||
} | ||
} catch (error) { | ||
const remainingEndpoints = endpoints.filter(endpoint => endpoint !== randomEndpoint); | ||
return fetchBlockHeightWithFallback(remainingEndpoints); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we added timeouts to our promise clients (?). It's async, so not thread blocking, but we should have a think whether this should block the onboarding step.
a12b8fa
to
89a5502
Compare
c7dda19
to
c12a736
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post 🍐 approval 👍
tested various workflows and error conditions and looks good 👍 |
references penumbra-zone/web#1278 and penumbra-zone/web#1707
Implements the necessary scaffolding for wallet birthdays in prax