dgb(test): pin LIVE make_coin_params subsidy_func binding - #334
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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