feat(platform)!: halve contested name fee in protocol 14 - #4634
feat(platform)!: halve contested name fee in protocol 14#4634QuantumExplorer wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughProtocol 14 now uses a 10,000,000,000-credit contested document fee. New fee-version constants define this value. Tests cover fee validation, transition construction, and vote balance calculations across protocol versions. ChangesContested document fee
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Protocol 14 correctly activates the 0.1 DASH contested contribution while earlier versions retain their historical fee. No actionable merge risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
✅ Final review complete — no blockers (commit 3a1cada) · triage: critical |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v4.2-dev #4634 +/- ##
============================================
- Coverage 87.88% 84.79% -3.10%
============================================
Files 2766 2796 +30
Lines 360586 375662 +15076
============================================
+ Hits 316904 318537 +1633
- Misses 43682 57125 +13443
🚀 New features to boost your workflow:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Verified the complete PR diff at head 5f4496f and confirmed the Phase-2 reviewers' conclusion: no actionable in-scope defects. The new fee snapshot halves the contested-document contribution only for protocol 14, preserves historical and unrelated fees, and remains consistent with transition construction, exact-payment validation, and contest-balance accounting. Independently reran all 31 targeted Rust tests successfully; git diff --check passed and the worktree remains unchanged.
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
Review provenance
- Triage:
criticalbygpt-6-astra(effort low) — The change alters consensus-sensitive, protocol-gated fee validation and prefunded contest balances across all contested indexes, so incorrect activation or historical fee preservation could cause transaction rejection, inconsistent state transitions, or misallocated funds. - Phase 1 reviewers: not run (skipped for throughput: 21 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— security-auditor (completed, effort xhigh); agentphase2-reviewer
|
Tests not passing? |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The protocol-14 fee change is correctly isolated to the contested-document contribution and preserves the historical protocol fee schedules. The implementation consistently selects the active fee configuration, and the targeted regression coverage verifies both the reduced protocol-14 amount and unchanged earlier behavior. Two documentation and maintainability issues remain in the changed fee/versioning surface.
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: glm-5.3-flash (agent: phase1-reviewer, role: security-auditor); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
Review provenance
- Triage:
criticalbygpt-6-astra(effort low) — This changes consensus-critical protocol fee parameters and exact-payment validation for contested registrations, directly affecting funds and protocol-version behavior across DPNS and other contested indexes. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort max); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort max); agentphase1-reviewer,glm-5.3-flash— security-auditor (completed, effort max); agentphase1-reviewer - Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— security-auditor (completed, effort xhigh); agentphase2-reviewer
🟡 3 suggestion(s)
2 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-platform-version/src/version/v14.rs`:
- [SUGGESTION] packages/rs-platform-version/src/version/v14.rs:33-36: Update the v14 change inventory to include the contested-fee reduction
The module header says v14 hosts five consensus changes, but its later summary says that, before ranked or time-range grammar is used, the only behavior changes are the shared-prefix fix, contested-index cross-check, index-reorder compatibility fix, and relative daily withdrawal limit. This PR adds another consensus-visible v14 behavior change: contested-document contributions change from 0.2 DASH to 0.1 DASH. Leaving the inventory unchanged makes the protocol-upgrade documentation factually incomplete and can cause reviewers or operators to miss the fee change.
- [SUGGESTION] packages/rs-platform-version/src/version/v14.rs:133-136: Add the contested-fee reduction to the v14 behavior summary
The conditional v14 summary explicitly enumerates all behavior changes that apply before a contract uses ranked or time-range grammar, but it omits the new contested-document contribution. Since the fee reduction applies immediately to every contested index under protocol 14, the summary should mention it alongside the other listed changes.
In `packages/rs-platform-version/src/version/fee/v3.rs`:
- [SUGGESTION] packages/rs-platform-version/src/version/fee/v3.rs:5-10: Document the deliberate mismatch between FEE_VERSION3 and fee-version lookup identity
FEE_VERSION3 inherits `fee_version_number: 1`, while `FeeVersion::as_static()` resolves that number through `FEE_VERSIONS` and therefore returns FEE_VERSION1. FEE_VERSION3 now differs from FEE_VERSION1 in the contested-document contribution, so a future caller that uses `as_static()` to recover the active fee schedule can silently obtain the old 20-billion-credit value. The inherited number is intentional for the existing storage-refund persistence scheme, but the new fee field makes the hazard materially more visible. Add an explicit warning at the constant or otherwise make the lookup API unable to present FEE_VERSION1 as FEE_VERSION3.
| /// Introduced in protocol version 14 (4.2). | ||
| pub const FEE_VERSION3: FeeVersion = FeeVersion { | ||
| // Contested contributions use the active protocol, so unchanged storage | ||
| // rates retain the historical fee_version_number inherited from FEE_VERSION2. | ||
| vote_resolution_fund_fees: VOTE_RESOLUTION_FUND_FEES_VERSION2, | ||
| ..FEE_VERSION2 |
There was a problem hiding this comment.
🟡 Suggestion: Document the deliberate mismatch between FEE_VERSION3 and fee-version lookup identity
FEE_VERSION3 inherits fee_version_number: 1, while FeeVersion::as_static() resolves that number through FEE_VERSIONS and therefore returns FEE_VERSION1. FEE_VERSION3 now differs from FEE_VERSION1 in the contested-document contribution, so a future caller that uses as_static() to recover the active fee schedule can silently obtain the old 20-billion-credit value. The inherited number is intentional for the existing storage-refund persistence scheme, but the new fee field makes the hazard materially more visible. Add an explicit warning at the constant or otherwise make the lookup API unable to present FEE_VERSION1 as FEE_VERSION3.
| /// Introduced in protocol version 14 (4.2). | |
| pub const FEE_VERSION3: FeeVersion = FeeVersion { | |
| // Contested contributions use the active protocol, so unchanged storage | |
| // rates retain the historical fee_version_number inherited from FEE_VERSION2. | |
| vote_resolution_fund_fees: VOTE_RESOLUTION_FUND_FEES_VERSION2, | |
| ..FEE_VERSION2 | |
| /// Introduced in protocol version 14 (4.2). | |
| /// | |
| /// `fee_version_number` intentionally remains 1 for compatibility with the | |
| /// persisted storage-fee history. Do not use `FeeVersion::as_static()` to | |
| /// recover this complete fee schedule: that lookup resolves number 1 to | |
| /// `FEE_VERSION1`, not this protocol-14 configuration. | |
| pub const FEE_VERSION3: FeeVersion = FeeVersion { |
source: ['codex']
Issue being fixed or feature implemented
Reduce the contested DPNS registration contribution from 0.2 DASH to 0.1 DASH when protocol 14 activates.
What was done?
FEE_VERSION3andVOTE_RESOLUTION_FUND_FEES_VERSION2, selected by protocol 14, with a contested-document contribution of 10,000,000,000 credits. Protocols 1–13 retain 20,000,000,000 credits.fee_version_numberremains 1, as inFEE_VERSION2, because contest contributions use the active protocol configuration and historical storage rates are unchanged.This is the shared contested-document parameter, so the reduction also applies to contested indexes in other data contracts. Existing contest balances require no migration.
How Has This Been Tested?
Local Rust checks: 31 passed, 0 failed.
cargo test --locked --offline -p platform-version --lib: 18 passed. The new regression test failed before the fee change and passed afterward; it also verifies that every other fee matches protocol 13.cargo test --locked --offline -p drive-abci --lib advanced_structure_v1::tests: 7 passed, including construction and exact-payment checks at protocols 13 and 14.cargo test --locked --offline -p drive-abci --lib test_document_creation_on_contested_unique_index: 5 passed, exercising contested DPNS registration through the transaction pipeline.cargo test --locked --offline -p drive-abci --lib test_protocol_change_v13_to_v14: the existing protocol-upgrade dispatcher regression passed.cargo fmt --check --allandgit diff --checkpassed.Commands used isolated build directories. No live network upgrade rehearsal was performed.
Breaking Changes
After protocol 14 activates, contested registrations must supply exactly 0.1 DASH; the previous 0.2 DASH contribution is rejected by the existing exact-payment validation. Earlier protocols retain their existing behavior. Clients must construct transitions using the active protocol version.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes