Following the merge of https://github.com/bitcoin/bitcoin/pull/23083, we'll throw a non-fatal error at runtime if the documentation for an RPC is incorrect. This behaviour has found numerous issues over a very short period (of the PR being opened). However, this is not something that we want in production / release builds, instead, we want the ability to have it enabled in the CI and when running tests. A runtime option could be added, which controls this behaviour (disabled by default).

#### Useful skills:

- C++
- Understanding of Bitcoin Core's initialization sequence
- Understanding of Bitcoin Core's RPC interface

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

{
    const int target{value.get_int()};
    const unsigned int unsigned_target{static_cast<unsigned int>(target)};
    if (target < 1 || unsigned_target > max_target) {
        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u and %u", 1, max_target));
    }
    return unsigned_target;
}
RPCErrorCode RPCErrorFromTransactionError(TransactionError terr)
{
    switch (terr) {
        case TransactionError::MEMPOOL_REJECTED:
            return RPC_TRANSACTION_REJECTED;
        case TransactionError::ALREADY_IN_CHAIN:
            return RPC_TRANSACTION_ALREADY_IN_CHAIN;
        case TransactionError::P2P_DISABLED:
            return RPC_CLIENT_P2P_DISABLED;
        case TransactionError::INVALID_PSBT:
        case TransactionError::PSBT_MISMATCH:
            return RPC_INVALID_PARAMETER;
        case TransactionError::SIGHASH_MISMATCH:
            return RPC_DESERIALIZATION_ERROR;
        default: break;
    }
    return RPC_TRANSACTION_ERROR;
}
UniValue JSONRPCTransactionError(TransactionError terr, const std::string& err_string)