This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Conversation
This was referenced Oct 21, 2025
Merged
chessai
reviewed
Oct 22, 2025
Contributor
Author
|
@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 |
Contributor
Author
|
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} |
Contributor
Author
|
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} |
Contributor
Author
|
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} |
Contributor
Author
|
Some more |
Contributor
Author
1151cc2 to
9c47353
Compare
5180a1a to
9b0b8ec
Compare
edmundnoble
suggested changes
Nov 6, 2025
Comment on lines
+187
to
+188
| resetVotes :: ForkVotes | ||
| resetVotes = ForkVotes 0 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
I think we're still missing a test for the fork vote counting.
Co-authored-by: Edmund Noble <edmundnoble@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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