a380922891 Release notes for getdeploymentinfo rpc (Anthony Towns)
240cad09ba rpc: getdeploymentinfo: include signalling info (Anthony Towns)
376c0c6dae rpc: getdeploymentinfo: include block hash/height (Anthony Towns)
a7469bcd35 rpc: getdeploymentinfo: change stats to always refer to current period (Anthony Towns)
7f15c1841b rpc: getdeploymentinfo: allow specifying a blockhash other than tip (Anthony Towns)
fd826130a0 rpc: move softfork info from getblockchaininfo to getdeploymentinfo (Anthony Towns)
Pull request description:
The aim of this PR is to improve the ability to monitor soft fork status. It first moves the softfork section from getblockchaininfo into a new RPC named getdeploymentinfo, which is then also able to query the status of forks at an arbitrary block rather than only at the tip. In addition, bip9 status is changed to indicate the status of the given block, rather than just for the next block, and an additional field is included to indicate whether each block in the signalling period signaled.
ACKs for top commit:
laanwj:
Code review and lightly tested ACK a380922891
Sjors:
tACK a380922891
fjahr:
tACK a380922891
Tree-SHA512: 7417d733b47629f229c5128586569909250481a3e94356c52fe67a03fd42cd81745246e384b98c4115fb61587714c879e4bc3e5f5c74407d9f8f6773472a33cb
{RPCResult::Type::NUM,"pruneheight",/*optional=*/true,"lowest-height complete block stored (only present if pruning is enabled)"},
{RPCResult::Type::BOOL,"automatic_pruning",/*optional=*/true,"whether automatic pruning is enabled (only present if pruning is enabled)"},
{RPCResult::Type::NUM,"prune_target_size",/*optional=*/true,"the target size used by pruning (only present if automatic pruning is enabled)"},
{RPCResult::Type::OBJ_DYN,"softforks","status of softforks",
{RPCResult::Type::OBJ_DYN,"softforks","(DEPRECATED, returned only if config option -deprecatedrpc=softforks is passed) status of softforks",
{
{RPCResult::Type::OBJ,"xxxx","name of the softfork",
{
{RPCResult::Type::STR,"type","one of \"buried\", \"bip9\""},
{RPCResult::Type::OBJ,"bip9",/*optional=*/true,"status of bip9 softforks (only for \"bip9\" type)",
{
{RPCResult::Type::STR,"status","one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\""},
{RPCResult::Type::NUM,"bit",/*optional=*/true,"the bit (0-28) in the block version field used to signal this softfork (only for \"started\" and \"locked_in\" status)"},
{RPCResult::Type::NUM_TIME,"start_time","the minimum median time past of a block at which the bit gains its meaning"},
{RPCResult::Type::NUM_TIME,"timeout","the median time past of a block at which the deployment is considered failed if not yet locked in"},
{RPCResult::Type::NUM,"since","height of the first block to which the status applies"},
{RPCResult::Type::NUM,"min_activation_height","minimum height of blocks for which the rules may be enforced"},
{RPCResult::Type::OBJ,"statistics",/*optional=*/true,"numeric statistics about signalling for a softfork (only for \"started\" and \"locked_in\" status)",
{
{RPCResult::Type::NUM,"period","the length in blocks of the signalling period"},
{RPCResult::Type::NUM,"threshold",/*optional=*/true,"the number of blocks with the version bit set required to activate the feature (only for \"started\" status)"},
{RPCResult::Type::NUM,"elapsed","the number of blocks elapsed since the beginning of the current period"},
{RPCResult::Type::NUM,"count","the number of blocks with the version bit set in the current period"},
{RPCResult::Type::BOOL,"possible",/*optional=*/true,"returns false if there are not enough blocks left in this period to pass activation threshold (only for \"started\" status)"},
}},
}},
{RPCResult::Type::NUM,"height",/*optional=*/true,"height of the first block which the rules are or will be enforced (only for \"buried\" type, or \"bip9\" type with \"active\" status)"},
{RPCResult::Type::BOOL,"active","true if the rules are enforced for the mempool and the next block"},
}},
RPCHelpForDeployment
},
}},
{RPCResult::Type::STR,"warnings","any network and blockchain warnings"},
{RPCResult::Type::STR,"type","one of \"buried\", \"bip9\""},
{RPCResult::Type::NUM,"height",/*optional=*/true,"height of the first block which the rules are or will be enforced (only for \"buried\" type, or \"bip9\" type with \"active\" status)"},
{RPCResult::Type::BOOL,"active","true if the rules are enforced for the mempool and the next block"},
{RPCResult::Type::OBJ,"bip9",/*optional=*/true,"status of bip9 softforks (only for \"bip9\" type)",
{
{RPCResult::Type::NUM,"bit",/*optional=*/true,"the bit (0-28) in the block version field used to signal this softfork (only for \"started\" and \"locked_in\" status)"},
{RPCResult::Type::NUM_TIME,"start_time","the minimum median time past of a block at which the bit gains its meaning"},
{RPCResult::Type::NUM_TIME,"timeout","the median time past of a block at which the deployment is considered failed if not yet locked in"},
{RPCResult::Type::NUM,"min_activation_height","minimum height of blocks for which the rules may be enforced"},
{RPCResult::Type::STR,"status","bip9 status of specified block (one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\")"},
{RPCResult::Type::NUM,"since","height of the first block to which the status applies"},
{RPCResult::Type::STR,"status-next","bip9 status of next block"},
{RPCResult::Type::OBJ,"statistics",/*optional=*/true,"numeric statistics about signalling for a softfork (only for \"started\" and \"locked_in\" status)",
{
{RPCResult::Type::NUM,"period","the length in blocks of the signalling period"},
{RPCResult::Type::NUM,"threshold",/*optional=*/true,"the number of blocks with the version bit set required to activate the feature (only for \"started\" status)"},
{RPCResult::Type::NUM,"elapsed","the number of blocks elapsed since the beginning of the current period"},
{RPCResult::Type::NUM,"count","the number of blocks with the version bit set in the current period"},
{RPCResult::Type::BOOL,"possible",/*optional=*/true,"returns false if there are not enough blocks left in this period to pass activation threshold (only for \"started\" status)"},
}},
{RPCResult::Type::STR,"signalling","indicates blocks that signalled with a # and blocks that did not with a -"},