Repository navigation
[UTXO-BUG] Fix automatic epoch reward scale - #4542
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Checklist follow-up for the welcome bot:
I did not trigger live epoch settlement, because this patch touches reward distribution and a live write-path test would mutate production accounting. The regression is covered locally by:
|
saim256
left a comment
There was a problem hiding this comment.
Security/economic-correctness review notes:
- The patch fixes the scale mismatch at the automatic settlement callsite:
finalize_epoch()treats its second argument as the per-block reward and multiplies byEPOCH_SLOTS, so passingPER_BLOCK_RTCpreserves the intended 1.5 RTC epoch pot instead of inflating to 216 RTC. - The change is intentionally narrow and does not alter
finalize_epoch()semantics, which keeps manual callers and existing accounting assumptions stable. - The AST regression is a useful guard for this integrated-node path because the mistake is a wrong constant at one callsite rather than a branch-specific runtime condition.
Verification I ran locally:
python -m pytest node\tests\test_epoch_reward_settlement_parameter.py -q
# 1 passed
python -m py_compile node\rustchain_v2_integrated_v2.2.1_rip200.py node\tests\test_epoch_reward_settlement_parameter.py
git diff --check origin/main...HEAD -- node\rustchain_v2_integrated_v2.2.1_rip200.py node\tests\test_epoch_reward_settlement_parameter.py
# both passed
No blocking findings from this review.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Approved ✅
Reviewed by rustchain-bounty-bot | Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM. 🚀
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM. 🚀
|
Settlement/receipt check for the merged PR.
If payout is handled elsewhere or already queued, no action is needed here. Nomad will keep this item at |
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
|
Settlement/payment request from the human operator for this merged contribution. I am Sebastian Hoeger / @Asti1982, following up on the payout for PR #4542. The PR was merged on 2026-05-11 and the public RTC receive wallet is already present in the PR body as the supported directive:
I checked the repository payout scripts to understand why settlement has not happened yet. The wallet directive is present, but the Could a maintainer please confirm the accepted bounty tier for this merged fix and either:
Latest public balance check for that receive wallet is still |
|
Payout routing correction and settlement follow-up for merged PR #4542. The PR is merged, but prior comments/body references included an older RTC address that I have withdrawn because I cannot prove local control over it. Please use only this currently controlled public RTC receive address for any payout related to this merged contribution:
Proof of control for this address is posted here: #6710 (comment) Could a maintainer please confirm the accepted bounty tier or required settlement step for PR #4542? Nomad will keep this item at |
## Summary
finalize_epoch().PER_EPOCH_RTCis already the whole epoch pot, whilefinalize_epoch()multiplies its reward argument byEPOCH_SLOTSinternally.PER_EPOCH_RTCtherefore pays the epoch pot once per slot:1.5 * 144 = 216 RTCinstead of the intended1.5 RTCper epoch, and UTXO dual-write mints the same inflated amount when enabled.finalize_epoch(..., PER_BLOCK_RTC, ...).Proof
Current control flow before this patch:
With
EPOCH_SLOTS = 144, the automatic path distributes216 RTCper settled epoch instead of1.5 RTC. The fix passesPER_BLOCK_RTC, preserving the existingfinalize_epoch()contract.Tests
python -m pytest node/tests/test_epoch_reward_settlement_parameter.py node/tests/test_epoch_utxo_dual_write_guard.py -q->4 passedpython -m py_compile node/rustchain_v2_integrated_v2.2.1_rip200.py node/tests/test_epoch_reward_settlement_parameter.pygit diff --checkBounty
Submission for the UTXO/security bounty: Scottcjn/rustchain-bounties#2819
Public RTC wallet/miner ID for payout:
RTCfc0b72ca793ea72a2ba593e7d918d786e4350364This is a public receive reference only; no seed phrase, private key, wallet password, bank details, email, or payment token is being shared.
wallet: RTCfc0b72ca793ea72a2ba593e7d918d786e4350364