-
Notifications
You must be signed in to change notification settings - Fork 211
/
config.go
29 lines (25 loc) · 1.08 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package config
import "time"
// Config is the configuration of the Hare.
type Config struct {
N int `mapstructure:"hare-committee-size"` // total number of active parties
RoundDuration time.Duration `mapstructure:"hare-round-duration"` // the duration of a single round
WakeupDelta time.Duration `mapstructure:"hare-wakeup-delta"` // the wakeup delta after tick
ExpectedLeaders int `mapstructure:"hare-exp-leaders"` // the expected number of leaders
LimitIterations int `mapstructure:"hare-limit-iterations"` // limit on number of iterations
LimitConcurrent int `mapstructure:"hare-limit-concurrent"` // limit number of concurrent CPs
StopAtxGrading uint32 `mapstructure:"stop-atx-grading"`
Hdist uint32
}
// DefaultConfig returns the default configuration for the hare.
func DefaultConfig() Config {
return Config{
N: 10,
RoundDuration: 10 * time.Second,
WakeupDelta: 10 * time.Second,
ExpectedLeaders: 5,
LimitIterations: 5,
LimitConcurrent: 5,
Hdist: 20,
}
}