Carry what the node knows about a vote along with it The vote processor looked up a representative's tier to queue its vote, then every election the vote reached looked up the weight again, once per hash, the vote cache looked it up once more, the rebroadcaster asked for the tier a second time and the node observer compared the weight against the principal minimum once again. A vote context now carries the vote with its source and channel, the representative's tier and weight and whether elections count it, all established once by `vote_processor::context` when the vote is queued. The router and both observer sets read the record instead of looking anything up. The router answers a non-principal vote as unknown itself, hands an election the representative, timestamp, source and tier, and hands the vote cache the vote with its weight. A vote with 255 hashes costs one weight lookup instead of 255, the cache needs no weight query and the principal check lives in one place. Tests route votes synchronously with `node::route_vote` and vote on an election directly with the tier left at its default, the longest cooldown. The cache gains an insert action as the hook its weight query used to be. The node's message, block and vote entry points are grouped and commented. Dedicated tests check that the record carries the vote's origin and the representative's weight and tier.
__________
Type: commit
Hash: 1edcd697d8f64a697b39fba34e1dd08e7af9593b
Created: today
__________
gr0v1ty/nano-node:1edcd697d8f64a697b39fba34e1dd08e7af9593b
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 116 s | -3.5 s | - | Show |
| 5n4pr_conf_10k_change | PASS | 170 s | 22.0 s | - | Show |
| 5n4pr_conf_change_dependant | PASS | 134 s | 15.0 s | - | - |
| 5n4pr_conf_change_independant | PASS | 112 s | -8.0 s | - | - |
| 5n4pr_conf_send_dependant | PASS | 117 s | -4.5 s | - | - |
| 5n4pr_conf_send_independant | PASS | 127 s | 11.0 s | - | - |
| 5n4pr_rocks_10k_bintree | FAIL | 3 s | -114.5 s | Show | - |
| 5n4pr_rocks_10k_change | PASS | 173 s | -10.0 s | - | - |