31 #include <txmempool.h>
58 if (height >= 0 && height < active_chain.
Height()) {
59 pb = active_chain[height];
62 if (pb ==
nullptr || !pb->
nHeight)
75 int64_t maxTime = minTime;
76 for (
int i = 0; i < lookup; i++) {
79 minTime = std::min(time, minTime);
80 maxTime = std::max(time, maxTime);
84 if (minTime == maxTime)
88 int64_t timeDiff = maxTime - minTime;
96 "\nReturns the estimated network hashes per second based on the last n blocks.\n"
97 "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n"
98 "Pass in [height] to estimate the network speed at the time when a certain block was found.\n",
113 return GetNetworkHashPS(!request.params[0].isNull() ? request.params[0].getInt<
int>() : 120, !request.params[1].isNull() ? request.params[1].getInt<
int>() : -1, chainman.
ActiveChain());
130 if (block.
nNonce == std::numeric_limits<uint32_t>::max()) {
134 std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
148 if (!pblocktemplate.get())
150 CBlock *pblock = &pblocktemplate->block;
153 if (!
GenerateBlock(chainman, *pblock, nMaxTries, block_hash)) {
157 if (!block_hash.
IsNull()) {
168 const auto desc =
Parse(descriptor, key_provider,
error,
false);
170 if (desc->IsRange()) {
175 std::vector<CScript> scripts;
176 if (!desc->Expand(0, key_provider, scripts, provider)) {
183 if (scripts.size() == 1) {
184 script = scripts.at(0);
185 }
else if (scripts.size() == 4) {
187 script = scripts.at(2);
190 script = scripts.at(1);
202 "generatetodescriptor",
203 "Mine to a specified descriptor and return the block hashes.",
216 "\nGenerate 11 blocks to mydesc\n" +
HelpExampleCli(
"generatetodescriptor",
"11 \"mydesc\"")},
219 const int num_blocks{request.params[0].
getInt<
int>()};
220 const uint64_t max_tries{request.params[2].isNull() ?
DEFAULT_MAX_TRIES : request.params[2].getInt<
int>()};
232 return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
247 "Mine to a specified address and return the block hashes.",
259 "\nGenerate 11 blocks to myaddress\n"
261 +
"If you are using the " PACKAGE_NAME " wallet, you can get a new address to send the newly generated bitcoin to with:\n"
266 const int num_blocks{request.params[0].
getInt<
int>()};
267 const uint64_t max_tries{request.params[2].isNull() ?
DEFAULT_MAX_TRIES : request.params[2].getInt<
int>()};
280 return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
288 "Mine a set of ordered transactions to a specified address or descriptor and return the block hash.",
292 "Txids must reference transactions currently in the mempool.\n"
293 "All transactions must be valid and in valid order, otherwise the block will be rejected.",
306 "\nGenerate a block to myaddress, with txs rawtx and mempool_txid\n"
307 +
HelpExampleCli(
"generateblock", R
"("myaddress" '["rawtx", "mempool_txid"]')")
311 const auto address_or_descriptor = request.params[0].
get_str();
327 std::vector<CTransactionRef> txs;
328 const auto raw_txs_or_txids = request.params[1].get_array();
329 for (
size_t i = 0; i < raw_txs_or_txids.size(); i++) {
330 const auto str(raw_txs_or_txids[i].get_str());
336 const auto tx = mempool.
get(hash);
341 txs.emplace_back(tx);
358 if (!blocktemplate) {
361 block = blocktemplate->block;
367 block.
vtx.insert(block.
vtx.end(), txs.begin(), txs.end());
396 "\nReturns a json object containing mining-related information.",
402 {
RPCResult::Type::NUM,
"currentblockweight",
true,
"The block weight of the last assembled block (only present if a block was ever assembled)"},
403 {
RPCResult::Type::NUM,
"currentblocktx",
true,
"The number of block transactions of the last assembled block (only present if a block was ever assembled)"},
424 if (BlockAssembler::m_last_block_weight) obj.
pushKV(
"currentblockweight", *BlockAssembler::m_last_block_weight);
425 if (BlockAssembler::m_last_block_num_txs) obj.
pushKV(
"currentblocktx", *BlockAssembler::m_last_block_num_txs);
428 obj.
pushKV(
"pooledtx", (uint64_t)mempool.
size());
441 "Accepts the transaction into mined blocks at a higher (or lower) priority\n",
445 " DEPRECATED. For forward compatibility use named arguments and omit this parameter."},
447 " Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.\n"
448 " The fee is not actually paid, only the algorithm for selecting transactions into a block\n"
449 " considers the transaction as it would have paid a higher (or lower) fee."},
462 CAmount nAmount = request.params[2].getInt<int64_t>();
464 if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) {
486 if (strRejectReason.empty())
488 return strRejectReason;
496 std::string s = vbinfo.
name;
498 s.insert(s.begin(),
'!');
506 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
507 "It returns data needed to construct a block to work on.\n"
508 "For full specification, see BIPs 22, 23, 9, and 145:\n"
509 " https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n"
510 " https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n"
511 " https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n"
512 " https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n",
537 {
RPCResult::Type::STR,
"",
"name of a rule the client must understand to some extent; see BIP 9 for format"},
541 {
RPCResult::Type::NUM,
"rulename",
"identifies the bit number as indicating acceptance and readiness for the named softfork rule"},
547 {
RPCResult::Type::NUM,
"vbrequired",
"bit mask of versionbits the server requires set in submissions"},
549 {
RPCResult::Type::ARR,
"transactions",
"contents of non-coinbase transactions that should be included in the next block",
558 {
RPCResult::Type::NUM,
"",
"transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is"},
560 {
RPCResult::Type::NUM,
"fee",
"difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one"},
561 {
RPCResult::Type::NUM,
"sigops",
"total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero"},
562 {
RPCResult::Type::NUM,
"weight",
"total transaction weight, as counted for purposes of block limits"},
569 {
RPCResult::Type::NUM,
"coinbasevalue",
"maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
570 {
RPCResult::Type::STR,
"longpollid",
"an id to include with a request to longpoll on an update to this template"},
575 {
RPCResult::Type::STR,
"value",
"A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'"},
585 {
RPCResult::Type::STR_HEX,
"default_witness_commitment",
true,
"a valid witness commitment for the unmodified block template"},
598 std::string strMode =
"template";
600 std::set<std::string> setClientRules;
603 if (!request.params[0].isNull())
609 else if (modeval.
isNull())
617 if (strMode ==
"proposal")
620 if (!dataval.
isStr())
633 return "duplicate-invalid";
634 return "duplicate-inconclusive";
640 return "inconclusive-not-best-prevblk";
648 for (
unsigned int i = 0; i < aClientRules.
size(); ++i) {
649 const UniValue& v = aClientRules[i];
650 setClientRules.insert(v.
get_str());
655 if (strMode !=
"template")
664 if (active_chainstate.IsInitialBlockDownload()) {
669 static unsigned int nTransactionsUpdatedLast;
676 std::chrono::steady_clock::time_point checktxtime;
677 unsigned int nTransactionsUpdatedLastLP;
682 const std::string& lpstr = lpval.
get_str();
684 hashWatchedChain =
ParseHashV(lpstr.substr(0, 64),
"longpollid");
685 nTransactionsUpdatedLastLP = LocaleIndependentAtoi<int64_t>(lpstr.substr(64));
691 nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;
697 checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);
702 if (
g_best_block_cv.wait_until(lock, checktxtime) == std::cv_status::timeout)
708 checktxtime += std::chrono::seconds(10);
722 if (consensusParams.
signet_blocks && setClientRules.count(
"signet") != 1) {
727 if (setClientRules.count(
"segwit") != 1) {
733 static int64_t time_start;
734 static std::unique_ptr<CBlockTemplate> pblocktemplate;
735 if (pindexPrev != active_chain.
Tip() ||
739 pindexPrev =
nullptr;
748 pblocktemplate =
BlockAssembler{active_chainstate, &mempool}.CreateNewBlock(scriptDummy);
753 pindexPrev = pindexPrevNew;
756 CBlock* pblock = &pblocktemplate->block;
759 UpdateTime(pblock, consensusParams, pindexPrev);
768 std::map<uint256, int64_t> setTxIndex;
770 for (
const auto& it : pblock->
vtx) {
773 setTxIndex[txHash] = i++;
790 entry.
pushKV(
"depends", deps);
792 int index_in_template = i - 1;
793 entry.
pushKV(
"fee", pblocktemplate->vTxFees[index_in_template]);
794 int64_t nTxSigOps = pblocktemplate->vTxSigOpsCost[index_in_template];
799 entry.
pushKV(
"sigops", nTxSigOps);
815 result.
pushKV(
"capabilities", aCaps);
819 if (!fPreSegWit) aRules.
push_back(
"!segwit");
843 if (setClientRules.find(vbinfo.
name) == setClientRules.end()) {
856 if (setClientRules.find(vbinfo.
name) == setClientRules.end()) {
867 result.
pushKV(
"rules", aRules);
868 result.
pushKV(
"vbavailable", vbavailable);
869 result.
pushKV(
"vbrequired",
int(0));
872 result.
pushKV(
"transactions", transactions);
873 result.
pushKV(
"coinbaseaux", aux);
874 result.
pushKV(
"coinbasevalue", (int64_t)pblock->
vtx[0]->vout[0].nValue);
878 result.
pushKV(
"mutable", aMutable);
879 result.
pushKV(
"noncerange",
"00000000ffffffff");
888 result.
pushKV(
"sigoplimit", nSigOpLimit);
889 result.
pushKV(
"sizelimit", nSizeLimit);
901 if (!pblocktemplate->vchCoinbaseCommitment.empty()) {
902 result.
pushKV(
"default_witness_commitment",
HexStr(pblocktemplate->vchCoinbaseCommitment));
932 "\nAttempts to submit new block to network.\n"
933 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n",
948 std::shared_ptr<CBlock> blockptr = std::make_shared<CBlock>();
949 CBlock& block = *blockptr;
950 if (!
DecodeHexBlk(block, request.params[0].get_str())) {
954 if (block.
vtx.empty() || !block.
vtx[0]->IsCoinBase()) {
968 return "duplicate-invalid";
977 chainman.UpdateUncommittedBlockStructures(block, pindex);
982 auto sc = std::make_shared<submitblock_StateCatcher>(block.
GetHash());
984 bool accepted = chainman.
ProcessNewBlock(blockptr,
true,
true, &new_block);
986 if (!new_block && accepted) {
990 return "inconclusive";
1000 "\nDecode the given hexdata as a header and submit it as a candidate chain tip if valid."
1001 "\nThrows when the header is invalid.\n",
1051 for (
const auto& c : commands) {
1052 t.appendCommand(c.name, &c);
int64_t CAmount
Amount in satoshis (Can be negative)
double GetDifficulty(const CBlockIndex *blockindex)
Get the difficulty of the net wrt to the given block index.
@ BLOCK_VALID_SCRIPTS
Scripts & signatures ok. Implies all parents are also at least SCRIPTS.
const CChainParams & Params()
Return the currently selected parameters.
#define CHECK_NONFATAL(condition)
Identity function.
std::vector< CTransactionRef > vtx
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * pprev
pointer to the index of the predecessor of this block
arith_uint256 nChainWork
(memory only) Total amount of work (expected number of hashes) in the chain up to and including this ...
uint256 GetBlockHash() const
int64_t GetBlockTime() const
int64_t GetMedianTimePast() const
bool IsValid(enum BlockStatus nUpTo=BLOCK_VALID_TRANSACTIONS) const EXCLUSIVE_LOCKS_REQUIRED(
Check whether this block index entry is valid up to the passed validity level.
int nHeight
height of the entry in the chain. The genesis block has height 0
An in-memory indexed chain of blocks.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
int Height() const
Return the maximal height in the chain.
std::string NetworkIDString() const
Return the network string.
bool IsTestChain() const
If this chain is exclusively used for testing.
const Consensus::Params & GetConsensus() const
size_t GetNodeCount(ConnectionDirection) const
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
const uint256 & GetHash() const
const std::vector< CTxIn > vin
const uint256 & GetWitnessHash() const
An input of a transaction.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
void PrioritiseTransaction(const uint256 &hash, const CAmount &nFeeDelta)
Affect CreateNewBlock prioritisation of transactions.
CTransactionRef get(const uint256 &hash) const
unsigned long size() const
unsigned int GetTransactionsUpdated() const
Implement this to subscribe to events generated in validation.
Chainstate stores and provides an API to update our local knowledge of the current best chain.
CChain m_chain
The current chain of blockheaders we consult and build on.
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
CChain & ActiveChain() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
const CChainParams & GetParams() const
Chainstate & ActiveChainstate() const
The most-work chain.
bool ProcessNewBlock(const std::shared_ptr< const CBlock > &block, bool force_processing, bool min_pow_checked, bool *new_block) LOCKS_EXCLUDED(cs_main)
Process an incoming block.
VersionBitsCache m_versionbitscache
Track versionbit status.
bool ProcessNewBlockHeaders(const std::vector< CBlockHeader > &block, bool min_pow_checked, BlockValidationState &state, const CBlockIndex **ppindex=nullptr) LOCKS_EXCLUDED(cs_main)
Process incoming block headers.
const Consensus::Params & GetConsensus() const
node::BlockManager m_blockman
A single BlockManager instance is shared across each constructed chainstate to avoid duplicating bloc...
void push_back(UniValue val)
const std::string & get_str() const
const UniValue & get_obj() const
void pushKV(std::string key, UniValue val)
std::string GetRejectReason() const
std::string ToString() const
static uint32_t Mask(const Consensus::Params ¶ms, Consensus::DeploymentPos pos)
ThresholdState State(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::DeploymentPos pos) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Get the BIP9 state for a given deployment for the block after pindexPrev.
256-bit unsigned big integer.
arith_uint256 & SetCompact(uint32_t nCompact, bool *pfNegative=nullptr, bool *pfOverflow=nullptr)
The "compact" format is a representation of a whole number N using an unsigned 32bit number similar t...
std::string GetHex() const
std::string GetHex() const
Generate a new block, without valid proof-of-work.
CBlockIndex * LookupBlockIndex(const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
void BlockChecked(const CBlock &block, const BlockValidationState &stateIn) override
Notifies listeners of a block validation result.
submitblock_StateCatcher(const uint256 &hashIn)
BlockValidationState state
static int64_t GetTransactionWeight(const CTransaction &tx)
static const unsigned int MAX_BLOCK_WEIGHT
The maximum allowed weight for a block, see BIP 141 (network rule)
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE
The maximum allowed size for a serialized block, in bytes (only for buffer size limits)
static const int64_t MAX_BLOCK_SIGOPS_COST
The maximum allowed number of signature check operations in a block (network rule)
static const int WITNESS_SCALE_FACTOR
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness=false, bool try_witness=true)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
bool DeploymentActiveAfter(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms, Consensus::BuriedDeployment dep, [[maybe_unused]] VersionBitsCache &versionbitscache)
Determine if a deployment is active for the next block.
std::unique_ptr< Descriptor > Parse(const std::string &descriptor, FlatSigningProvider &out, std::string &error, bool require_checksum)
Parse a descriptor string.
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
@ MAX_VERSION_BITS_DEPLOYMENTS
void RegenerateCommitments(CBlock &block, ChainstateManager &chainman)
Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed.
int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params &consensusParams, const CBlockIndex *pindexPrev)
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params ¶ms)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
UniValue JSONRPCError(int code, const std::string &message)
static bool GenerateBlock(ChainstateManager &chainman, CBlock &block, uint64_t &max_tries, uint256 &block_hash)
static UniValue generateBlocks(ChainstateManager &chainman, const CTxMemPool &mempool, const CScript &coinbase_script, int nGenerate, uint64_t nMaxTries)
static UniValue GetNetworkHashPS(int lookup, int height, const CChain &active_chain)
Return average network hashes per second based on the last 'lookup' blocks, or from the last difficul...
static RPCHelpMan generateblock()
static RPCHelpMan generatetodescriptor()
static bool getScriptFromDescriptor(const std::string &descriptor, CScript &script, std::string &error)
static RPCHelpMan getnetworkhashps()
static UniValue BIP22ValidationResult(const BlockValidationState &state)
static RPCHelpMan submitblock()
static RPCHelpMan getblocktemplate()
static RPCHelpMan generate()
static RPCHelpMan submitheader()
static RPCHelpMan prioritisetransaction()
static RPCHelpMan getmininginfo()
static RPCHelpMan generatetoaddress()
static std::string gbt_vb_name(const Consensus::DeploymentPos pos)
void RegisterMiningRPCCommands(CRPCTable &t)
static const uint64_t DEFAULT_MAX_TRIES
Default max iterations to try in RPC generatetodescriptor, generatetoaddress, and generateblock.
@ RPC_OUT_OF_MEMORY
Ran out of memory during operation.
@ RPC_MISC_ERROR
General application defined errors.
@ RPC_TYPE_ERROR
Unexpected type was passed as parameter.
@ RPC_CLIENT_NOT_CONNECTED
P2P client errors.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_VERIFY_ERROR
General error during transaction or block submission.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
Still downloading initial blocks.
@ RPC_DESERIALIZATION_ERROR
Error parsing or validating structure in raw format.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency.
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
bool IsRPCRunning()
Query whether RPC is running.
ChainstateManager & EnsureAnyChainman(const std::any &context)
CTxMemPool & EnsureAnyMemPool(const std::any &context)
NodeContext & EnsureAnyNodeContext(const std::any &context)
CConnman & EnsureConnman(const NodeContext &node)
CTxMemPool & EnsureMemPool(const NodeContext &node)
ChainstateManager & EnsureChainman(const NodeContext &node)
bool ShutdownRequested()
Returns true if a shutdown is requested, false otherwise.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
std::string ToString(const T &t)
Locale-independent version of std::to_string.
A mutable version of CTransaction.
int bit
Bit position to select the particular bit in nVersion.
Parameters that influence chain consensus.
std::vector< uint8_t > signet_challenge
int64_t DifficultyAdjustmentInterval() const
bool signet_blocks
If true, witness commitments contain a payload equal to a Bitcoin Script solution to the signet chall...
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
@ STR_HEX
Special type that is a STR with only hex chars.
std::string DefaultHint
Hint for default value.
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
std::string oneline_description
Should be empty unless it is supposed to override the auto-generated summary line.
@ NUM_TIME
Special numeric to denote unix epoch time.
@ OBJ_DYN
Special dictionary with keys that are not literals.
@ STR_HEX
Special string with only hex chars.
bool gbt_force
Whether GBT clients can safely ignore this rule in simplified usage.
const char * name
Deployment name.
NodeContext struct containing references to chain state and connection state.
#define WAIT_LOCK(cs, name)
#define ENTER_CRITICAL_SECTION(cs)
#define LEAVE_CRITICAL_SECTION(cs)
bool error(const char *fmt, const Args &... args)
NodeClock::time_point GetAdjustedTime()
const UniValue & find_value(const UniValue &obj, const std::string &name)
const UniValue NullUniValue
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
GlobalMutex g_best_block_mutex
std::condition_variable g_best_block_cv
bool TestBlockValidity(BlockValidationState &state, const CChainParams &chainparams, Chainstate &chainstate, const CBlock &block, CBlockIndex *pindexPrev, const std::function< NodeClock::time_point()> &adjusted_time_callback, bool fCheckPOW, bool fCheckMerkleRoot)
Check a block is completely valid from start to finish (only works on top of our current best block)
uint256 g_best_block
Used to notify getblocktemplate RPC of new tips.
void UnregisterSharedValidationInterface(std::shared_ptr< CValidationInterface > callbacks)
Unregister subscriber.
void RegisterSharedValidationInterface(std::shared_ptr< CValidationInterface > callbacks)
Register subscriber.
ThresholdState
BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.
bilingual_str GetWarnings(bool verbose)
Format a string that describes several potential problems detected by the core.