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
3f4fae51
Commit
3f4fae51
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
XX-4288 / Add attempt tracker to sendMany Cmix
parent
46a3aa77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!510
Release
,
!426
XX-4288 / Add attempt tracker to sendMany Cmix
,
!340
Project/channels
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmix/sendCmix.go
+0
-2
0 additions, 2 deletions
cmix/sendCmix.go
cmix/sendManyCmix.go
+31
-8
31 additions, 8 deletions
cmix/sendManyCmix.go
with
31 additions
and
10 deletions
cmix/sendCmix.go
+
0
−
2
View file @
3f4fae51
...
...
@@ -196,8 +196,6 @@ func sendCmixHelper(sender gateway.Sender, assembler messageAssembler, recipient
defer
attemptTracker
.
SubmitProbeAttempt
(
numAttempts
)
}
jww
.
INFO
.
Printf
(
""
)
for
numRoundTries
:=
uint
(
0
);
numRoundTries
<
cmixParams
.
RoundTries
;
numRoundTries
,
numAttempts
=
numRoundTries
+
1
,
numAttempts
+
1
{
elapsed
:=
netTime
.
Since
(
timeStart
)
...
...
This diff is collapsed.
Click to expand it.
cmix/sendManyCmix.go
+
31
−
8
View file @
3f4fae51
...
...
@@ -9,6 +9,7 @@ package cmix
import
(
"fmt"
"gitlab.com/elixxir/client/cmix/attempts"
"gitlab.com/elixxir/client/cmix/rounds"
"strings"
"time"
...
...
@@ -90,7 +91,7 @@ func (c *client) SendMany(messages []TargetedCmixMessage,
return
sendManyCmixHelper
(
c
.
Sender
,
acms
,
p
,
c
.
instance
,
c
.
session
.
GetCmixGroup
(),
c
.
Registrar
,
c
.
rng
,
c
.
events
,
c
.
session
.
GetTransmissionID
(),
c
.
comms
)
c
.
session
.
GetTransmissionID
(),
c
.
comms
,
c
.
attemptTracker
)
}
type
assembledCmixMessage
struct
{
...
...
@@ -109,11 +110,11 @@ type assembledCmixMessage struct {
// If the message is successfully sent, the ID of the round sent it is returned,
// which can be registered with the network instance to get a callback on its
// status.
func
sendManyCmixHelper
(
sender
gateway
.
Sender
,
msgs
[]
assembledCmixMessage
,
param
CMIXParams
,
instance
*
network
.
Instance
,
grp
*
cyclic
.
Group
,
registrar
nodes
.
Registrar
,
rng
*
fastRNG
.
StreamGenerator
,
events
event
.
Reporter
,
senderId
*
id
.
ID
,
comms
SendCmixCommsInterface
)
(
func
sendManyCmixHelper
(
sender
gateway
.
Sender
,
msgs
[]
assembledCmixMessage
,
param
CMIXParams
,
instance
*
network
.
Instance
,
grp
*
cyclic
.
Group
,
registrar
nodes
.
Registrar
,
rng
*
fastRNG
.
StreamGenerator
,
events
event
.
Reporter
,
senderId
*
id
.
ID
,
comms
SendCmixCommsInterface
,
attemptTracker
attempts
.
SendAttemptTracker
)
(
rounds
.
Round
,
[]
ephemeral
.
Id
,
error
)
{
timeStart
:=
netTime
.
Now
()
...
...
@@ -141,7 +142,29 @@ func sendManyCmixHelper(sender gateway.Sender,
cmix
.
SetGroupBits
(
msgs
[
i
]
.
Message
,
grp
,
stream
)
}
for
numRoundTries
:=
uint
(
0
);
numRoundTries
<
param
.
RoundTries
;
numRoundTries
++
{
numAttempts
:=
0
if
!
param
.
Probe
{
optimalAttempts
,
ready
:=
attemptTracker
.
GetOptimalNumAttempts
()
if
ready
{
numAttempts
=
optimalAttempts
jww
.
INFO
.
Printf
(
"[SendMany-%s] Looking for round to send cMix "
+
"messages to %s, sending non probe with %d optimalAttempts"
,
param
.
DebugTag
,
recipientString
,
numAttempts
)
}
else
{
numAttempts
=
4
jww
.
INFO
.
Printf
(
"[SendMany-%s] Looking for round to send cMix "
+
"messages to %s, sending non probe with %d non optimalAttempts, "
+
"insufficient data"
,
param
.
DebugTag
,
recipientString
,
numAttempts
)
}
}
else
{
jww
.
INFO
.
Printf
(
"[SendMany-%s] Looking for round to send cMix messages "
+
"to %s, sending probe with %d Attempts, insufficient data"
,
param
.
DebugTag
,
recipientString
,
numAttempts
)
defer
attemptTracker
.
SubmitProbeAttempt
(
numAttempts
)
}
for
numRoundTries
:=
uint
(
0
);
numRoundTries
<
param
.
RoundTries
;
numRoundTries
,
numAttempts
=
numRoundTries
+
1
,
numAttempts
+
1
{
elapsed
:=
netTime
.
Since
(
timeStart
)
if
elapsed
>
param
.
Timeout
{
...
...
@@ -162,7 +185,7 @@ func sendManyCmixHelper(sender gateway.Sender,
// Find the best round to send to, excluding attempted rounds
bestRound
,
_
,
_
:=
instance
.
GetWaitingRounds
()
.
GetUpcomingRealtime
(
remainingTime
,
attempted
,
int
(
numRoundTries
)
,
sendTimeBuffer
)
remainingTime
,
attempted
,
numAttempts
,
sendTimeBuffer
)
if
bestRound
==
nil
{
continue
}
...
...
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