As mentioned in #34644 (review) and #35675 (review), the validation state catchers were defined in the block template manager, submitblock rpc and mining test helpers, even though they do the same thing.
Moved this helper into node/block_validation_state_catcher.h and reuse it across all three callers. An optional validation state replaces the separate found flag where used, preserving each caller's registration and result handling
Replaces #36389 with the same commit on a dedicated branch.