poanetwork / poa-ballot-stats

Read POA voting records and rank voters by how many ballots they missed.
GNU Lesser General Public License v3.0
7 stars 6 forks source link

(Bug) Results for core seems wrong #9

Closed igorbarinov closed 6 years ago

igorbarinov commented 6 years ago
Collecting events…
• InitiateChange { parent_hash: 0x0b70…9caa, new_set: [0xcf26…4cb0, 0x3ab9…f64f] }
• InitiateChange { parent_hash: 0xd3db…6a55, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61] }
• InitiateChange { parent_hash: 0x4c1b…5f85, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e] }
• InitiateChange { parent_hash: 0x6ba1…b1fc, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67] }
• InitiateChange { parent_hash: 0xbb25…5a33, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc] }
• InitiateChange { parent_hash: 0xe207…e8c8, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced] }
• InitiateChange { parent_hash: 0xf2d1…0b64, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252] }
• InitiateChange { parent_hash: 0x8ab0…b316, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0] }
• InitiateChange { parent_hash: 0x7fb8…f35a, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494] }
• InitiateChange { parent_hash: 0x3cc9…61e4, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e] }
• InitiateChange { parent_hash: 0xf957…f7dc, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75] }
• InitiateChange { parent_hash: 0x0e66…aacb, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3] }
• BallotCreated { id: 0x0, ballot_type: 0x1, creator: 0x6d222aa14ac142e608ad487a557f875ad68ab255 }
• BallotCreated { id: 0x1, ballot_type: 0x1, creator: 0x6d222aa14ac142e608ad487a557f875ad68ab255 }
  Unexpected voter 0x57b8…21f6
• BallotCreated { id: 0x2, ballot_type: 0x1, creator: 0x6d222aa14ac142e608ad487a557f875ad68ab255 }
• BallotCreated { id: 0x3, ballot_type: 0x1, creator: 0x302b817d9a1df335e7b483900a5376d07f929416 }
• BallotCreated { id: 0x4, ballot_type: 0x1, creator: 0x302b817d9a1df335e7b483900a5376d07f929416 }
• BallotCreated { id: 0x5, ballot_type: 0x1, creator: 0x302b817d9a1df335e7b483900a5376d07f929416 }
• BallotCreated { id: 0x6, ballot_type: 0x1, creator: 0xdf11ac70f13f2d4d06d37fd6a5af8f59247c17a5 }
• BallotCreated { id: 0x7, ballot_type: 0x1, creator: 0xdf11ac70f13f2d4d06d37fd6a5af8f59247c17a5 }
• BallotCreated { id: 0x8, ballot_type: 0x1, creator: 0xdf11ac70f13f2d4d06d37fd6a5af8f59247c17a5 }
  Unexpected voter 0x2d68…2404
• InitiateChange { parent_hash: 0x704c…d6a4, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41] }
• BallotCreated { id: 0x9, ballot_type: 0x1, creator: 0xf404992544ac1865bf6e2c559d7cdce5c9406152 }
• BallotCreated { id: 0xa, ballot_type: 0x1, creator: 0xf404992544ac1865bf6e2c559d7cdce5c9406152 }
• BallotCreated { id: 0xb, ballot_type: 0x1, creator: 0xf404992544ac1865bf6e2c559d7cdce5c9406152 }
• InitiateChange { parent_hash: 0x2ef0…9092, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41, 0x6e34…697e] }
• BallotCreated { id: 0xc, ballot_type: 0x1, creator: 0x2d68f0161fcd778db31c7080f6c914657f4d2404 }
• BallotCreated { id: 0xd, ballot_type: 0x1, creator: 0x2d68f0161fcd778db31c7080f6c914657f4d2404 }
• BallotCreated { id: 0xe, ballot_type: 0x1, creator: 0x2d68f0161fcd778db31c7080f6c914657f4d2404 }
• InitiateChange { parent_hash: 0x8b7c…d2ef, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41, 0x6e34…697e, 0xbc70…913b] }
• BallotCreated { id: 0xf, ballot_type: 0x2, creator: 0x2d68f0161fcd778db31c7080f6c914657f4d2404 }
• InitiateChange { parent_hash: 0x36d5…f3c4, new_set: [0xcf26…4cb0, 0xbc70…913b, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41, 0x6e34…697e] }
• BallotCreated { id: 0x10, ballot_type: 0x1, creator: 0x234175a36d554590676f746f7694faf6ee8c33e5 }
• BallotCreated { id: 0x11, ballot_type: 0x1, creator: 0x774ee879b33561cb8e6233ab1ea72f686287ce0a }
• BallotCreated { id: 0x12, ballot_type: 0x1, creator: 0x1206bdd71629d0e32448b1e02f137fc9ceb67efb }
• InitiateChange { parent_hash: 0x4df3…e5e9, new_set: [0xcf26…4cb0, 0xbc70…913b, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41, 0x6e34…697e, 0x7130…a480] }
• BallotCreated { id: 0x13, ballot_type: 0x1, creator: 0x4af0cfee0c2327e001628844b867c8fd6e6a1e3d }
• BallotCreated { id: 0x14, ballot_type: 0x1, creator: 0x4af0cfee0c2327e001628844b867c8fd6e6a1e3d }
• BallotCreated { id: 0x15, ballot_type: 0x1, creator: 0x4af0cfee0c2327e001628844b867c8fd6e6a1e3d }
• InitiateChange { parent_hash: 0x392a…35b8, new_set: [0xcf26…4cb0, 0xbc70…913b, 0x8e6c…6b61, 0x7a6a…d32e, 0x49bb…9b67, 0x0f1e…cdfc, 0x8fe3…dced, 0xdc47…6252, 0x3091…39a0, 0x6e4f…6494, 0x18be…a44e, 0xf1f5…1a75, 0x28e7…2cc3, 0xdad4…1a41, 0x6e34…697e, 0x7130…a480, 0x59d8…fc43] }
        Missed  Voting key   Mining key   Name
  21/22, 95.5%  0xdf11…17a5  0x7a6a…d32e  John H.  LeGassic
  20/22, 91.0%  0x1206…7efb  0x3091…39a0  John D. Storey
  20/22, 91.0%  0x978b…d42e  0xf1f5…1a75  Stephen Arsenault
  20/22, 91.0%  0x9c53…1be9  0x8fe3…dced  Sherina Yang
  20/22, 91.0%  0xe3eb…77c2  0x18be…a44e  Lillian Chan
   9/10, 90.0%  0xcec2…f084  0xdad4…1a41  Alex Emelyanov
  19/22, 86.4%  0x2341…33e5  0x49bb…9b67  Jim O'Regan
  19/22, 86.4%  0x302b…9416  0x0f1e…cdfc  Rocco Mancini
  19/22, 86.4%  0x6d22…b255  0xdc47…6252  Sviataslau Vishneuski
  19/22, 86.4%  0x81de…91d6  0x8e6c…6b61  Jefferson Flowers
  19/22, 86.4%  0xf404…6152  0x6e4f…6494  Michael Milirud
    6/7, 85.8%  0x774e…ce0a  0x6e34…697e  Marat Pekker
  18/21, 85.8%  0x57b8…21f6  0x28e7…2cc3  Melanie Marsollier
    5/6, 83.4%  0xac5d…7317  0xbc70…913b  Ilmira Nugumanova
    0/1,  0.0%  0x2d68…2404

The results for Core seems wrong. For Sokol they look normal https://gist.github.com/igorbarinov/9ba8c7dc831837ba17cff3c67f224199

Can you give me your thoughts on the topic @rstormsf ?

afck commented 6 years ago

Are you using https://core.poa.network? For me, it works fine with Sokol, as well as with a fully synchronized local core node with --pruning=archive --no-warp.

See https://github.com/poanetwork/poa-ballot-stats/issues/4.

igorbarinov commented 6 years ago

Good point. I will try on a local node.

igorbarinov commented 6 years ago

On a local synchronized Core node I have

master ~/r/poa-ballot-stats> cargo run -- -c contracts/core.json http://localhost:8545 -v
    Finished dev [unoptimized + debuginfo] target(s) in 0.39 secs
     Running `target/debug/poa-ballot-stats -c contracts/core.json 'http://localhost:8545' -v`
Collecting events…
• InitiateChange { parent_hash: 0x0b70…9caa, new_set: [0xcf26…4cb0, 0x3ab9…f64f] }
• InitiateChange { parent_hash: 0xd3db…6a55, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61] }
• InitiateChange { parent_hash: 0x4c1b…5f85, new_set: [0xcf26…4cb0, 0x3ab9…f64f, 0x8e6c…6b61, 0x7a6a…d32e] }

        Missed  Voting key   Mining key   Name

master ~/r/poa-ballot-stats>
afck commented 6 years ago

Did you run Parity with --pruning=archive --no-warp?

igorbarinov commented 6 years ago

No, I've used parity --chain /Users/igor/c/poa/poa-chain-spec/spec.json --bootnodes enode://b103d5443f02cc79f28ca79a9dbece155f40dccd528999fc8b517719f8f5f36ac51a2a39584ab3e14974dd1c6661706ce68ed38b78fc0b4c6f69f8e3f5287611@54.175.117.236:30303 --reserved-peers /Users/igor/c/poa/core-bootnodes.txt -d /Users/igor/c/poa/data_folder --jsonrpc-port 8545 ui

How does --pruning=archive --no-warp affect node behavior?

afck commented 6 years ago

I'm not entirely sure about this yet (and about whether both options are needed), but I think if the node isn't running in "full" mode, is pruning old parts of the blockchain or is skipping block content (if I understand correctly, "warp" mode first downloads only the headers, and probably considers the node to be fully synced even if it doesn't have the full blockchain yet), then it doesn't have all the event logs. And it seems that it doesn't return an error in those cases: it just returns empty or incomplete query results.