Skip to content

Conversation

@meling
Copy link
Member

@meling meling commented Apr 13, 2025

Mostly edits on top of multiparty-update branch.

  • refactor: update signature handling to use getter methods
  • refactor: update message metadata handling to use getter methods
  • refactor: update metadata handling to use getter methods in channel
  • fix: add back broadcastcall and client interface
  • refactor: regenerate from proto and use generated NewServer
  • refactor: remove unused SignAndVerify method from EllipticCurve
  • refactor: remove commented gob-based encoder in EncodeMsg
  • refactor: remove unnecessary error from encodeMsg function
  • refactor: replace method with EncodeMsg function and remove error
  • refactor: replace encodeMsg with Encode method on gorums.Message type

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Apr 13, 2025

Here's the code health analysis summary for commits a723c51..bdb4989. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo❌ Failure
❗ 87 occurences introduced
View Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@meling meling changed the base branch from master to multiparty April 13, 2025 14:07
@meling meling changed the base branch from multiparty to multiparty-update April 13, 2025 14:08
meling added 22 commits April 13, 2025 16:26
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants