This PR implements the first step of #33758 by adding a cache layer for node block templates.
The cache stores newly created block templates along with their configuration options. When clients request a block template, they specify the maximum age in MillisecondsDouble:
- If a matching template (block template with identical block creation option) exists in the cache and hasn’t exceeded the age limit, the cached version is returned (if multiple exist, the most recent one is returned).
- If no matching template exists or the age limit has been exceeded, a new template is generated, cached, and returned.
The cache maintains a configurable maximum size (default: 10 templates). When this limit is exceeded, the oldest template is evicted. This is usually checked after each insertion.
The cache subscribes to the validation interface and clears itself when blocks are connected (to non-historical chainstate to avoid clearing during assumeutxo background validation) or disconnected from the active chain (during reorgs), preventing stale or invalid templates from being served.
This PR also removes an unused node/context.h import from miner to prevent a potential circular dependency during exposing the block template cache to the node context.