-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shuffle elected validators using block randomness #1033
Conversation
Looks like there's a problem with deploying the Validators smart contract in tests. Is it just not enough gas to pay for the increased bytecode? |
Codecov Report
@@ Coverage Diff @@
## master #1033 +/- ##
=======================================
Coverage 66.94% 66.94%
=======================================
Files 252 252
Lines 7322 7322
Branches 479 479
=======================================
Hits 4902 4902
Misses 2332 2332
Partials 88 88
Continue to review full report at Codecov.
|
@@ -17,7 +17,7 @@ async function startGanache() { | |||
network_id: network.network_id, | |||
mnemonic: network.mnemonic, | |||
gasPrice: network.gasPrice, | |||
gasLimit: 7000000, | |||
gasLimit: 8000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also have to increase the limit in scripts/bash/ganache.sh and scripts/devchain.ts. I think the latter should fix contractkit tests failing.
* master: (61 commits) Remove locales as website is now just in English (#1050) Add MetadataURL to account struct (#1103) Allow validators to use any valid combination of gold commitments as stake (#885) Fix blockscout websocket jsonrpc url (#1096) [Wallet] Preliminary iOS support (#1098) [Wallet] Set security fee description translation in Spanish (#1097) Exclude generated in vscode file watcher setting (#1082) Update .env and .env.integration files (#1087) Allow a testnet to run without ethstats (#1085) Collect exchange rate time series using notification service (#1020) Return to preview view when Fee Education is closed (#1068) [Wallet] Pin Setup Flow v2 (#1054) Added a variable for electoral threshold (#1023) [celotool]Store .env config on GCS after deployment (#1086) Group size limit (#1035) Fix governance unit tests (#1084) Add getExchangeRate to ContractKit (#1083) [CLI]Unlock till the geth exits (#1070) Add Quorum and Refactor Governance (#430) Shuffle elected validators using block randomness (#1033) ...
Description
Calls to
getValidators
to run the validators election now result in the set being shuffled using a variant of Fisher-Yates using block randomness as a seed.This means that malicious groups or validators cannot predict their ordering or attempt to be located next to another validator under their control. Also makes it less likely that validators with few votes that are down are arranged sequentially and therefore cause a series of round changes and therefore exponential backoffs and a single very high block time.
Tested
New and modified protocol unit tests with a new
MockRandom
Other changes
Describe any minor or "drive-by" changes here.
Related issues
Backwards compatibility
Yes