dash(underfill): port near-empty-template guard to DASH embedded GBT + KAT#723
Closed
frstrtr wants to merge 1 commit into
Closed
dash(underfill): port near-empty-template guard to DASH embedded GBT + KAT#723frstrtr wants to merge 1 commit into
frstrtr wants to merge 1 commit into
Conversation
Port the 'near-empty template on a non-empty mempool' guard from ltc/doge template_builder.hpp into dash build_embedded_workdata() (the DASH embedded template path), for the mining-hotel deployment. - Same cross-coin pins as LTC/DOGE: UNDERFILL_MIN_FILL_BYTES / UNDERFILL_BACKLOG_SLACK = 50 kB (legacy p2pool near-empty floor). - Trip condition factored into a pure predicate underfill_guard_trips(selected, mempool_bytes, known_fees) so the KAT pins the exact boolean without a log scraper. - selected_bytes accumulated from SelectedTx.base_size (DASH has no witness; base_size IS the wire size the mempool byte cap counts). - Log-only (WARNING, [GBT-EMB] UNDERFILL) exactly like LTC/DOGE: never mutates the template; masternode burn/payee projection and the dashd submitblock fallback path are untouched. - SAFE-ADDITIVE trailing seam bool* underfill_tripped = nullptr (matches the existing curtime/version seam style); every existing caller is byte-for-byte unchanged. - test_dash_underfill_guard.cpp: predicate boundary KATs (empty mempool never trips, fee-unknown backlog never trips, strict slack boundary) + build wiring KATs (fee-known backlog rejected by the stale-input window trips; drained small pool and empty pool do not; DASH payment projection asserted unchanged when tripped; default-seam call identical field-for-field).
Owner
Author
|
Superseded by a clean-named branch (the branch name tripped attribution-gate on the model-name token). Reopening as a new PR with identical commits. |
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.
Ports the block-underfill guard to DASH — it exists on LTC and DOGE but not DASH, and is needed for the mining-hotel deployment.
DASH has no
template_builder.hppclass; its template path is the free functionbuild_embedded_workdata()insrc/impl/dash/coin/embedded_gbt.hpp. The guard is placed there, after tx selection and before the platform-burn / MN-payee / CbTx section (masternode payment, CbTx payload, and the dashd submitblock fallback are untouched).Behavior mirrors LTC/DOGE (
src/impl/{ltc,doge}/coin/template_builder.hpp): same 50 kB pins (UNDERFILL_MIN_FILL_BYTES,UNDERFILL_BACKLOG_SLACK); if the selected template is near-empty (< 50 kB) and the mempool holds known fees > 0 with a real backlog, it emits a[GBT-EMB] UNDERFILL:LOG_WARNING. Log-only — no retry/reject; genuinely empty mempools never trip. Only covers the embedded template path (when it falls back to dashd GBT, dashd fills the template — same scoping as LTC/DOGE).src/impl/dash/coin/embedded_gbt.hpp— namespace pins + pure predicateunderfill_guard_trips(...); guard block using DASH'smempool.byte_size()/total_known_fees(); a defaulted additivebool* underfill_trippedout-param (test observation point, in this file's existing seam idiom — droppable for exact-mirror log-only). All existing callers unchanged (byte-for-byte).test/test_dash_underfill_guard.cpp(new) — threshold + predicate-boundary KATs, plus end-to-end wiring through the realMempool+build_embedded_workdata(a ~108 kB fee-known tx made unselectable via the stale-input window → guard trips, and the DIP-0027 MN-payment projection is asserted unchanged). First underfill test in the tree.test/CMakeLists.txt— registerstest_dash_underfill_guard(same link set astest_dash_embedded_gbt).Note: not compile-checked by the author (no toolchain on that host) — CI validates the build here. The new gtest may need adding to the build.yml test-allowlist (workflow-scoped) to run in CI.