feat(platform)!: masternode votes cost 80% less (PV14) - #4959
Conversation
A masternode vote takes contested_document_single_vote_cost from the contest's prefunded balance. At protocol version 14 that cost drops from 10,000,000 credits (0.0001 Dash) to 2,000,000 (0.00002 Dash), so a DPNS contender's 0.1 Dash funds 5,000 votes instead of 1,000 and a busy contest is far less likely to run dry and refuse later votes. Amended in VOTE_RESOLUTION_FUND_FEES_VERSION2, which only protocol version 14 uses. The voting strategy test that pins a latest-version fee is re-pinned and gains a protocol version 13 twin that keeps the old 0.0001 Dash baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 28 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 8th in line, estimated start in ~1.5 h (commit 9c7033f)
|
Issue being fixed or feature implemented
Every masternode vote takes a fixed cost from the contest's prefunded balance, the fund the contenders pay when they apply. At 0.0001 Dash a vote, a DPNS contender's 0.1 Dash (protocol version 14) funds 1,000 votes. Each masternode may vote or change its vote up to 5 times per contest, so a well-attended contest can empty its fund; once it is empty, later votes are refused unpaid, and the outcome then depends partly on who voted first. This makes votes 80% cheaper at protocol version 14.
What was done?
contested_document_single_vote_costis 2,000,000 credits (0.00002 Dash) inVOTE_RESOLUTION_FUND_FEES_VERSION2, the vote resolution fund schedule ofFEE_VERSION3, which only protocol version 14 uses; it is amended in place, as the unreleased version's own schedule. Protocol versions 1 to 13 keep 10,000,000 credits (0.0001 Dash).The cost still exceeds the masternode vote's minimum fee (100,000 credits), so the refusal of a vote on a fund below one vote's cost is unchanged. As before, the vote cost goes to the epoch's processing fee pool and whatever the votes leave of the fund is released as processing fees when the contest is cleaned up, so the contenders pay the same in total: only the split between vote time and clean-up moves.
Before (protocol version 14, a two-contender DPNS contest, each contender prefunding 0.1 Dash):
After:
In-place changes to shipped generations
None.
VOTE_RESOLUTION_FUND_FEES_VERSION2andFEE_VERSION3are selected only by protocol version 14.How Has This Been Tested?
should_change_only_the_contested_document_and_once_per_identity_fees_at_protocol_14(platform-version) now pins the new vote cost at 14 and the old one at every version from 1 to 13.run_chain_with_voting_after_won_by_identity_with_specialized_funds_distributionpins the processing fees of an epoch with 5 votes plus the remainder of a 19-vote contest; it is re-pinned (19,972,000,000) and runs through a helper with a new_protocol_version_13twin that keeps the old baseline (39,860,000,000: a 0.2 Dash fund per contender and 0.0001 Dash votes). Both runs cast the same votes.Run locally:
cargo test -p platform-version --lib: 22 passed.cargo test -p drive-abci --libfiltered tomasternode_vote,contested,dpns,processor,execution_event,vote: 257 passed.cargo test -p drive-abci --test strategy_tests voting_tests: 8 passed (the 7 voting strategy tests and the new twin).cargo fmt --all;cargo clippy -p platform-version -p drive-abci --all-features --all-targets -- -D warnings: clean.Breaking Changes
Consensus at protocol version 14 (unreleased): a masternode vote deducts 2,000,000 credits from the contest's fund instead of 10,000,000. Nothing changes for protocol versions 1 to 13.
Merging next to #4951: both edit
VOTE_RESOLUTION_FUND_FEES_VERSION2and the protocol version 14 fee test on adjacent lines, and #4951's new contest funds table in the fee overview gives the vote as 0.0001 Dash at 14; whichever merges second takes both amounts and updates that row to 0.00002 Dash.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull request (no structure change)For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
9c7033f/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.