Skip to content

Commit

Permalink
Merge bitcoin#24528: rpc: rename getdeploymentinfo status-next to sta…
Browse files Browse the repository at this point in the history
…tus_next

5d7c69b rpc: rename getdeploymentinfo status-next to status_next (Jon Atack)

Pull request description:

  Rename the `status-next` field to `status_next` in getdeploymentinfo before the RPC is released in v23.

  Before
  ```
  Result:
  {                                       (json object)
    "hash" : "str",                       (string) requested block hash (or tip)
    "height" : n,                         (numeric) requested block height (or tip)
    "deployments" : {                     (json object)
      "xxxx" : {                          (json object) name of the deployment
        "type" : "str",                   (string) one of "buried", "bip9"
        "height" : n,                     (numeric, optional) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
        "active" : true|false,            (boolean) true if the rules are enforced for the mempool and the next block
        "bip9" : {                        (json object, optional) status of bip9 softforks (only for "bip9" type)
          "bit" : n,                      (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
          "start_time" : xxx,             (numeric) the minimum median time past of a block at which the bit gains its meaning
          "timeout" : xxx,                (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
          "min_activation_height" : n,    (numeric) minimum height of blocks for which the rules may be enforced
          "status" : "str",               (string) status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
          "since" : n,                    (numeric) height of the first block to which the status applies
          "status-next" : "str",          (string) status of deployment at the next block
          "statistics" : {                (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
            "period" : n,                 (numeric) the length in blocks of the signalling period
            "threshold" : n,              (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
            "elapsed" : n,                (numeric) the number of blocks elapsed since the beginning of the current period
            "count" : n,                  (numeric) the number of blocks with the version bit set in the current period
            "possible" : true|false       (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
          },
          "signalling" : "str"            (string) indicates blocks that signalled with a # and blocks that did not with a -
        }
      }
    }
  }
  ```
  After
  ```
  Result:
  {                                       (json object)
    "hash" : "str",                       (string) requested block hash (or tip)
    "height" : n,                         (numeric) requested block height (or tip)
    "deployments" : {                     (json object)
      "xxxx" : {                          (json object) name of the deployment
        "type" : "str",                   (string) one of "buried", "bip9"
        "height" : n,                     (numeric, optional) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
        "active" : true|false,            (boolean) true if the rules are enforced for the mempool and the next block
        "bip9" : {                        (json object, optional) status of bip9 softforks (only for "bip9" type)
          "bit" : n,                      (numeric, optional) the bit (0-28) in the block version field used to signal this softfork (only for "started" and "locked_in" status)
          "start_time" : xxx,             (numeric) the minimum median time past of a block at which the bit gains its meaning
          "timeout" : xxx,                (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
          "min_activation_height" : n,    (numeric) minimum height of blocks for which the rules may be enforced
          "status" : "str",               (string) status of deployment at specified block (one of "defined", "started", "locked_in", "active", "failed")
          "since" : n,                    (numeric) height of the first block to which the status applies
          "status_next" : "str",          (string) status of deployment at the next block
          "statistics" : {                (json object, optional) numeric statistics about signalling for a softfork (only for "started" and "locked_in" status)
            "period" : n,                 (numeric) the length in blocks of the signalling period
            "threshold" : n,              (numeric, optional) the number of blocks with the version bit set required to activate the feature (only for "started" status)
            "elapsed" : n,                (numeric) the number of blocks elapsed since the beginning of the current period
            "count" : n,                  (numeric) the number of blocks with the version bit set in the current period
            "possible" : true|false       (boolean, optional) returns false if there are not enough blocks left in this period to pass activation threshold (only for "started" status)
          },
          "signalling" : "str"            (string) indicates blocks that signalled with a # and blocks that did not with a -
        }
      }
    }
  }
  ```

Top commit has no ACKs.

Tree-SHA512: 4facfd7af3cfb7b6f5495758c4387602802f5e39d9270b162d17350a7f954eab0b74d895f17f0d8dfbc7814d36db7cff56d08c42728432885ea6f4e37aea4aa8
  • Loading branch information
MarcoFalke committed Mar 13, 2022
2 parents 2860a91 + 5d7c69b commit e04720e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ static void SoftForkDescPushBack(const CBlockIndex* blockindex, UniValue& softfo
// BIP9 status
bip9.pushKV("status", get_state_name(current_state));
bip9.pushKV("since", g_versionbitscache.StateSinceHeight(blockindex->pprev, consensusParams, id));
bip9.pushKV("status-next", get_state_name(next_state));
bip9.pushKV("status_next", get_state_name(next_state));

// BIP9 signalling status, if applicable
if (has_signal) {
Expand Down Expand Up @@ -1623,7 +1623,7 @@ const std::vector<RPCResult> RPCHelpForDeployment{
{RPCResult::Type::NUM, "min_activation_height", "minimum height of blocks for which the rules may be enforced"},
{RPCResult::Type::STR, "status", "status of deployment at 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", "status of deployment at the next block"},
{RPCResult::Type::STR, "status_next", "status of deployment at the 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"},
Expand Down
4 changes: 2 additions & 2 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def check_signalling_deploymentinfo_result(self, gdi_result, height, blockhash,
'timeout': 0x7fffffffffffffff, # testdummy does not have a timeout so is set to the max int64 value
'min_activation_height': 0,
'status': 'started',
'status-next': status_next,
'status_next': status_next,
'since': 144,
'statistics': {
'period': 144,
Expand All @@ -220,7 +220,7 @@ def check_signalling_deploymentinfo_result(self, gdi_result, height, blockhash,
'timeout': 9223372036854775807,
'min_activation_height': 0,
'status': 'active',
'status-next': 'active',
'status_next': 'active',
'since': 0,
},
'height': 0,
Expand Down

0 comments on commit e04720e

Please sign in to comment.