Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
0da0311d
Commit
0da0311d
authored
2 years ago
by
benjamin
Browse files
Options
Downloads
Patches
Plain Diff
instrumented node registration and made only 4 paralelell node registrations
parent
ec627a0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!418
instrumented node registration and made only 4 paralelell node registrations
,
!340
Project/channels
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmix/nodes/request.go
+8
-1
8 additions, 1 deletion
cmix/nodes/request.go
cmix/params.go
+1
-1
1 addition, 1 deletion
cmix/params.go
with
9 additions
and
2 deletions
cmix/nodes/request.go
+
8
−
1
View file @
0da0311d
...
...
@@ -9,6 +9,7 @@ package nodes
import
(
"io"
"time"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
...
...
@@ -41,6 +42,7 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface,
// Generate a Diffie-Hellman keypair
grp
:=
r
.
session
.
GetCmixGroup
()
start
:=
time
.
Now
()
prime
:=
grp
.
GetPBytes
()
keyLen
:=
len
(
prime
)
dhPrivBytes
,
err
:=
csprng
.
GenerateInGroup
(
prime
,
keyLen
,
rng
)
...
...
@@ -66,8 +68,9 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface,
// Request nonce message from gateway
jww
.
INFO
.
Printf
(
"Register: Requesting client key from "
+
"gateway %s
"
,
gatewayID
)
"gateway %s
, setup took "
,
gatewayID
,
time
.
Since
(
start
)
)
start
=
time
.
Now
()
result
,
err
:=
sender
.
SendToAny
(
func
(
host
*
connect
.
Host
)
(
interface
{},
error
)
{
keyResponse
,
err2
:=
comms
.
SendRequestClientKeyMessage
(
host
,
signedKeyReq
)
if
err2
!=
nil
{
...
...
@@ -81,6 +84,7 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface,
return
keyResponse
,
nil
},
stop
)
jww
.
INFO
.
Printf
(
"reg request took %s"
,
time
.
Since
(
start
))
if
err
!=
nil
{
return
nil
,
nil
,
0
,
err
...
...
@@ -188,11 +192,14 @@ func processRequestResponse(signedKeyResponse *pb.SignedKeyResponse,
// Convert Node DH Public key to a cyclic.Int
nodeDHPub
:=
grp
.
NewIntFromBytes
(
keyResponse
.
NodeDHPubKey
)
start
:=
time
.
Now
()
// Construct the session key
h
.
Reset
()
sessionKey
:=
registration
.
GenerateBaseKey
(
grp
,
nodeDHPub
,
dhPrivKey
,
h
)
jww
.
INFO
.
Printf
(
"DH for reg took %s"
,
time
.
Since
(
start
))
// Verify the HMAC
if
!
registration
.
VerifyClientHMAC
(
sessionKey
.
Bytes
(),
keyResponse
.
EncryptedClientKey
,
opts
.
Hash
.
New
,
...
...
This diff is collapsed.
Click to expand it.
cmix/params.go
+
1
−
1
View file @
0da0311d
...
...
@@ -99,7 +99,7 @@ func GetDefaultParams() Params {
MaxCheckedRounds
:
500
,
RegNodesBufferLen
:
1000
,
NetworkHealthTimeout
:
15
*
time
.
Second
,
ParallelNodeRegistrations
:
20
,
ParallelNodeRegistrations
:
4
,
KnownRoundsThreshold
:
1500
,
// 5 rounds/sec * 60 sec/min * 5 min
FastPolling
:
true
,
VerboseRoundTracking
:
false
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment