Skip to content

Conversation

@nkuba
Copy link
Member

@nkuba nkuba commented Sep 30, 2020

Added functionality of operators banning in FullyBackedSortitionPool contract.

A pool owner can call a function to ban an operator. Once an operator gets banned it is removed from the pool. The operator won't get selected to new groups.

An operator can be banned even if it has never been registered or is not currently registered in the pool.

A banned operator cannot join a pool.

Depends on #89
Depends on #97
Refs keep-network/keep-ecdsa#483

Added a functionality of operators banning in FullyBackedSortitionPool
contract.

A pool owner can call a function to ban an operator. Once an operator gets
banned it is removed from the pool. The operator won't get selected to
new groups.

Operator can be banned even if it has never been registered or is not currently
registered in the pool.

A banned operator cannot join a pool.
We use an modifier that is already defined to check if a function is
called by a pool owner. The change results in a revert message change
from `Only owner may select groups` to `Caller is not the owner`.
@nkuba nkuba changed the title Fully backed ban Ban operator in FullyBackedSortitionPool Sep 30, 2020
@nkuba nkuba requested review from eth-r and pdyraga September 30, 2020 13:01
eth-r
eth-r previously approved these changes Oct 13, 2020
Copy link
Contributor

@eth-r eth-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me once the tests are sorted out

@eth-r eth-r dismissed their stale review October 13, 2020 13:32

Debugging tests first

eth-r
eth-r previously approved these changes Oct 13, 2020
Base automatically changed from fully-backed-tweaks to master October 27, 2020 11:26
@pdyraga pdyraga dismissed eth-r’s stale review October 27, 2020 11:26

The base branch was changed.

await pool.selectSetGroup(3, seed, minimumBondableValue, {from: owner})
})

it("reverts when operator gets banned in the sortition pool", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could improve the test name a little. We are not failing selection because some operator has been banned and removed from the pool but because of this ban, we no longer have enough unique operators to perform the selection.

@pdyraga pdyraga merged commit dbcadd9 into master Oct 27, 2020
@pdyraga pdyraga deleted the fully-backed-ban branch October 27, 2020 11:48
@pdyraga pdyraga added this to the v2.0.0 milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants