This PR introduces node::BlockTemplateManager and moves block template
creation, submission, and mining wait helpers behind it.
Motivation
Instead of keeping template-related state and helper functions spread across
NodeContext, miner.cpp, the mining interface, RPC, and tests, the manager
now owns the node's init-time mining options and exposes methods needed by callers.
This also prevents some redundant copies previously done when using the mining interface to create a block template and then retrieve the template data.
This keeps the IPC Mining interface focused on IPC-facing mining objects, while RPC
and tests use the block template manager directly.
Changes
NodeContextno longer storesBlockCreateOptionsdirectly.BlockTemplateManagerstores the parsed init-time mining options and applies them to unset per-call options before creating templates.- Block submission through the mining interface is routed through
BlockTemplateManager::SubmitBlock(), preserving the existingBlockCheckedstate-capture behavior. - Tip lookup, tip waiting, cooldown, and
waitNext()template creation helpers are moved from miner helper functions intoBlockTemplateManager. - In-process RPC and tests create raw
CBlockTemplateobjects directly throughBlockTemplateManager, avoiding cachedBlockTemplateImplobjects that holdNodeContextreferences during shutdown. - A fuzz target is added for
BlockTemplateManager::CreateNewTemplate()with fuzzed mempool contents and mining options.