fix(drive-abci)!: pay every reward share of a masternode and credit each identity once in the epoch payout (PV15) - #4986
QuantumExplorer wants to merge 9 commits into
Conversation
… it (PV14) The epoch payout built one AddToIdentityBalance per reward share and per proposer. Each is converted against the balance before the batch, so an identity owed two credits in one payout (two masternodes naming the same payToId, or a proposer that is also a payToId) received only one of them. add_epoch_pool_to_proposers_payout_operations v1 (protocol version 14) adds up the credits per identity first and builds one operation each. Generation 0 stays as it is; no reward share document can be written at any protocol version so far. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe payout method now supports generation 1. It allocates proposer and reward-share credits, combines credits owed to the same identity, and uses the configured method version to select the implementation. ChangesEpoch proposer payouts
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant PayoutMethod as Generation 1 payout method
participant IdentityBalance as Identity balance lookup
participant BalanceOperations as AddToIdentityBalance operations
PayoutMethod->>IdentityBalance: Check payToId balance
IdentityBalance-->>PayoutMethod: Balance availability
PayoutMethod->>BalanceOperations: Accumulate credits by identity
PayoutMethod->>BalanceOperations: Batch converted operations
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The version-14 payout change has no identified merge-blocking issue and is ready for normal merge checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
|
🕓 Review not started yet because this PR is a draft.
Commit e231b28. Normal review starts when eligible; priority review starts as soon as a slot is available. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
The protocol-14 payout implementation correctly aggregates all credits owed to each identity before creating balance operations, while protocol 13 remains on the unchanged generation 0 path. The dispatcher, version table, deterministic ordering, checked arithmetic, and regression coverage are consistent with the stated fix; no actionable in-scope defects were identified.
Review provenance
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
criticalbygpt-6-astra(effort low) — The diff is a substantial change to add_epoch_pool_to_proposers_payout_operations that alters consensus-visible funds movement and identity balance credits across protocol generations. - Phase 1 reviewers: not run (skipped for throughput: 18 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— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (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
|
Bots are done — your move: post |
…sternode (PV14) Review follow-ups on the payout's generation 1: - a reward share whose payToId names no identity stays with its masternode instead of failing the payout - the last proposer's payout uses a checked add, and the proposer index and count are no longer truncated to u16 - tests: a recipient with a debt repays it once from its combined credit, a share naming no identity, the PV13 test framed as a reproduction, the v1 test named with "should" - the share document helper derives its id from the owner and payToId instead of an unseeded random id - the dispatcher and v1 docs name what the method returns Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The PV14 dispatch and per-identity payout aggregation are correctly versioned, and the prior-generation behavior remains isolated. One blocking correctness gap remains: the new implementation still uses a reward-share query capped at one document, so it does not process every reward share permitted for a masternode owner.
🔴 1 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: architecture-layering); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: platform-versioning); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 8: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 9: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 10: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 11: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 12: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
criticalbygpt-6-astra(effort low) — The substantial v1 rewrite of add_epoch_pool_to_proposers_payout_operations changes consensus payout and identity-balance crediting logic, directly affecting funds movement in a critical Drive ABCI surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— architecture-layering (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— platform-versioning (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 67% left, 5h 0% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer
🤖 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-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/v1/mod.rs`:
- [BLOCKING] packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/v1/mod.rs:104-110: v1 still processes only one reward-share document per owner
This generation obtains reward shares through `fetch_reward_shares_list_for_masternode`, whose v0 query sets `limit: Some(1)`. The reward-share schema's `ownerId` index is non-unique; only the combined `(ownerId, payToId)` index is unique, so one owner can have multiple valid reward-share documents with different recipients. In that state, every document after the first is omitted: its recipient is not credited and its percentage is not subtracted from `masternode_payout_leftover`, leaving the masternode with funds that should have been distributed. That contradicts v1's stated guarantee of crediting everything owed by the payout. Remove the one-document limit through a versioned all-documents query path and add a regression test with multiple shares owned by the same masternode.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Drive-side balance additions remain non-compositional outside the payout path — The Drive implementation of
add_to_identity_balance_operations_v0reads the pre-batch balance and materializes a replacement value, so repeatedAddToIdentityBalanceoperations for one identity can still lose credits. Batch transition conversion flattens multiple document and token actions, including purchase actions that can pay the same seller or contract owner. This is a concrete pre-existing issue, but this PR correctly fixes the epoch-payout caller by aggregating credits in rs-drive-abci and does not introduce or widen the Drive-side behavior.- Follow-up: Track a separate versioned rs-drive fix that coalesces repeated identity-balance additions, with tests covering multiple purchases and other callers.
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
…n every replace of a transferable document (PV14) (#4982) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nce (PV14) (#4983) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… payout (PV14) fetch_reward_shares_list_for_masternode v0 asked for one document, so a masternode's other reward shares were never paid. v1 (protocol version 14) returns all of them. With every share counted, a masternode's shares could add up to more than its payout, which would fail the payout on the leftover subtraction. The payout's generation 1 now pays the shares in the order they are read until the masternode's payout is used up; a share larger than what is left gets what is left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the complete diff at dfd3fa7: the prior single-share blocker is fixed, both new generations activate only at PV14, and earlier production behavior is preserved. Two non-blocking suggestions remain: pin the order-sensitive test's expected balances and avoid cloning owned query results. Local validation passed 11 focused payout/query tests, 41 surrounding fee-pool/block-end tests, 25 platform-version tests, and git diff --check; the worktree remains unchanged.
🟡 2 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: architecture-layering); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: platform-versioning); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 5: muse-spark-1.3-contributor (agent: phase1-reviewer, role: security-auditor); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 7: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 8: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 9: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 10: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 11: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 12: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 13: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 14: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 15: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
criticalbygpt-6-astra(effort low) — The diff is large and intricate and directly changes consensus-critical funds movement in add_epoch_pool_to_proposers_payout_operations, including epoch reward allocation and identity balance credits. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— architecture-layering (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— platform-versioning (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— security-auditor (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 35% left, 5h 0% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (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,gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (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
🤖 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-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/mod.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/add_epoch_pool_to_proposers_payout_operations/mod.rs:467-472: Pin the recipient balances in the order-sensitive payout test
This assertion accepts either share being paid first, although those outcomes produce different identity balances and state roots. The new cap makes query traversal order part of payout behavior, so accidentally reversing the document iterator would still pass both this assertion and the credit-conservation check. The fixture now uses deterministic document IDs; assert the exact balances for its defined read order so the regression protects payment priority as well as conservation. Running the same fixture with reversed insertion order would additionally check that insertion order does not determine priority.
In `packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/fetch_reward_shares_list_for_masternode/v1/mod.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/execution/platform_events/fee_pool_outwards_distribution/fetch_reward_shares_list_for_masternode/v1/mod.rs:83: Move the queried documents instead of cloning the entire result
The query outcome owns the returned documents and is discarded immediately, but `documents().to_owned()` deep-clones the vector and its documents, including property maps and buffers. With v1 removing the one-document limit, these avoidable allocations now grow with every reward share returned for each proposer. The already-imported `QueryDocumentsOutcomeV0Methods` trait provides `documents_owned(self)`, which moves the existing vector without changing query behavior.
…uery results - should_pay_shares_over_the_whole_payout_until_it_is_used_up asserts the exact balances for document id read order, and runs the shares written in both orders - test_mn_share_document_id exposes the helper's document id - fetch_reward_shares_list_for_masternode v1 moves the queried documents instead of cloning them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete diff at the exact head and found no remaining in-scope issues. Both new generations activate only at PV14, preserve historical production implementations, and address all three prior findings. Local validation passed: 11 focused payout/query tests, 41 surrounding fee-pool/block-end tests, 25 platform-version tests, and git diff --check; the worktree remains unchanged.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gemini-3.8-flash-high (agent: phase1-reviewer, role: architecture-layering); reviewer 3: gemini-3.8-flash-high (agent: phase1-reviewer, role: platform-versioning); reviewer 4: gemini-3.8-flash-high (agent: phase1-reviewer, role: rust-quality); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 8: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); reviewer 9: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 10: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 11: gpt-6-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 12: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
criticalbygpt-6-astra(effort low) — The new add_epoch_pool_to_proposers_payout_operations/v1/mod.rs implements intricate consensus-critical funds distribution, aggregating overlapping identity credits, retaining missing-recipient shares, and capping ordered reward shares against remaining payouts, alongside protocol-version gating and expanded share retrieval. - Phase 1 reviewers:
gemini-3.8-flash-high— general (completed, effort high); agentphase1-reviewer,gemini-3.8-flash-high— architecture-layering (completed, effort high); agentphase1-reviewer,gemini-3.8-flash-high— platform-versioning (completed, effort high); agentphase1-reviewer,gemini-3.8-flash-high— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
gemini-3.8-flash-high— antigravity quota: weekly 35% left, 5h 100% left - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— platform-versioning (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— rust-quality (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
#4985) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#4985 landed first with its own add_epoch_pool_to_proposers_payout_operations v1. This PR folds into it in place: the per-identity sum (add_owed_credits), usize proposer index and checked last-payout add join #4985's block-batch hand-off, skip of a payToId without a balance and share cap. #4985's v1 tests are kept; the copied should_pay_every_proposer_and_its_reward_share is dropped as covered by them. The v14.rs item moves to 43. The dispatcher tests now apply the payout in epoch 1, and the debt test asserts that the credit sum balances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue being fixed or feature implemented
When an epoch is paid out,
add_epoch_pool_to_proposers_payout_operationsbuilds oneAddToIdentityBalanceoperation for each masternode reward share (payToId) and one for each proposer. Each is converted against the identity's balance before the batch and writesprevious balance + credit.Two gaps in how that payout credits its recipients:
fetch_reward_shares_list_for_masternodev0 queries withlimit: Some(1). The contract's only unique index is(ownerId, payToId), so a masternode may have several shares, and every share after the first was never paid; its part stayed with the masternode.payToId, or a proposer that is also apayToId, give one identity two operations that both start from the same balance. Generation 0 converted them into one grove batch, which keeps only the last write to a key, so the identity received one of its credits and the payout no longer added up to what left the epoch's pools.#4985 (merged) already gave the payout a generation 1 that hands its credits to the block's
apply_drive_operations, which at protocol version 14 merges every write of one identity balance into one, skips a share whosepayToIdhas no balance, and caps each share at what is left of the masternode's payout. This PR builds on that generation in place.No
rewardSharedocument can be written at any protocol version so far (the reject data trigger covers create, replace and delete in every trigger binding list), so every payout made so far credited distinct proposer identities and is unaffected.TODO
v4.3-devand everything it gates at 14 moves to 15, once protocol version 15 exists (v4.3-devonly hasv14.rsso far):v4.3-dev(againstv4.3-devthe diff also shows thev4.2-devcommits it does not have yet, #4982, #4983 and #4985);add_epoch_pool_to_proposers_payout_operationsv1 ships with protocol version 14 as #4985 left it, so it goes back to that version, and the per-identity sum, theusizeproposer index and the checked last-payout add move into a new v2 selected at 15;DRIVE_ABCI_METHOD_VERSIONS_V10goes back to its shipped values (fetch_reward_shares_list_for_masternode0, the payout slot and its comment as fix(platform)!: credit repaid identity debt to the processing fee pool #4985 left them), and the protocol version 15 table selectsfetch_reward_shares_list_for_masternode1 and the payout v2;v14.rsitem 43 moves to the protocol version 15 notes;What was done?
fetch_reward_shares_list_for_masternodev1, selected at protocol version 14 for now (DRIVE_ABCI_METHOD_VERSIONS_V10; moves to 15, see TODO). It returns every reward share of the masternode (limit: None) and moves the queried documents instead of cloning them. v0 is unchanged; its tests are pinned to protocol version 13.add_epoch_pool_to_proposers_payout_operationsv1 (from fix(platform)!: credit repaid identity debt to the processing fee pool #4985, edited in place for now; moves to a v2 at 15, see TODO):BTreeMap, then hands the block oneAddToIdentityBalanceper identity. The payout no longer depends on the batch merging its writes.usizeinstead of being cast tou16.v14.rsrecords the change as item 43, after fix(platform)!: credit repaid identity debt to the processing fee pool #4985's item 42.create_test_mn_share_documentin the drive-abci test helpers is nowpuband takes the recipient's id, so a test can name any identity, or none. It derives the document id from the owner andpayToId(a unique pair under the contract's index, exposed astest_mn_share_document_id) instead ofIdentifier::random().Example: two shares from one masternode, P1 sharing 30% with R and 20% with P2. Each masternode's payout is
m.Shares over the whole payout, P1 sharing 80% with R and 50% with P2:
One identity owed several credits, where P1 and P2 each share with R (30% and 20%) and P3 shares 10% with P1:
How Has This Been Tested?
The dispatcher tests below run through the distribution dispatcher and apply the payout the way the block does (in the epoch after the paid one), so the epoch is marked paid and the credit sum can be checked. They run on the Drive batching configuration a node ships with (
batching_consistency_verificationoff).should_credit_an_identity_everything_one_payout_owes_it(latest protocol version): the shared-recipient payout above. Each identity's balance equals what it is owed, andcalculate_total_credits_balancebalances.should_repay_a_recipients_debt_once_from_everything_one_payout_owes_it(latest): the same payout with R holding a debt. The debt comes out of R's combined credit once, R's negative balance ends at 0, and the credit sum balances (the repaid debt reaches the processing fee pool).should_leave_a_share_naming_no_identity_with_its_masternode(latest): P1 shares 30% with an id no identity holds. Every proposer gets its whole payout and the credit sum balances.should_pay_every_reward_share_of_one_masternode(latest): P1 shares with R and P2. Both are paid and the credit sum balances. It fails withfetch_reward_shares_list_for_masternodeat 0.should_pay_shares_over_the_whole_payout_until_it_is_used_up(latest): P1 shares 130% of its payout. The share with the lower document id is paid in full, the other gets the rest, P1 keeps 0, and the credit sum balances. The shares are written in both orders and the balances are the same.should_reproduce_the_lost_credits_of_generation_0_at_protocol_version_13: the shared-recipient payout at protocol version 13. R and P1 each miss a credit, and the credit sum is short by exactly the missing credits.fix(platform)!: credit repaid identity debt to the processing fee pool #4985's generation 1 tests in
v1/mod.rskeep passing.cargo test -p drive-abci --lib -- add_epoch_pool_to_proposers_payout_operations fetch_reward_shares_list_for_masternode: 13 passed.cargo test -p drive-abci --lib -- fee_pool block_processing_end_events: 44 passed.cargo test -p platform-version: passed.cargo fmt --all,cargo clippy -p drive-abci --all-features --all-targets -- -D warningsandcargo check --workspace --all-targetsare clean.Breaking Changes
Consensus change at protocol version 15 once the TODO is done (at 14 on the branch today): every reward share of a masternode is paid (up to its payout), and the payout credits each identity with one operation. Earlier protocol versions keep generation 0 of both methods.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code