A caller can check if a block template is valid and is good to spend work on
rpc: Add testblocktemplatevalidity #13415
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1806-rpcTestblocktemplatevalidity changing 2 files +50 −3-
MarcoFalke commented at 6:55 PM on June 7, 2018: member
-
MarcoFalke commented at 6:56 PM on June 7, 2018: member
TODO: Add tests (Currently left out to avoid excessive merge conflicts with other pull requests touching the miner tests)
- MarcoFalke added the label RPC/REST/ZMQ on Jun 7, 2018
- MarcoFalke added the label Mining on Jun 7, 2018
-
DrahtBot commented at 7:31 PM on June 7, 2018: contributor
<!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:
- #13945 (Refactoring CRPCCommand with enum category by isghe)
- #13864 (validation: Document where we are intentionally ignoring bool return values from validation related functions by practicalswift)
- #13083 (Add compile time checking for cs_main runtime locking assertions by practicalswift)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
in src/rpc/mining.cpp:300 in fa040362cb outdated
295 | + UniValue result(UniValue::VOBJ); 296 | + result.pushKV("block_hash", block.GetHash().GetHex()); 297 | + CValidationState state; 298 | + bool valid_template = TestBlockValidity(state, Params(), block, /* pindexPrev */ tip, /* fCheckPOW */ false, /* fCheckMerkleRoot */ true); 299 | + result.pushKV("valid_template", valid_template); 300 | + if (valid_template) {
Empact commented at 9:14 PM on June 7, 2018:Is this inverted?
luke-jr commented at 9:18 PM on June 7, 2018: memberThis is already supported via BIP 23 Block Proposals: https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki#Block_Proposal
promag commented at 11:29 AM on June 10, 2018: memberRight, looks like this is already implemented https://github.com/bitcoin/bitcoin/blob/56f69360dc98bd68704f19646a84d045788d199e/src/rpc/mining.cpp#L389-L416
DrahtBot cross-referenced this on Jun 15, 2018 from issue doc: Rewrite some validation docs as lock annotations by MarcoFalkeDrahtBot cross-referenced this on Jun 15, 2018 from issue Avoid copies in range-for loops and add a warning to detect them by theuniDrahtBot cross-referenced this on Jun 15, 2018 from issue contrib: Fix CVE-2018-12356 by hardening the regex by loganadenDrahtBot cross-referenced this on Jun 15, 2018 from issue [devtools translations] catch invalid specifiers by HashUnlimitedDrahtBot cross-referenced this on Jun 15, 2018 from issue For AVX2 code, also check for AVX, XSAVE, and OS support by sipaDrahtBot cross-referenced this on Jun 15, 2018 from issue WIP [bench] CCoinsView(Cache): measure various scenarios by SjorsDrahtBot cross-referenced this on Jun 15, 2018 from issue [Tests] Make p2p_segwit easier to debug by jnewberyDrahtBot cross-referenced this on Jun 15, 2018 from issue Make SER_GETHASH implicit for CHashWriter and SerializeHash by EmpactDrahtBot cross-referenced this on Jun 15, 2018 from issue Wallet: correctly deprecate accounts in getbalance, re-add minconf / include-watch-only by jonasschnelliDrahtBot cross-referenced this on Jun 15, 2018 from issue gui: Drop qt4 support by laanwjDrahtBot cross-referenced this on Jun 15, 2018 from issue Make sure LC_ALL=C is set in all shell scripts by practicalswiftDrahtBot cross-referenced this on Jun 15, 2018 from issue rpc: have verifytxoutproof check the number of txns in proof structure by instagibbsDrahtBot cross-referenced this on Jun 15, 2018 from issue [WIP] support new multisig template in wallet for Solver, signing, and signature combining by instagibbsMarcoFalke force-pushed on Jun 15, 2018TheBlueMatt cross-referenced this on Jun 26, 2018 from issue Spot Check Weak Block Validity by TheBlueMattMarcoFalke force-pushed on Jul 11, 2018laanwj added this to the milestone 0.18.0 on Aug 2, 2018laanwj added the label Feature on Aug 2, 2018DrahtBot cross-referenced this on Aug 3, 2018 from issue validation: Document where we are intentionally ignoring bool return values from validation related functions by practicalswiftDrahtBot cross-referenced this on Aug 12, 2018 from issue Refactoring CRPCCommand with enum category by isgherpc: Add testblocktemplatevalidity 28057de21aMarcoFalke force-pushed on Aug 15, 2018MarcoFalke closed this on Aug 15, 2018MarcoFalke deleted the branch on Aug 15, 2018bitcoin locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC