Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
authority
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
katzenpost
authority
Commits
846328a7
Commit
846328a7
authored
Dec 24, 2018
by
David Stainton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
voting: Add SendRatePerMinute cfg param
parent
72931ace
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
nonvoting/server/config/config.go
nonvoting/server/config/config.go
+3
-3
voting/server/config/config.go
voting/server/config/config.go
+6
-0
voting/server/state.go
voting/server/state.go
+1
-0
No files found.
nonvoting/server/config/config.go
View file @
846328a7
...
...
@@ -160,6 +160,9 @@ func (pCfg *Parameters) validate() error {
}
func
(
pCfg
*
Parameters
)
applyDefaults
()
{
if
pCfg
.
SendRatePerMinute
==
0
{
pCfg
.
SendRatePerMinute
=
defaultSendRatePerMinute
}
if
pCfg
.
MixLambda
==
0
{
pCfg
.
MixLambda
=
defaultMixLambda
}
...
...
@@ -172,9 +175,6 @@ func (pCfg *Parameters) applyDefaults() {
if
pCfg
.
SendLambda
==
0
{
pCfg
.
SendLambda
=
defaultSendLambda
}
if
pCfg
.
SendRatePerMinute
==
0
{
pCfg
.
SendRatePerMinute
=
defaultSendRatePerMinute
}
if
pCfg
.
SendMaxInterval
==
0
{
pCfg
.
SendMaxInterval
=
uint64
(
rand
.
ExpQuantile
(
pCfg
.
SendLambda
,
defaultSendMaxPercentile
))
}
...
...
voting/server/config/config.go
View file @
846328a7
...
...
@@ -124,6 +124,9 @@ func (lCfg *Logging) validate() error {
// Parameters is the network parameters.
type
Parameters
struct
{
// SendRatePerMinute is the rate per minute.
SendRatePerMinute
uint64
// MixLambda is the inverse of the mean of the exponential distribution
// that the Sphinx packet per-hop mixing delay will be sampled from.
MixLambda
float64
...
...
@@ -164,6 +167,9 @@ func (pCfg *Parameters) validate() error {
}
func
(
pCfg
*
Parameters
)
applyDefaults
()
{
if
pCfg
.
SendRatePerMinute
==
0
{
pCfg
.
SendRatePerMinute
=
defaultSendRatePerMinute
}
if
pCfg
.
MixLambda
==
0
{
pCfg
.
MixLambda
=
defaultMixLambda
}
...
...
voting/server/state.go
View file @
846328a7
...
...
@@ -295,6 +295,7 @@ func (s *state) getDocument(descriptors []*descriptor, params *config.Parameters
// Build the Document.
doc
:=
&
s11n
.
Document
{
Epoch
:
s
.
votingEpoch
,
SendRatePerMinute
:
params
.
SendRatePerMinute
,
MixLambda
:
params
.
MixLambda
,
MixMaxDelay
:
params
.
MixMaxDelay
,
SendLambda
:
params
.
SendLambda
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment