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

multi: Add forced deployment result network param. #3060

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 15, 2023

This requires #3059.

Currently, the lack of an entry for a given deployment in the chain parameters for a given network is treated the same as the deployment being active. This behavior is primarily in order to support testing without needing to go through the entire voting process on testing networks such as the simulation network as well as allows rule changes on newer versions of testnet networks that were previously accepted on prior versions.

However, the existing approach has been pointed out on several occasions as being surprising behavior by those working on consensus changes and it also means testing the voting process itself for new rule changes prior to their release requires a cumbersome sequence of not so obvious steps. Further, it also makes those historical pruned rule changes invisible to RPCs like getblockchaininfo.

In order to address the aforementioned inconveniences, this adds a new parameter to the per-network chain parameters to specify a vote choice that should always be considered as having been the majority result of a vote and updates the relevant logic in blockchain accordingly to respect it.

The new approach does not suffer from the aforementioned inconveniences as it permits a simple single line modification to allow the voting process to be tested as well as makes automatically activated historical rules visible to the RPCs like getblockchaininfo.

Finally, this also adds previously pruned deployment parameters back to the relevant network parameters with the new field set to force them to be active.

Closes #3058.

@davecgh davecgh added the test coverage Discussion and pull requests for improving test coverage. label Feb 15, 2023
@davecgh davecgh added this to the 1.8.0 milestone Feb 15, 2023
@davecgh davecgh force-pushed the multi_always_active_forced_choice_deployment_flag branch 3 times, most recently from e0aeb31 to bf8764f Compare February 21, 2023 21:14
@davecgh davecgh force-pushed the multi_always_active_forced_choice_deployment_flag branch 3 times, most recently from 148e0e7 to 5982282 Compare February 25, 2023 09:35
Copy link
Member

@jholdstock jholdstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add some hard-coded safeguards to ensure that force choice can never be used on mainnet (either accidentally or maliciously).

chaincfg/init_test.go Outdated Show resolved Hide resolved
chaincfg/init_test.go Outdated Show resolved Hide resolved
internal/blockchain/error.go Show resolved Hide resolved
@davecgh davecgh force-pushed the multi_always_active_forced_choice_deployment_flag branch from 5982282 to 3559b0c Compare February 25, 2023 20:11
@davecgh
Copy link
Member Author

davecgh commented Feb 25, 2023

I wonder if we should add some hard-coded safeguards to ensure that force choice can never be used on mainnet (either accidentally or maliciously).

Not a bad idea. I don't see any way it could realistically be exploited short of modifying the code (which one could always do anyway) because there are no CLI options or anything to control it, but it's good to be paranoid about such things.

I've added a check during chain initialization to reject it.

Currently, the lack of an entry for a given deployment in the chain
parameters for a given network is treated the same as the deployment
being active.  This behavior is primarily in order to support testing
without needing to go through the entire voting process on testing
networks such as the simulation network as well as allows rule changes
on newer versions of testnet networks that were previously accepted on
prior versions.

However, the existing approach has been pointed out on several occasions
as being surprising behavior by those working on new consensus changes
and it also means testing the voting process itself for new rule changes
prior to their release requires a cumbersome sequence of not so obvious
steps.  Further, it also makes those historical pruned rule changes
invisible to RPCs like getblockchaininfo.

In order to address the aforementioned inconveniences, this adds a new
parameter to the per-network chain parameters to specify a vote choice
that should always be considered as having been the majority result of a
vote and updates the relevant logic in blockchain accordingly to respect
it.

The new approach does not suffer from the aforementioned inconveniences
as it permits a simple single line modification to allow the voting
process to be tested as well as makes automatically activated historical
rules visible to the RPCs like getblockchaininfo.

Finally, this also adds previously pruned deployment parameters back to
the relevant network parameters with the new field set to force them to
be active.
@davecgh davecgh force-pushed the multi_always_active_forced_choice_deployment_flag branch from 3559b0c to 5218eb1 Compare February 27, 2023 08:31
@davecgh davecgh merged commit 5218eb1 into decred:master Feb 28, 2023
@davecgh davecgh deleted the multi_always_active_forced_choice_deployment_flag branch February 28, 2023 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test coverage Discussion and pull requests for improving test coverage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow forcing a vote result in network parameters.
3 participants