Commit 9dcabdef authored by David Stainton's avatar David Stainton

Update all components to use new pki doc fields

parent 23816327
......@@ -82,10 +82,10 @@ func TestDocument(t *testing.T) {
Epoch: debugTestEpoch,
SendRatePerMinute: testSendRate,
Topology: make([][][]byte, 3),
MixLambda: 0.42,
MixMaxDelay: 23,
SendLambda: 0.69,
SendMaxInterval: 17,
Mu: 0.42,
MuMaxDelay: 23,
LambdaP: 0.69,
LambdaPMaxDelay: 17,
SharedRandomCommit: sharedRandomCommit,
SharedRandomValue: make([]byte, SharedRandomValueLength),
}
......@@ -116,10 +116,16 @@ func TestDocument(t *testing.T) {
require.NoError(err, "VerifyAndParseDocument()")
require.Equal(doc.Epoch, ddoc.Epoch, "VerifyAndParseDocument(): Epoch")
require.Equal(doc.SendRatePerMinute, testSendRate, "VerifyAndParseDocument(): SendRatePerMinute")
require.Equal(doc.MixLambda, ddoc.MixLambda, "VerifyAndParseDocument(): MixLambda")
require.Equal(doc.MixMaxDelay, ddoc.MixMaxDelay, "VerifyAndParseDocument(): MixMaxDelay")
require.Equal(doc.SendLambda, ddoc.SendLambda, "VerifyAndParseDocument(): SendLambda")
require.Equal(doc.SendMaxInterval, ddoc.SendMaxInterval, "VerifyAndParseDocument(): SendMaxInterval")
require.Equal(doc.Mu, ddoc.Mu, "VerifyAndParseDocument(): Mu")
require.Equal(doc.MuMaxDelay, ddoc.MuMaxDelay, "VerifyAndParseDocument(): MuMaxDelay")
require.Equal(doc.LambdaP, ddoc.LambdaP, "VerifyAndParseDocument(): LambdaP")
require.Equal(doc.LambdaPMaxDelay, ddoc.LambdaPMaxDelay, "VerifyAndParseDocument(): LambdaPMaxDelay")
require.Equal(doc.LambdaL, ddoc.LambdaL, "VerifyAndParseDocument(): LambdaL")
require.Equal(doc.LambdaLMaxDelay, ddoc.LambdaLMaxDelay, "VerifyAndParseDocument(): LambdaLMaxDelay")
require.Equal(doc.LambdaD, ddoc.LambdaD, "VerifyAndParseDocument(): LambdaD")
require.Equal(doc.LambdaDMaxDelay, ddoc.LambdaDMaxDelay, "VerifyAndParseDocument(): LambdaDMaxDelay")
require.Equal(doc.LambdaM, ddoc.LambdaM, "VerifyAndParseDocument(): LambdaM")
require.Equal(doc.LambdaMMaxDelay, ddoc.LambdaMMaxDelay, "VerifyAndParseDocument(): LambdaMMaxDelay")
t.Logf("Deserialized document: '%v'", ddoc)
......
......@@ -45,12 +45,16 @@ const (
// Note: These values are picked primarily for debugging and need to
// be changed to something more suitable for a production deployment
// at some point.
defaultMixLambda = 0.00025
defaultMixMaxPercentile = 0.99999
defaultSendLambda = 0.00006
defaultSendMaxPercentile = 0.95
defaultMixLoopLambda = 0.00006
defaultMixLoopMaxPercentile = 0.95
defaultMu = 0.00025
defaultMuMaxPercentile = 0.99999
defaultLambdaP = 0.00025
defaultLambdaPMaxPercentile = 0.99999
defaultLambdaL = 0.00025
defaultLambdaLMaxPercentile = 0.99999
defaultLambdaD = 0.00025
defaultLambdaDMaxPercentile = 0.99999
defaultLambdaM = 0.00025
defaultLambdaMMaxPercentile = 0.99999
)
var defaultLogging = Logging{
......@@ -122,40 +126,78 @@ 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
// Mu is the inverse of the mean of the exponential distribution
// that is used to select the delay for each hop.
Mu float64
// MixMaxDelay is the maximum Sphinx packet per-hop mixing delay in
// milliseconds.
MixMaxDelay uint64
// MuMaxDelay sets the maximum delay for Mu.
MuMaxDelay uint64
// SendLambda is the inverse of the mean of the exponential distribution
// that clients will sample to determine send timing legit forward messages
// or drop decoy messages.
SendLambda float64
// LambdaP is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaP float64
// SendMaxInterval is the maximum send interval in milliseconds.
SendMaxInterval uint64
// LambdaPMaxDelay sets the maximum delay for LambdaP.
LambdaPMaxDelay uint64
// MixLoopLambda is the inverse of the mean of the exponential distribution
// that clients will sample to determine send timing of loop decoy messages.
MixLoopLambda float64
// LambdaL is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaL float64
// MixLoopMaxInterval is the maximum send interval in milliseconds.
MixLoopMaxInterval uint64
// LambdaLMaxDelay sets the maximum delay for LambdaP.
LambdaLMaxDelay uint64
// LambdaD is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaD float64
// LambdaDMaxDelay sets the maximum delay for LambdaP.
LambdaDMaxDelay uint64
// LambdaM is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaM float64
// LambdaMMaxDelay sets the maximum delay for LambdaP.
LambdaMMaxDelay uint64
}
func (pCfg *Parameters) validate() error {
if pCfg.MixLambda < 0 {
return fmt.Errorf("config: Parameters: MixLambda %v is invalid", pCfg.MixLambda)
if pCfg.Mu < 0 {
return fmt.Errorf("config: Parameters: Mu %v is invalid", pCfg.Mu)
}
if pCfg.MuMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: MuMaxDelay %v is out of range", pCfg.MuMaxDelay)
}
if pCfg.LambdaP < 0 {
return fmt.Errorf("config: Parameters: LambdaP %v is invalid", pCfg.LambdaP)
}
if pCfg.LambdaPMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaPMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.LambdaL < 0 {
return fmt.Errorf("config: Parameters: LambdaL %v is invalid", pCfg.LambdaP)
}
if pCfg.MixMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: MixMaxDelay %v is out of range", pCfg.MixMaxDelay)
if pCfg.LambdaLMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaLMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.SendLambda < 0 {
return fmt.Errorf("config: Parameters: SendLambda %v is invalid", pCfg.SendLambda)
if pCfg.LambdaD < 0 {
return fmt.Errorf("config: Parameters: LambdaD %v is invalid", pCfg.LambdaP)
}
if pCfg.LambdaDMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaDMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.LambdaM < 0 {
return fmt.Errorf("config: Parameters: LambdaM %v is invalid", pCfg.LambdaP)
}
if pCfg.LambdaMMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaMMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
return nil
}
......@@ -163,26 +205,38 @@ func (pCfg *Parameters) applyDefaults() {
if pCfg.SendRatePerMinute == 0 {
pCfg.SendRatePerMinute = defaultSendRatePerMinute
}
if pCfg.MixLambda == 0 {
pCfg.MixLambda = defaultMixLambda
if pCfg.Mu == 0 {
pCfg.Mu = defaultMu
}
if pCfg.MixMaxDelay == 0 {
pCfg.MixMaxDelay = uint64(rand.ExpQuantile(pCfg.MixLambda, defaultMixMaxPercentile))
if pCfg.MixMaxDelay > absoluteMaxDelay {
pCfg.MixMaxDelay = absoluteMaxDelay
if pCfg.MuMaxDelay == 0 {
pCfg.MuMaxDelay = uint64(rand.ExpQuantile(pCfg.Mu, defaultMuMaxPercentile))
if pCfg.MuMaxDelay > absoluteMaxDelay {
pCfg.MuMaxDelay = absoluteMaxDelay
}
}
if pCfg.SendLambda == 0 {
pCfg.SendLambda = defaultSendLambda
if pCfg.LambdaP == 0 {
pCfg.LambdaP = defaultLambdaP
}
if pCfg.LambdaPMaxDelay == 0 {
pCfg.LambdaPMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaP, defaultLambdaPMaxPercentile))
}
if pCfg.LambdaL == 0 {
pCfg.LambdaL = defaultLambdaL
}
if pCfg.LambdaLMaxDelay == 0 {
pCfg.LambdaLMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaL, defaultLambdaLMaxPercentile))
}
if pCfg.LambdaD == 0 {
pCfg.LambdaD = defaultLambdaD
}
if pCfg.SendMaxInterval == 0 {
pCfg.SendMaxInterval = uint64(rand.ExpQuantile(pCfg.SendLambda, defaultSendMaxPercentile))
if pCfg.LambdaDMaxDelay == 0 {
pCfg.LambdaDMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaD, defaultLambdaDMaxPercentile))
}
if pCfg.MixLoopLambda == 0 {
pCfg.MixLoopLambda = defaultMixLoopLambda
if pCfg.LambdaM == 0 {
pCfg.LambdaM = defaultLambdaM
}
if pCfg.MixLoopMaxInterval == 0 {
pCfg.MixLoopMaxInterval = uint64(rand.ExpQuantile(pCfg.MixLoopLambda, defaultMixLoopMaxPercentile))
if pCfg.LambdaMMaxDelay == 0 {
pCfg.LambdaMMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaM, defaultLambdaMMaxPercentile))
}
}
......
......@@ -193,16 +193,20 @@ func (s *state) generateDocument(epoch uint64) {
// Build the Document.
doc := &s11n.Document{
Epoch: epoch,
SendRatePerMinute: s.s.cfg.Parameters.SendRatePerMinute,
MixLambda: s.s.cfg.Parameters.MixLambda,
MixMaxDelay: s.s.cfg.Parameters.MixMaxDelay,
SendLambda: s.s.cfg.Parameters.SendLambda,
SendMaxInterval: s.s.cfg.Parameters.SendMaxInterval,
MixLoopLambda: s.s.cfg.Parameters.MixLoopLambda,
MixLoopMaxInterval: s.s.cfg.Parameters.MixLoopMaxInterval,
Topology: topology,
Providers: providers,
Epoch: epoch,
SendRatePerMinute: s.s.cfg.Parameters.SendRatePerMinute,
Mu: s.s.cfg.Parameters.Mu,
MuMaxDelay: s.s.cfg.Parameters.MuMaxDelay,
LambdaP: s.s.cfg.Parameters.LambdaP,
LambdaPMaxDelay: s.s.cfg.Parameters.LambdaPMaxDelay,
LambdaL: s.s.cfg.Parameters.LambdaL,
LambdaLMaxDelay: s.s.cfg.Parameters.LambdaLMaxDelay,
LambdaD: s.s.cfg.Parameters.LambdaD,
LambdaDMaxDelay: s.s.cfg.Parameters.LambdaDMaxDelay,
LambdaM: s.s.cfg.Parameters.LambdaM,
LambdaMMaxDelay: s.s.cfg.Parameters.LambdaMMaxDelay,
Topology: topology,
Providers: providers,
}
// For compatibliity with shared s11n implementation between voting
// and non-voting authority, add SharedRandomValue.
......
This diff is collapsed.
......@@ -204,10 +204,10 @@ func generateMixnet(numMixes, numProviders int, epoch uint64) (*s11n.Document, e
doc := &s11n.Document{
Version: s11n.DocumentVersion,
Epoch: epoch,
MixLambda: 0.25,
MixMaxDelay: 4000,
SendLambda: 1.2,
SendMaxInterval: 300,
Mu: 0.25,
MuMaxDelay: 4000,
LambdaP: 1.2,
LambdaPMaxDelay: 300,
Topology: topology,
Providers: providersRaw,
SharedRandomCommit: sharedRandomCommit,
......
......@@ -46,12 +46,16 @@ const (
// Note: These values are picked primarily for debugging and need to
// be changed to something more suitable for a production deployment
// at some point.
defaultMixLambda = 0.00025
defaultMixMaxPercentile = 0.99999
defaultSendLambda = 0.00006
defaultSendMaxPercentile = 0.95
defaultMixLoopLambda = 0.00006
defaultMixLoopMaxPercentile = 0.95
defaultMu = 0.00025
defaultMuMaxPercentile = 0.99999
defaultLambdaP = 0.00025
defaultLambdaPMaxPercentile = 0.99999
defaultLambdaL = 0.00025
defaultLambdaLMaxPercentile = 0.99999
defaultLambdaD = 0.00025
defaultLambdaDMaxPercentile = 0.99999
defaultLambdaM = 0.00025
defaultLambdaMMaxPercentile = 0.99999
)
var defaultLogging = Logging{
......@@ -127,42 +131,78 @@ 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
// Mu is the inverse of the mean of the exponential distribution
// that is used to select the delay for each hop.
Mu float64
// MixMaxDelay is the maximum Sphinx packet per-hop mixing delay in
// milliseconds.
MixMaxDelay uint64
// MuMaxDelay sets the maximum delay for Mu.
MuMaxDelay uint64
// SendLambda is the inverse of the mean of the exponential distribution
// that clients will sample to determine send timing.
SendLambda float64
// LambdaP is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaP float64
// SendMaxInterval is the maximum send interval in milliseconds.
SendMaxInterval uint64
// LambdaPMaxDelay sets the maximum delay for LambdaP.
LambdaPMaxDelay uint64
// MixLoopLambda is the inverse of the mean of the exponential distribution
// that clients will sample to determine send timing of loop decoy messages.
MixLoopLambda float64
// LambdaL is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaL float64
// MixLoopMaxInterval is the maximum send interval in milliseconds.
MixLoopMaxInterval uint64
// LambdaLMaxDelay sets the maximum delay for LambdaP.
LambdaLMaxDelay uint64
// LambdaD is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaD float64
// LambdaDMaxDelay sets the maximum delay for LambdaP.
LambdaDMaxDelay uint64
// LambdaM is the inverse of the mean of the exponential distribution
// that is used to select the delay between clients sending from their egress
// FIFO queue or drop decoy message.
LambdaM float64
// LambdaMMaxDelay sets the maximum delay for LambdaP.
LambdaMMaxDelay uint64
}
func (pCfg *Parameters) validate() error {
if pCfg.MixLambda < 0 {
return fmt.Errorf("config: Parameters: MixLambda %v is invalid", pCfg.MixLambda)
if pCfg.Mu < 0 {
return fmt.Errorf("config: Parameters: Mu %v is invalid", pCfg.Mu)
}
if pCfg.MuMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: MuMaxDelay %v is out of range", pCfg.MuMaxDelay)
}
if pCfg.LambdaP < 0 {
return fmt.Errorf("config: Parameters: LambdaP %v is invalid", pCfg.LambdaP)
}
if pCfg.LambdaPMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaPMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.LambdaL < 0 {
return fmt.Errorf("config: Parameters: LambdaL %v is invalid", pCfg.LambdaP)
}
if pCfg.MixMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: MixMaxDelay %v is out of range", pCfg.MixMaxDelay)
if pCfg.LambdaLMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaLMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.SendLambda < 0 {
return fmt.Errorf("config: Parameters: SendLambda %v is invalid", pCfg.SendLambda)
if pCfg.LambdaD < 0 {
return fmt.Errorf("config: Parameters: LambdaD %v is invalid", pCfg.LambdaP)
}
if pCfg.MixLoopLambda < 0 {
return fmt.Errorf("config: Parameters: MixLoopLambda %v is invalid", pCfg.MixLoopLambda)
if pCfg.LambdaDMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaDMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
if pCfg.LambdaM < 0 {
return fmt.Errorf("config: Parameters: LambdaM %v is invalid", pCfg.LambdaP)
}
if pCfg.LambdaMMaxDelay > absoluteMaxDelay {
return fmt.Errorf("config: Parameters: LambdaMMaxDelay %v is out of range", pCfg.LambdaPMaxDelay)
}
return nil
}
......@@ -170,26 +210,38 @@ func (pCfg *Parameters) applyDefaults() {
if pCfg.SendRatePerMinute == 0 {
pCfg.SendRatePerMinute = defaultSendRatePerMinute
}
if pCfg.MixLambda == 0 {
pCfg.MixLambda = defaultMixLambda
if pCfg.Mu == 0 {
pCfg.Mu = defaultMu
}
if pCfg.MixMaxDelay == 0 {
pCfg.MixMaxDelay = uint64(rand.ExpQuantile(pCfg.MixLambda, defaultMixMaxPercentile))
if pCfg.MixMaxDelay > absoluteMaxDelay {
pCfg.MixMaxDelay = absoluteMaxDelay
if pCfg.MuMaxDelay == 0 {
pCfg.MuMaxDelay = uint64(rand.ExpQuantile(pCfg.Mu, defaultMuMaxPercentile))
if pCfg.MuMaxDelay > absoluteMaxDelay {
pCfg.MuMaxDelay = absoluteMaxDelay
}
}
if pCfg.SendLambda == 0 {
pCfg.SendLambda = defaultSendLambda
if pCfg.LambdaP == 0 {
pCfg.LambdaP = defaultLambdaP
}
if pCfg.LambdaPMaxDelay == 0 {
pCfg.LambdaPMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaP, defaultLambdaPMaxPercentile))
}
if pCfg.LambdaL == 0 {
pCfg.LambdaL = defaultLambdaL
}
if pCfg.LambdaLMaxDelay == 0 {
pCfg.LambdaLMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaL, defaultLambdaLMaxPercentile))
}
if pCfg.LambdaD == 0 {
pCfg.LambdaD = defaultLambdaD
}
if pCfg.SendMaxInterval == 0 {
pCfg.SendMaxInterval = uint64(rand.ExpQuantile(pCfg.SendLambda, defaultSendMaxPercentile))
if pCfg.LambdaDMaxDelay == 0 {
pCfg.LambdaDMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaD, defaultLambdaDMaxPercentile))
}
if pCfg.MixLoopLambda == 0 {
pCfg.MixLoopLambda = defaultMixLoopLambda
if pCfg.LambdaM == 0 {
pCfg.LambdaM = defaultLambdaM
}
if pCfg.MixLoopMaxInterval == 0 {
pCfg.MixLoopMaxInterval = uint64(rand.ExpQuantile(pCfg.MixLoopLambda, defaultMixLoopMaxPercentile))
if pCfg.LambdaMMaxDelay == 0 {
pCfg.LambdaMMaxDelay = uint64(rand.ExpQuantile(pCfg.LambdaM, defaultLambdaMMaxPercentile))
}
}
......
......@@ -51,13 +51,13 @@ import (
)
const (
descriptorsBucket = "descriptors"
documentsBucket = "documents"
stateAcceptDescriptor = "accept_desc"
stateAcceptVote = "accept_vote"
stateAcceptReveal = "accept_reveal"
stateAcceptSignature = "accept_signature"
stateBootstrap = "bootstrap"
descriptorsBucket = "descriptors"
documentsBucket = "documents"
stateAcceptDescriptor = "accept_desc"
stateAcceptVote = "accept_vote"
stateAcceptReveal = "accept_reveal"
stateAcceptSignature = "accept_signature"
stateBootstrap = "bootstrap"
)
var (
......@@ -65,8 +65,8 @@ var (
authorityVoteDeadline = mixPublishDeadline + epochtime.Period/8
authorityRevealDeadline = authorityVoteDeadline + epochtime.Period/8
publishConsensusDeadline = authorityRevealDeadline + epochtime.Period/8
errGone = errors.New("authority: Requested epoch will never get a Document")
errNotYet = errors.New("authority: Document is not ready yet")
errGone = errors.New("authority: Requested epoch will never get a Document")
errNotYet = errors.New("authority: Document is not ready yet")
)
type descriptor struct {
......@@ -293,17 +293,21 @@ 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,
SendMaxInterval: params.SendMaxInterval,
MixLoopLambda: params.MixLoopLambda,
MixLoopMaxInterval: params.MixLoopMaxInterval,
Topology: topology,
Providers: providers,
SharedRandomValue: srv,
Epoch: s.votingEpoch,
SendRatePerMinute: params.SendRatePerMinute,
Mu: params.Mu,
MuMaxDelay: params.MuMaxDelay,
LambdaP: params.LambdaP,
LambdaPMaxDelay: params.LambdaPMaxDelay,
LambdaL: params.LambdaL,
LambdaLMaxDelay: params.LambdaLMaxDelay,
LambdaD: params.LambdaD,
LambdaDMaxDelay: params.LambdaDMaxDelay,
LambdaM: params.LambdaM,
LambdaMMaxDelay: params.LambdaMMaxDelay,
Topology: topology,
Providers: providers,
SharedRandomValue: srv,
}
return doc
}
......@@ -484,7 +488,7 @@ func (s *state) sendRevealToPeer(peer *config.AuthorityPeer, reveal []byte, epoc
if err == nil {
break
}
if i == len(peer.Addresses) - 1 {
if i == len(peer.Addresses)-1 {
return err
}
}
......@@ -549,7 +553,7 @@ func (s *state) sendVoteToPeer(peer *config.AuthorityPeer, vote []byte, epoch ui
if err == nil {
break
}
if i == len(peer.Addresses) - 1 {
if i == len(peer.Addresses)-1 {
return err
}
}
......@@ -683,12 +687,17 @@ func (s *state) tallyVotes(epoch uint64) ([]*descriptor, *config.Parameters, err
}
// serialize the vote parameters and tally these as well.
params := &config.Parameters{
MixLambda: vote.MixLambda,
MixMaxDelay: vote.MixMaxDelay,
SendLambda: vote.SendLambda,
SendMaxInterval: vote.SendMaxInterval,
MixLoopLambda: vote.MixLoopLambda,
MixLoopMaxInterval: vote.MixLoopMaxInterval,
SendRatePerMinute: vote.SendRatePerMinute,
Mu: vote.Mu,
MuMaxDelay: vote.MuMaxDelay,
LambdaP: vote.LambdaP,
LambdaPMaxDelay: vote.LambdaPMaxDelay,
LambdaL: vote.LambdaL,
LambdaLMaxDelay: vote.LambdaLMaxDelay,
LambdaD: vote.LambdaD,
LambdaDMaxDelay: vote.LambdaDMaxDelay,
LambdaM: vote.LambdaM,
LambdaMMaxDelay: vote.LambdaMMaxDelay,
}
b := bytes.Buffer{}
e := gob.NewEncoder(&b)
......
......@@ -103,10 +103,10 @@ func TestVoteThreshold(t *testing.T) {
}
docWithTarget := &pki.Document{
Epoch: 1,
MixLambda: 3.141,
MixMaxDelay: 3,
SendLambda: 2.6,
SendMaxInterval: 42,
Mu: 3.141,
MuMaxDelay: 3,
LambdaP: 2.6,
LambdaPMaxDelay: 42,
Topology: [][]*pki.MixDescriptor{
{targetMix},
},
......@@ -114,10 +114,10 @@ func TestVoteThreshold(t *testing.T) {
}
docWithoutTarget := &pki.Document{
Epoch: 1,
MixLambda: 3.141,
MixMaxDelay: 3,
SendLambda: 2.6,
SendMaxInterval: 42,
Mu: 3.141,
MuMaxDelay: 3,
LambdaP: 2.6,
LambdaPMaxDelay: 42,
Topology: [][]*pki.MixDescriptor{[]*pki.MixDescriptor{}},
Providers: []*pki.MixDescriptor{},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment