-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3873 from oasisprotocol/kostko/stable/20.12.x/con…
…s-graceful-halt [BACKPORT/20.12.x] go/consensus: Gracefully handle halt
- Loading branch information
Showing
15 changed files
with
158 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go/consensus: Move upgrade logic to governance, gracefully handle halt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go/oasis-node: Dump correct block height on halt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go: Ignore jwt-go vulns since we're not using the features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package full | ||
|
||
import "time" | ||
|
||
// Borrowed from https://github.com/cenkalti/backoff. | ||
|
||
// Returns a random value from the following interval: | ||
// [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval]. | ||
func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration { | ||
delta := randomizationFactor * float64(currentInterval) | ||
minInterval := float64(currentInterval) - delta | ||
maxInterval := float64(currentInterval) + delta | ||
|
||
// Get a random value from the range [minInterval, maxInterval]. | ||
// The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then | ||
// we want a 33% chance for selecting either 1, 2 or 3. | ||
return time.Duration(minInterval + (random * (maxInterval - minInterval + 1))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.