Skip to content

Commit

Permalink
* Renamed a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianMarian committed Oct 17, 2019
1 parent aaa645f commit eb284d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion process/sync/baseForkDetector.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (bfd *baseForkDetector) ResetProbableHighestNonceIfNeeded() {
// consensus group size, could keep all the shard in sync mode, by creating fake blocks higher than current
// committed block + 1, which could not be verified by hash -> prev hash and only by rand seed -> prev random seed
roundsWithoutReceivedBlock := bfd.rounder.Index() - int64(bfd.lastBlockRound())
isInProperRound := bfd.rounder.Index()%roundsMultipleStep == 0
isInProperRound := bfd.rounder.Index()%roundModulusTrigger == 0
if roundsWithoutReceivedBlock > maxRoundsToWait && isInProperRound {
bfd.ResetProbableHighestNonce()
}
Expand Down
4 changes: 2 additions & 2 deletions process/sync/baseSync.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const maxRoundsToWait = 3
// maxHeadersToRequestInAdvance defines the maximum number of headers which will be requested in advance if they are missing
const maxHeadersToRequestInAdvance = 10

// roundsMultipleStep defines the multiple step of rounds on which nodes could take some decisions
const roundsMultipleStep = 5
// roundModulusTrigger defines a round modulus on which a trigger for an action will be released
const roundModulusTrigger = 5

type notarizedInfo struct {
lastNotarized map[uint32]uint64
Expand Down
2 changes: 1 addition & 1 deletion process/sync/metablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (boot *MetaBootstrap) doJobOnSyncBlockFail(hdr *block.MetaBlock, err error)
}

allowedRequestsWithTimeOutHaveReached := boot.requestsWithTimeout >= process.MaxRequestsWithTimeoutAllowed
isInProperRound := boot.rounder.Index()%roundsMultipleStep == 0
isInProperRound := boot.rounder.Index()%roundModulusTrigger == 0

shouldRollBack := err != process.ErrTimeIsOut || (allowedRequestsWithTimeOutHaveReached && isInProperRound)
if shouldRollBack {
Expand Down
2 changes: 1 addition & 1 deletion process/sync/shardblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (boot *ShardBootstrap) doJobOnSyncBlockFail(hdr *block.Header, err error) {
}

allowedRequestsWithTimeOutHaveReached := boot.requestsWithTimeout >= process.MaxRequestsWithTimeoutAllowed
isInProperRound := boot.rounder.Index()%roundsMultipleStep == 0
isInProperRound := boot.rounder.Index()%roundModulusTrigger == 0

shouldRollBack := err != process.ErrTimeIsOut || (allowedRequestsWithTimeOutHaveReached && isInProperRound)
if shouldRollBack {
Expand Down

0 comments on commit eb284d7

Please sign in to comment.