From 355ec84d57213a0af551d3ef22da181f6122bcc7 Mon Sep 17 00:00:00 2001 From: Odysseas Gabrielides Date: Thu, 19 Oct 2023 21:16:33 +0300 Subject: [PATCH 1/5] activation_height calculation --- src/rpc/blockchain.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 3a7717cd689ae..d62d3f9327927 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1635,6 +1635,9 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal if (ThresholdState::ACTIVE == thresholdState) { rv.pushKV("height", since_height); } + else if (ThresholdState::LOCKED_IN == thresholdState) { + rv.pushKV("activation_height", since_height + static_cast(consensusParams.vDeployments[id].nWindowSize)); + } rv.pushKV("active", ThresholdState::ACTIVE == thresholdState); softforks.pushKV(name, rv); From 82f7bca55d82e96ba854cd11b799dfe2fb595458 Mon Sep 17 00:00:00 2001 From: Odysseas Gabrielides Date: Mon, 23 Oct 2023 15:20:50 +0200 Subject: [PATCH 2/5] help text --- src/rpc/blockchain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index d62d3f9327927..12ad782026127 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1676,6 +1676,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) {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, "activation_height", "expected activation height for this softfork (only for \"locked_in\" status)"}, {RPCResult::Type::OBJ, "statistics", "numeric statistics about BIP9 signalling for a softfork", { {RPCResult::Type::NUM, "period", "the length in blocks of the BIP9 signalling period"}, From 907945128f53d8f0bc9684250b18df27e01030e3 Mon Sep 17 00:00:00 2001 From: Odysseas Gabrielides Date: Mon, 23 Oct 2023 15:20:54 +0200 Subject: [PATCH 3/5] Create release-notes-5624.md --- doc/release-notes-5624.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/release-notes-5624.md diff --git a/doc/release-notes-5624.md b/doc/release-notes-5624.md new file mode 100644 index 0000000000000..e9a943ffd9b8a --- /dev/null +++ b/doc/release-notes-5624.md @@ -0,0 +1,4 @@ +Updated RPCs +------------ + +- `getblockchaininfo` RPC returns the field `activation_height` for each softsposk in `locked_in` status: indicating the expected activation height. From e59fc4c8a3d941e84cfcf588582adb7b015a64b1 Mon Sep 17 00:00:00 2001 From: Odysseas Gabrielides Date: Mon, 23 Oct 2023 15:28:18 +0200 Subject: [PATCH 4/5] spelling --- doc/release-notes-5624.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-notes-5624.md b/doc/release-notes-5624.md index e9a943ffd9b8a..41923d3df008b 100644 --- a/doc/release-notes-5624.md +++ b/doc/release-notes-5624.md @@ -1,4 +1,4 @@ Updated RPCs ------------ -- `getblockchaininfo` RPC returns the field `activation_height` for each softsposk in `locked_in` status: indicating the expected activation height. +- `getblockchaininfo` RPC returns the field `activation_height` for each softforks in `locked_in` status: indicating the expected activation height. From a9eeae4777f8cd7b5096d155f288d6c385f2cc4c Mon Sep 17 00:00:00 2001 From: Odysseas Gabrielides Date: Mon, 23 Oct 2023 16:30:21 +0200 Subject: [PATCH 5/5] moved inside bip9 field --- src/rpc/blockchain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 12ad782026127..377d55e18e93e 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1628,6 +1628,9 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal statsUV.pushKV("possible", statsStruct.possible); bip9.pushKV("statistics", statsUV); } + else if (ThresholdState::LOCKED_IN == thresholdState) { + bip9.pushKV("activation_height", since_height + static_cast(consensusParams.vDeployments[id].nWindowSize)); + } UniValue rv(UniValue::VOBJ); rv.pushKV("type", "bip9"); @@ -1635,9 +1638,6 @@ static void BIP9SoftForkDescPushBack(const CBlockIndex* active_chain_tip, UniVal if (ThresholdState::ACTIVE == thresholdState) { rv.pushKV("height", since_height); } - else if (ThresholdState::LOCKED_IN == thresholdState) { - rv.pushKV("activation_height", since_height + static_cast(consensusParams.vDeployments[id].nWindowSize)); - } rv.pushKV("active", ThresholdState::ACTIVE == thresholdState); softforks.pushKV(name, rv);