-
Notifications
You must be signed in to change notification settings - Fork 172
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
polls, voting, staking: Enhance voting consensus rules to allow for changeable magnitude weight factor and enhance CBR #2781
Draft
jamescowens
wants to merge
17
commits into
gridcoin-community:development
Choose a base branch
from
jamescowens:enhance_voting_consensus_rules
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
jamescowens
force-pushed
the
enhance_voting_consensus_rules
branch
6 times, most recently
from
October 27, 2024 18:16
5c128f3
to
47a2ba2
Compare
jamescowens
force-pushed
the
enhance_voting_consensus_rules
branch
from
November 3, 2024 00:52
47a2ba2
to
3c6a501
Compare
This commit adds DefaultConstantBlockReward ConstantBlockRewardFloor ConstantBlockRewardCeiling DefaultMagnitudeUnit DefaultMagnitudeWeightFactor to consensus parameters.
Extends the fraction class with a FromString method to support parsing of a string representation of a fraction (i.e. "1/4") into a formal fraction object.
This new method provides the ability to find the last version of a key that exists with a timestamp prior to or equal to the provided timestamp.
This refactors GetConstantBlockReward to use the blockchain consensus paramters, removes the lookback limitation for block v13+ to correspond with the removal of the contract lookback window for protocol entries, and corrects the behavior of the lookup if the input index is not at pIndexBest.
This fixes a compile error on ambiguous method with WIN32/64
This separates out the calculation of network weight from nBits contained in GetActiveNetworkWeight and extends it with two forms (overloads).
GetMagnitudeWeightFactor should return zero if index argument is a nullptr.
jamescowens
force-pushed
the
enhance_voting_consensus_rules
branch
from
December 15, 2024 23:46
3c6a501
to
ca935a3
Compare
The magnitude unit has been fixed at 1/4 since Fern. This commit allows the magnitude unit to be changed via a protocol entry for block V13+.
jamescowens
force-pushed
the
enhance_voting_consensus_rules
branch
from
December 16, 2024 06:26
3f9c7a0
to
6c47db9
Compare
The contract version for V13+ is 3 and the legacy handler is not supposed to be used.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a tracking PR for the work to enhance the polls/voting consensus rules to allow for different magnitude weight factor that assigns weight to magnitude for the purposes of vote weight of individual votes and AVW. This PR also refactors the GetBlockReward function to properly work with revised CBR values in the protocol registry and expands the clamp to anticipate a larger upper end value for CBR in the future.
This is work that will enable parts of gridcoin-community/Gridcoin-Tasks#268.