Skip to content

Commit

Permalink
Merge pull request #131 from ConsenSys/fastpath
Browse files Browse the repository at this point in the history
rename NodeCount to FastPath
  • Loading branch information
nikkolasg authored May 21, 2019
2 parents 059cd79 + c4b51f5 commit 3a6e316
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ type Config struct {
// a given level.
UpdateCount int

// NodeCount indicates how many peers should we contact each time we
// send packets to Handel nodes in a given candidate set. New nodes are
// selected each time but no more than NodeCount.
NodeCount int
// FastPath indicates how many peers should we contact when a level gets
// completed.
FastPath int

// NewBitSet returns an empty bitset. This function is used to parse
// incoming packets containing bitsets.
Expand Down Expand Up @@ -70,7 +69,7 @@ func DefaultConfig(numberOfNodes int) *Config {
contributions := PercentageToContributions(DefaultContributionsPerc, numberOfNodes)
return &Config{
Contributions: contributions,
NodeCount: DefaultCandidateCount,
FastPath: DefaultCandidateCount,
UpdatePeriod: DefaultUpdatePeriod,
UpdateCount: DefaultUpdateCount,
NewBitSet: DefaultBitSet,
Expand Down Expand Up @@ -131,8 +130,8 @@ func mergeWithDefault(c *Config, size int) *Config {
n := PercentageToContributions(DefaultContributionsPerc, size)
c2.Contributions = n
}
if c.NodeCount == 0 {
c2.NodeCount = DefaultCandidateCount
if c.FastPath == 0 {
c2.FastPath = DefaultCandidateCount
}
if c.UpdatePeriod == 0*time.Second {
c2.UpdatePeriod = DefaultUpdatePeriod
Expand Down
4 changes: 2 additions & 2 deletions handel.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (h *Handel) unsafeStartLevel(lvl *level) {
return
}
lvl.setStarted()
h.sendUpdate(lvl, h.c.NodeCount)
h.sendUpdate(lvl, h.c.UpdateCount)

}

Expand Down Expand Up @@ -331,7 +331,7 @@ func (h *Handel) checkCompletedLevel(s *incomingSig) {
}
ms := h.store.Combined(byte(id) - 1)
if ms != nil && lvl.updateSigToSend(ms) {
h.sendUpdate(lvl, h.c.NodeCount)
h.sendUpdate(lvl, h.c.FastPath)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion simul/lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (r *RunConfig) GetHandelConfig() *handel.Config {
}
ch.UpdatePeriod = period
ch.UpdateCount = r.Handel.UpdateCount
ch.NodeCount = r.Handel.NodeCount
ch.FastPath = r.Handel.NodeCount
ch.Contributions = r.GetThreshold()
ch.UnsafeSleepTimeOnSigVerify = r.Handel.UnsafeSleepTimeOnSigVerify

Expand Down

0 comments on commit 3a6e316

Please sign in to comment.