Skip to content

Filter BTC-style sum-vout rewards to pool address for RVN/RTM/BTRM/XNA - #145

Closed
MoneroOcean wants to merge 1 commit into
masterfrom
codex/fix-block-rewards-overcount-bug
Closed

MoneroOcean wants to merge 1 commit into
masterfrom
codex/fix-block-rewards-overcount-bug

Conversation

@MoneroOcean

Copy link
Copy Markdown
Owner

Motivation

  • BTC-style sum-vout reward accounting for some Raven-like ports was summing every coinbase output value as the block reward, which inflates the pool-creditable reward when coinbase enforces mandatory third-party outputs (masternodes/treasury/dev-fund).
  • The intended behavior for pool-backed ports is to only count outputs payable to the pool wallet (or ignore configured addresses), so miners are not over-credited from pool reserves.

Description

  • Added getBtcVoutAddresses(vout) helper and updated parseBtcReward to accept a poolAddress argument and to respect a new rewardPoolAddressOnly flag so that sum-vout mode can skip outputs not paid to the configured pool address and still honor rewardIgnoreAddress when present (lib/coins/core/factories.js).
  • Changed createBtcRpc to pass ctx.runtime.getPoolAddress(ctx.profile) into parseBtcReward when resolving block headers so reward calculation can be pool-address aware (lib/coins/core/factories.js).
  • Enabled rewardPoolAddressOnly: true for the affected profiles RVN, XNA, RTM, and BTRM so those ports use pool-address-only summation (lib/coins/rvn.js, lib/coins/xna.js, lib/coins/rtm.js, lib/coins/btrm.js).
  • Added a regression test that asserts third-party coinbase outputs are ignored while multiple pool-address outputs are summed into the reported reward (tests/pool/coin/basics.js).

Testing

  • Performed static syntax checks with node --check across the changed modules which completed successfully.
  • Executed a targeted Node.js snippet exercising the new reward accounting path which validated the corrected reward (succeeded).
  • Ran the package test harness invocation node --require ./tests/common/test_output_buffer.js --test ... tests/pool/coin/basics.js but it failed to run due to missing test dependencies (protocol-buffers module not installed) and therefore the full test suite was not executed.
  • Attempted npm install to provision test deps but it failed due to registry access returning 403 Forbidden for crypto-js, preventing full automated test execution in this environment.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant