Our miner code adds OP_0 as a dummy extraNonce to the coinbase scriptSig. This has been in place since v0.1.0 and removing it entirely would trigger the bad-cb-length consensus error on test networks for blocks 1 through 16 (OP1 through OP_16).
Previously the coinbase transaction generated by our miner code was not used downstream, because the getblocktemplate RPC excludes it. Since the Mining IPC interface was introduced in #30200 we do expose this dummy coinbase transaction. In Stratum v2 several parts of it are communicated downstream, including the scriptSig.
This PR adds a include_dummy_extranonce option which is false by default, but for the time being all test code opts in to it. This avoids churning hardcoded block and transaction hashes.
The effect of having the default false for IPC callers is that we remove the dummy extraNonce from the coinbase scriptSig in block templates requested that way. This limits the scriptSig to what is essential for consensus (BIP34) and removes the need for external mining software to remove the dummy, or even ignore the scriptSig we provide and generate it some other way. This could cause problems if a future soft fork requires additional data to be committed here.
test/functional/interface_ipc.py is expanded to verify the new IPC behavior.