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: Simplify threshold state determination. #3059

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 15, 2023

This is rebased on #3057.

This simplifies the internal logic for determining threshold states for various deployments by introducing a structure to house additional information about a deployment and passing that around as opposed to previous approach of passing around the information needed to lookup the relevant information and associated caches.

The individual structs are created from the chain parameters and stored in a map when the chain instance is initialized.

It also removes the no longer needed deployment version parameters from the StateLastChangedHeight and NextThresholdState methods as well as the no longer resulting unused internal lookupDeploymentVersion method.

This is work towards #3058.

@davecgh davecgh added this to the 1.8.0 milestone Feb 15, 2023
@davecgh davecgh force-pushed the blockchain_simplify_threshold_state_determination branch from edcb2dc to 982c882 Compare February 15, 2023 15:55
@davecgh davecgh force-pushed the blockchain_simplify_threshold_state_determination branch 2 times, most recently from f773228 to 0184f0c Compare February 24, 2023 19:48
internal/blockchain/chain.go Outdated Show resolved Hide resolved
internal/blockchain/thresholdstate.go Show resolved Hide resolved
internal/blockchain/chain.go Show resolved Hide resolved
internal/blockchain/thresholdstate.go Outdated Show resolved Hide resolved
@davecgh davecgh force-pushed the blockchain_simplify_threshold_state_determination branch from 0184f0c to b4e5a67 Compare February 25, 2023 09:32
This simplifies the internal logic for determining threshold states for
various deployments by introducing a structure to house additional
information about a deployment and passing that around as opposed to
previous approach of passing around the information needed to lookup the
relevant information and associated caches.

The individual structs are created from the chain parameters and stored
in a map when the chain instance is initialized.
This removes the deployment version parameter from the
StateLastChangedHeight method on blockchain since it is no longer used
and updates all callers accordingly.
This removes the deployment version parameter from the
NextThresholdState method on blockchain since it is no longer used and
updates all callers accordingly.
This removes the lookupDeploymentVersion method from the test harness
along with the associated map since they are no longer used due to the
removal of the deployment version parameter from NextThresholdState.
@davecgh davecgh force-pushed the blockchain_simplify_threshold_state_determination branch from b4e5a67 to f9f99b9 Compare February 27, 2023 08:25
@davecgh davecgh merged commit f9f99b9 into decred:master Feb 27, 2023
@davecgh davecgh deleted the blockchain_simplify_threshold_state_determination branch February 27, 2023 08:31
@davecgh davecgh added the non-forking consensus Changes that involve modifying consensus code without causing any forking changes. label Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-forking consensus Changes that involve modifying consensus code without causing any forking changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants