Return tip time in getblockchaininfo, for some use cases this can save a call to getblock.
rpc: Return block time in getblockchaininfo #22407
pull promag wants to merge 1 commits into bitcoin:master from promag:2021-07-getblockchaininfo-time changing 3 files +8 −1-
promag commented at 9:46 PM on July 5, 2021: member
-
theStack commented at 10:34 PM on July 5, 2021: member
Concept ACK
- DrahtBot added the label RPC/REST/ZMQ on Jul 5, 2021
-
naumenkogs commented at 9:47 AM on July 8, 2021: member
ACK b17bb4c37d58ca49e877983a632bfcaa493be993. I can indeed see how this is useful.
-
jonatack commented at 1:40 PM on July 8, 2021: member
Concept ACK, could use a test asserting on the value, needs this change for the CI to be green:
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 90715cae26..24dc668ea0 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -93,6 +93,7 @@ class BlockchainTest(BitcoinTestFramework): 'pruned', 'size_on_disk', 'softforks', + 'time', 'verificationprogress', 'warnings', -
theStack commented at 2:21 PM on July 9, 2021: member
@naumenkogs: I think you ACKed a commit not belonging to this PR?
Happy to review and test as soon as the CI is happy (see #22407#pullrequestreview-702077013) :)
- promag force-pushed on Jul 11, 2021
- theStack approved
-
theStack commented at 3:02 PM on July 11, 2021: member
ACK c86e001c9731aee055fa9660154b804cdfbb12e2
Does this need a release note?
-
naumenkogs commented at 7:55 AM on July 12, 2021: member
Sorry for acking the wrong hash. ACK c86e001c9731aee055fa9660154b804cdfbb12e2.
-
0xB10C commented at 9:04 AM on July 12, 2021: member
ACK c86e001c9731aee055fa9660154b804cdfbb12e2
- Zero-1729 approved
-
Zero-1729 commented at 4:32 PM on July 12, 2021: contributor
tACK c86e001c9731aee055fa9660154b804cdfbb12e2.
Tests in
test/functional/rpc_blockchain.pyalso check out successfully. @theStack I think this change should have a release note likegetnetworkinfodid when theconnections_in&connections_outfields were added inv0.20.0. It could be something like:`getblockchaininfo` now returns a new `time` field, that provides the chain tip time. (#22407) -
kristapsk commented at 4:57 PM on July 12, 2021: contributor
Concept ACK, but agree with @Zero-1729 that this needs release note.
-
jarolrod commented at 10:12 PM on July 17, 2021: member
Approach ACK c86e001c9731aee055fa9660154b804cdfbb12e2
I would add a release note for this, the one proposed here is good.
Additionally, I would add an assert for this as suggested here: #22407#pullrequestreview-702077013
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 24dc668ea..f7290ff22 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -99,6 +99,8 @@ class BlockchainTest(BitcoinTestFramework): ] res = self.nodes[0].getblockchaininfo() + assert isinstance(res['time'], int) + # result should have these additional pruning keys if manual pruning is enabled assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning'] + keys)) -
rpc: Return block time in getblockchaininfo 20edf4bcf6
- promag force-pushed on Jul 20, 2021
- theStack approved
-
theStack commented at 10:32 AM on July 20, 2021: member
re-ACK 20edf4bcf61e9fa310c3d7f3cac0c80a04df5364
- 0xB10C approved
-
0xB10C commented at 10:52 AM on July 20, 2021: member
ACK 20edf4bcf61e9fa310c3d7f3cac0c80a04df5364
Now includes a release note in
doc/release-notes.mdand the proposed assert in the functional test. -
naumenkogs commented at 11:23 AM on July 20, 2021: member
ACK 20edf4bcf61e9fa310c3d7f3cac0c80a04df5364
- kristapsk approved
-
kristapsk commented at 12:01 PM on July 20, 2021: contributor
ACK 20edf4bcf61e9fa310c3d7f3cac0c80a04df5364
- Zero-1729 approved
-
Zero-1729 commented at 12:26 PM on July 20, 2021: contributor
re-ACK 20edf4bcf61e9fa310c3d7f3cac0c80a04df5364
- MarcoFalke merged this on Jul 21, 2021
- MarcoFalke closed this on Jul 21, 2021
- promag deleted the branch on Jul 21, 2021
- MarcoFalke referenced this in commit 10eb000409 on Jul 21, 2021
- sidhujag referenced this in commit ba71ed84e3 on Jul 23, 2021
- MarcoFalke referenced this in commit b6c3fceed6 on Jul 30, 2021
- DrahtBot locked this on Aug 16, 2022