-
Notifications
You must be signed in to change notification settings - Fork 93
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
Pre-share nonces #218
Merged
Merged
Pre-share nonces #218
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Main objective
make Horcrux fast enough for 100% uptime on chains with sub-second blocks. This should be possible with reasonable pings between cosigners (<100ms), e.g. dYdX, Neutron, Injective, Sei.
Nonce pre-generation and pre-sharing
Remove a round trip to the cosigners from each sign request!
Nonces can be pre-shared so they are ready for the time of signature, reducing the sign time to <2ms per signature under ideal network conditions.
CosignerHealth
is in operation when a cosigner is the leader. It pings other cosigners every second and tracks the round-trip-time (RTT). It has a methodGetFastest
to get the peer cosigners in order of lowest to highest RTT.CosignerNonceCache
stores the pre-shared nonces and which Cosigners were involved in the pre-generation of that nonce. Any nonces which do not have threshold number of cosigners involved in pre-generation are not stored.GRPC multiplexing
Raft finally has a
LeaderWithID()
function, so we can look up the*RemoteCosigner
from the ID rather than having to make a separate grpc client to the leader address, so we can use grpc multiplexing for proxy sign operations.*RemoteCosigner
now opens a consistent connection to take advantage of HTTP/2 multiplexing for Cosigner<->Cosigner communication.