-
Notifications
You must be signed in to change notification settings - Fork 113
Forks done right #2272
Forks done right #2272
Conversation
|
@edmundnoble here is some code to simulate propagation of fork votes in the chain graph at the end of each fork epoch: https://github.com/larskuhtz/quant-avg-consensus-for-chainweb For d4k4 a precision of 1000 limits the average error to |
|
Here are some results for 500000 samples with precision 1000 and 59-62 steps for d4k4: $ for ((i=59; i<63; i++)) ; do ./quant-avg-consensus 'd4k4' 500000 1000 $i ; done{"convergenceCount":499177,"delta":{"avg":1.646e-3,"max":1,"median":0,"min":0},"err":{"avg":2.537244897959155e-2,"max":0.5204081632655289,"median":2.0408163265528856e-2,"min":-0.47959183673447114},"steps":59}
{"convergenceCount":499910,"delta":{"avg":1.8e-4,"max":1,"median":0,"min":0},"err":{"avg":2.58265510204081e-2,"max":0.5204081632655289,"median":3.061224489738379e-2,"min":-0.47959183673447114},"steps":60}
{"convergenceCount":500000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":2.5171673469387243e-2,"max":0.5204081632655289,"median":2.0408163265528856e-2,"min":-0.47959183673447114},"steps":61}
{"convergenceCount":500000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":2.5971000000000573e-2,"max":0.5204081632655289,"median":3.061224489738379e-2,"min":-0.47959183673447114},"steps":62} |
|
Results for d5k4: $ for ((i=48; i<52; i++)) ; do ./quant-avg-consensus 'd5k4' 100000 1000 $i ; done{"convergenceCount":99877,"delta":{"avg":1.23e-3,"max":1,"median":0,"min":0},"err":{"avg":1.8993301886793032e-2,"max":0.518867924528422,"median":1.886792452842201e-2,"min":-0.481132075471578},"steps":48}
{"convergenceCount":99992,"delta":{"avg":8.0e-5,"max":1,"median":0,"min":0},"err":{"avg":2.0584103773584193e-2,"max":0.518867924528422,"median":1.886792452842201e-2,"min":-0.481132075471578},"steps":49}
{"convergenceCount":100000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":2.0781462264151077e-2,"max":0.518867924528422,"median":2.3584905660754885e-2,"min":-0.481132075471578},"steps":50}
{"convergenceCount":100000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":1.9994905660378235e-2,"max":0.518867924528422,"median":1.886792452842201e-2,"min":-0.481132075471578},"steps":51} |
|
Results for twenty chain graph: $ for ((i=43; i<47; i++)) ; do ./quant-avg-consensus 'twenty' 1000000 1000 $i ; done{"convergenceCount":999547,"delta":{"avg":4.53e-4,"max":1,"median":0,"min":0},"err":{"avg":2.5327500000000343e-2,"max":0.5,"median":4.9999999999272404e-2,"min":-0.4500000000007276},"steps":43}
{"convergenceCount":999980,"delta":{"avg":2.0e-5,"max":1,"median":0,"min":0},"err":{"avg":2.5574049999999855e-2,"max":0.5,"median":4.9999999999272404e-2,"min":-0.4500000000007276},"steps":44}
{"convergenceCount":1000000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":2.4516199999999887e-2,"max":0.5,"median":0,"min":-0.4500000000007276},"steps":45}
{"convergenceCount":1000000,"delta":{"avg":0,"max":0,"median":0,"min":0},"err":{"avg":2.485050000000043e-2,"max":0.5,"median":0,"min":-0.4500000000007276},"steps":46} |
|
Some more |
1151cc2 to
9c47353
Compare
5180a1a to
9b0b8ec
Compare
| resetVotes :: ForkVotes | ||
| resetVotes = ForkVotes 0 |
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.
resetVotes sounds like a function, how about noVotes?
| , IncorrectPow | ||
| , InvalidForkVotes -- invalid reset at fork epoch start | ||
| , InvalidForkVotes -- invalid vote count in linear induction | ||
| , InvalidForkVotes -- invalid vote count in DAG indicution |
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.
I think we're still missing a test for the fork vote counting.
Co-authored-by: Edmund Noble <edmundnoble@users.noreply.github.com>

This PR replaces the current service dates by forks that are voted for by miners, usually by installing the next version of the software. But it would also possible to vote via, say, a command line flag or some other configuration option.
It guarantees continuous operation of the network without the need of regular service releases. It also allows to react in a more agile way to issues and rollout changes on an on-demand basis.
Service date releases are well suited for incremental software improvements that are non-controversial among the the users of the system. Updates that affect economic incentives of the system should be affirmed explicitly by the block producers. This PR introduces such a mechanism.
Experimental results related to the algorithm for vote counting can be found in this repository in this notebook