Skip to content
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

Statistics of ballots #9

Open
rstormsf opened this issue Mar 23, 2018 · 4 comments
Open

Statistics of ballots #9

rstormsf opened this issue Mar 23, 2018 · 4 comments

Comments

@rstormsf
Copy link

Title

  Title: Statistics of ballots
  Layer: Consensus

Abstract

In order to further evaluate responsibilities of validators, we have to see how they participate in ballots.

Specification

Every ballot emitts an event called
https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/VotingToChangeKeys.sol#L93

    event BallotCreated(uint256 indexed id, uint256 indexed ballotType, address indexed creator);

with their Id, type and creator of the ballot.

Later on for every vote on the ballot there is Vote event
https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/VotingToChangeKeys.sol#L43
with their

    event Vote(uint256 indexed id, uint256 decision, address indexed voter, uint256 time );

id - is ballot id,
decision - is the choice of the ballot (yes/no) 1 - is yes, 2 is no
https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/VotingToChangeKeys.sol#L13

voter - is the address of voter (voting_key).

Implementation

We would like to see an app where you can see statistics per mining key of the participation in ballots.
How to do it:

  1. Get all events for Keys ballot type
  2. Get all voting keys that parcipated in each ballot
  3. Map voting key to their mining key by using getVotingKeyByMiningKeymethod from ValidatorMetadata contract
  4. Display names from ValidatorMetadata contract with all statistics ordered by those who rarely participates in ballots.
    https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/ValidatorMetadata.sol#L214
@6proof
Copy link

6proof commented Mar 24, 2018

Solid reasoning. Provides visibility for all Token Holders. Good idea!

@afck
Copy link

afck commented Mar 31, 2018

I gave it a try, but it's still work in progress: https://github.com/afck/poa-ballot-stats https://github.com/poanetwork/poa-ballot-stats

It collects Vote and BallotCreated events and uses the ValidatorMetadata contract to collect the names and mining keys in the end, and list the voters in the specified order, with percentages of missed ballots.

However, I couldn't find any ChangeFinalized events, and I'm not sure how to find the set of initial validators.

For now, it just starts with an empty set and acts surprised (prints an error) whenever it encounters a vote by someone it doesn't know yet.

@igorbarinov
Copy link
Member

Implemented by Andreas here https://github.com/poanetwork/poa-ballot-stats
👏

@ajkagy
Copy link

ajkagy commented Jun 26, 2018

Implemented a very simple C#/.NET CORE ballot stats tool to show validator yes/no votes for transparency on individual ballots here: https://github.com/ajkagy/POA-Tools

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

No branches or pull requests

5 participants