Skip to content

dgb(#82): wire CoinParams::subsidy_func into embedded coinbasevalue SSOT - #188

Merged
frstrtr merged 1 commit into
masterfrom
dgb/subsidy-func-embedded-coinbasevalue
Jun 19, 2026
Merged

dgb(#82): wire CoinParams::subsidy_func into embedded coinbasevalue SSOT#188
frstrtr merged 1 commit into
masterfrom
dgb/subsidy-func-embedded-coinbasevalue

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Forward-only #82 embedded-wiring TODO (integrator 2026-06-18): wire CoinParams::subsidy_func(height)+fees into the embedded coinbase builder + a 4-era boundary conformance test, with the external-daemon GBT fallback preserved.

What

  • NEW src/impl/dgb/coin/embedded_coinbase_value.hpp — SSOT routing CoinParams::subsidy_func(height)+total_fees into the embedded coinbasevalue. Mirrors ltc/coin/template_builder.hpp (coinbasevalue = subsidy + total_fees) but sources subsidy through the CoinParams oracle SSOT. First live invocation site for subsidy_func (previously dormant; live path only read GBT m_coinbase_value).
  • resolve_coinbase_value() — external-daemon GBT coinbasevalue is authoritative when present (returned verbatim); embedded derivation used only with no external daemon. GBT fallback MUST PERSIST invariant honored. Unset subsidy_func throws loudly (no silent zero-subsidy).
  • test/test_dgb_coinbase_value.cpp — 4-era boundary conformance THROUGH the subsidy_func indirection + fee composition + GBT-precedence + unset-throws. 5/5 PASS local, build EXIT=0.

Isolation / CI

Note

Header-only SSOT + guard test. The live call-site binding (work_source.cpp Stage 4c TemplateBuilder consumes this helper for its coinbasevalue) lands with the Stage 4c template build; this slice establishes the single definition both the embedded and GBT paths resolve through.

HOLD merge — integrator merges on operator push-approval.

@frstrtr
frstrtr force-pushed the dgb/subsidy-func-embedded-coinbasevalue branch from 0405125 to 82eca8e Compare June 19, 2026 07:51
Adds src/impl/dgb/coin/embedded_coinbase_value.hpp: the single place the DGB
CoinParams::subsidy_func feeds a live coinbase-build path. Until now subsidy_func
was populated in params.hpp (oracle-conformed) but had zero invocation sites; the
live path only read m_coinbase_value off external-daemon GBT.

embedded_coinbase_value(subsidy_func, height, fees) = subsidy_func(height)+fees,
mirroring ltc/coin/template_builder.hpp coinbasevalue = subsidy + total_fees but
sourcing the subsidy through the CoinParams SSOT (oracle decay schedule).

resolve_coinbase_value() preserves the external-daemon fallback: a present GBT
coinbasevalue is authoritative and returned verbatim; the embedded derivation is
used only when no external daemon supplies one. Unset subsidy_func throws loudly.

test/test_dgb_coinbase_value.cpp: 4-era boundary conformance through the
subsidy_func indirection + fee composition + GBT-precedence + unset-throws (5/5).
Registered in test/CMakeLists.txt and both build.yml --target allowlists (#143).

Single-coin; no bitcoin_family/src/core/sibling-coin touch. External-daemon GBT
path unchanged.
@frstrtr
frstrtr force-pushed the dgb/subsidy-func-embedded-coinbasevalue branch from 82eca8e to 0754cca Compare June 19, 2026 08:04
@frstrtr
frstrtr merged commit e3332dd into master Jun 19, 2026
19 checks passed
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