Skip to content

dgb(test): pin LIVE make_coin_params subsidy_func binding - #334

Merged
frstrtr merged 1 commit into
masterfrom
dgb/subsidy-binding-kat
Jun 22, 2026
Merged

dgb(test): pin LIVE make_coin_params subsidy_func binding#334
frstrtr merged 1 commit into
masterfrom
dgb/subsidy-binding-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Fenced test-only slice (src/impl/dgb/test/ only), no consensus-value change.

What

Adds DgbCoinParams.SubsidyFuncBoundToOracleScheduleInProduction to dgb_work_source_test.

Why

The existing era-boundary tests run off kSubsidyFunc, a hand-written DUPLICATE of params.hpp p.subsidy_func. They prove the subsidy schedule math but are blind to a regression in the actual production wiring. If make_coin_params() shipped subsidy_func unbound (the work source then logs subsidy_func=UNSET and the embedded coinbasevalue silently degrades to the external-GBT-only path) or bound it to the wrong function, every existing test would still pass off its private copy.

This pins the LIVE binding directly: it pulls make_coin_params(false).subsidy_func, asserts it is bound (non-null), and that it reproduces the oracle subsidy at every reward-era boundary (and matches the schedule the rest of the file trusts).

Scope / gating

The era-boundary tests trust kSubsidyFunc, a hand-written duplicate of
params.hpp p.subsidy_func. They pin the schedule math but are blind to a
regression in the actual production wiring: if make_coin_params() shipped
subsidy_func unbound (work source logs subsidy_func=UNSET, embedded
coinbasevalue silently degrades to the external-GBT-only path) or bound it
to the wrong function, every existing test would still pass off its private
copy. Add DgbCoinParams.SubsidyFuncBoundToOracleScheduleInProduction: pull
the real make_coin_params(false).subsidy_func, assert it is bound, and that
it reproduces the oracle schedule at every reward-era boundary.

Fenced test-only (src/impl/dgb/test/), no consensus-value change; extends an
existing CI target so no allowlist/drift-guard change.
@frstrtr
frstrtr merged commit 24ef634 into master Jun 22, 2026
31 checks passed
@frstrtr
frstrtr deleted the dgb/subsidy-binding-kat branch June 22, 2026 17:08
frstrtr added a commit that referenced this pull request Jun 23, 2026
The era-boundary tests trust kSubsidyFunc, a hand-written duplicate of
params.hpp p.subsidy_func. They pin the schedule math but are blind to a
regression in the actual production wiring: if make_coin_params() shipped
subsidy_func unbound (work source logs subsidy_func=UNSET, embedded
coinbasevalue silently degrades to the external-GBT-only path) or bound it
to the wrong function, every existing test would still pass off its private
copy. Add DgbCoinParams.SubsidyFuncBoundToOracleScheduleInProduction: pull
the real make_coin_params(false).subsidy_func, assert it is bound, and that
it reproduces the oracle schedule at every reward-era boundary.

Fenced test-only (src/impl/dgb/test/), no consensus-value change; extends an
existing CI target so no allowlist/drift-guard change.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
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