-
Notifications
You must be signed in to change notification settings - Fork 14
Revising multiparty PR #224
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
Draft
meling
wants to merge
27
commits into
multiparty-update
Choose a base branch
from
multiparty-revising
base: multiparty-update
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or 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
The EncodeMsg method does not need to return an error, nor does it need to be a method since it doesn't use the EllipticCurve type for anything.
Contributor
|
Here's the code health analysis summary for commits Analysis Summary
|
No need to attach the message validation check to the broadcastSrv.
This adds a new allowList type and a Check method that performs the validation logic common for message verification in both server.go and in clientserver.go.
This returns an error also for invalid signatures, avoiding the extra check of the valid bool outside the VerifySignature method just to generate an invalid signature error. Thus, we can simply return the error directly. The returned error can be checked if it was an InvalidSignatureErr if necessary (as is done in tests). This is not used in non-test code yet.
This reuses VerifySignature, but hashes the message twice. However, the Verify function is never used, so we need to decide if it is necessary to keep it.
This change allows us to remove EnforceAuthentication and we could use WithAllowList instead.
This simplifies creation of elliptic curve for message auth by avoiding that users have to generating keys, registering keys, and querying the keys.
This uses const values for bit lengths of timestamp, shard, machine ID, and sequenceNum. Thus, the different max values and bit masks are calculated based on the const bit lengths. This also adds the InvalidMachineID function to allow initializing a snowflake instance to an invalid machine ID that must be set afterwards.
Most uses of DecodeBroadcastID only need the shardID, so there is no need to extract the other parts of the broadcast ID.
The listenAddr field in newClient and newAuthClient was only used as a boolean to determine whether or not to create a listener on an arbitrary port; not the port specified in the listenAddr. This just removes the listenAddr field and uses the arbitrary localhost port.
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.
Mostly edits on top of multiparty-update branch.