Skip to content

Conversation

kiminuo
Copy link
Contributor

@kiminuo kiminuo commented Oct 20, 2021

This is a follow-up PR to #22918 which addresses review comments (first commit). The second commit adds missing RPC help for verbosity level 3.

* fix English in release notes
* Simplify `switch` to `if`.
@kiminuo kiminuo force-pushed the feature/2021-10-20-verbosity-level-3-nits branch from 2716380 to 08d129a Compare October 20, 2021 08:51
@kiminuo kiminuo marked this pull request as ready for review October 20, 2021 08:51
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 25, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23545 (scripted-diff: Use clang-tidy syntax for C++ named arguments by MarcoFalke)

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.

@theStack
Copy link
Contributor

theStack commented Nov 7, 2021

Concept ACK

@laanwj
Copy link
Member

laanwj commented Nov 23, 2021

Any specific reason for closing?

@kiminuo kiminuo restored the feature/2021-10-20-verbosity-level-3-nits branch November 23, 2021 12:14
@kiminuo kiminuo reopened this Nov 23, 2021
@kiminuo
Copy link
Contributor Author

kiminuo commented Nov 23, 2021

@laanwj No, that was just a mistake as I was deleting old branches and this one was deleted by mistake too. Sorry.

@laanwj
Copy link
Member

laanwj commented Nov 23, 2021

@kiminuo No problem! Will take a look it seems very close to ready to merge.

@laanwj laanwj changed the title rpc: Add RPC help for verbosity level 3 rpc: Add RPC help for getblock verbosity level 3 Nov 23, 2021
@laanwj
Copy link
Member

laanwj commented Nov 23, 2021

Code review and lightly tested ACK 08d129a
Small nit on the documentation but feel free to ignore.

@kiminuo kiminuo force-pushed the feature/2021-10-20-verbosity-level-3-nits branch from 08d129a to 3a6a670 Compare November 26, 2021 06:49
@pg156
Copy link

pg156 commented Nov 26, 2021

src/bitcoin-cli help getblock doesn't return anything related to "verbosity = 3" on
macOS Big Sur. Did I do something wrong in the steps below?

git clone https://github.com/kiminuo/bitcoin.git 23320
cd 23320
git checkout feature/2021-10-20-verbosity-level-3-nits      
./autogen.sh
./configure --with-incompatible-bdb --without-miniupnpc --without-natpmp --disable-bench --disable-wallet --without-gui
make -j 3 src/bitcoin-cli
./src/bitcoin-cli help getblock

@theStack
Copy link
Contributor

src/bitcoin-cli help getblock doesn't return anything related to "verbosity = 3" on macOS Big Sur. Did I do something wrong in the steps below?

@pg156: You have to build and run bitcoind, as the help texts to the RPC calls are residing in there. bitcoin-cli is merely the RPC client that fetches it, i.e. most likely have another instance running on your system that has nothing to do with this PR. For simple tests like those, I recommend running bitcoind with -nolisten -noconnect to prevent unnecessary network activity.

@pg156
Copy link

pg156 commented Nov 28, 2021

Thank you @theStack! I get "verbosity = 3" after building bitcoind and stopping another bitcoind running on my machine, as you suggested.

Copy link

@pg156 pg156 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line also need to be updated for verbosity = 3?

{"verbosity|verbose", RPCArg::Type::NUM, RPCArg::Default{1}, "0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data"},

@kiminuo kiminuo force-pushed the feature/2021-10-20-verbosity-level-3-nits branch from 3a6a670 to 059f88b Compare November 30, 2021 09:40
@kiminuo
Copy link
Contributor Author

kiminuo commented Nov 30, 2021

@pg156 It's certainly better to update it. Updated. Thank you.

Ideas about better wordings are welcome :)

@pg156
Copy link

pg156 commented Dec 3, 2021

Code review ACK 3a6a670.
(but 3a6a670 doesn't exist in the "Commits" tab after the force-push. I don't know if the standard practice is to ACK only what is in the tab?)

  • Tested the difference in output of getblock between verbosity of 2 and 3 is as described in RPC help, by adding two lines of logging in _test_getblock function in test/functional/rpc_blockchain.py:
self.log.info(node.getblock(blockhash, 2))
self.log.info(node.getblock(blockhash, 3))

The difference is:

'prevout': {'generated': True, 'height': 18, 'value': Decimal('50.00000000'), 'scriptPubKey': {'asm': '0 4ae81572f06e1b88fd5ced7a1a000945432e83e1551e6f721ee9c00b8cc33260', 'hex': '00204ae81572f06e1b88fd5ced7a1a000945432e83e1551e6f721ee9c00b8cc33260', 'address': 'bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85', 'type': 'witness_v0_scripthash'}}
  • Tested "verbosity = 3" section in RPC help is as expected by running:
./src/bitcoind -testnet -daemon         
./src/bitcoin-cli -testnet help getblock

which generates:

...
Result (for verbosity = 3):
{                                        (json object)
  ...,                                   Same output as verbosity = 2
  "tx" : [                               (json array)
    {                                    (json object)
      "vin" : [                          (json array)
        {                                (json object)
          ...,                           The same output as verbosity = 2
          "prevout" : {                  (json object) (Only if undo information is available)
            "generated" : true|false,    (boolean) Coinbase or not
            "height" : n,                (numeric) The height of the prevout
            "value" : n,                 (numeric) The value in BTC
            "scriptPubKey" : {           (json object)
              "asm" : "str",             (string) The asm
              "hex" : "str",             (string) The hex
              "address" : "str",         (string, optional) The Bitcoin address (only if a well-defined address exists)
              "type" : "str"             (string) The type, eg 'pubkeyhash'
            }
          }
        },
        ...
      ]
    },
    ...
  ]
}

@kiminuo
Copy link
Contributor Author

kiminuo commented Dec 3, 2021

(but 3a6a670 doesn't exist in the "Commits" tab after the force-push. I don't know if the standard practice is to ACK only what is in the tab?)

Typically one ACKs the last commit from https://github.com/bitcoin/bitcoin/pull/23320/commits page because that's the current version of the PR.

You can also possibly ACK a commit from previous git (force) push to say something like "I really like the previous changeset as opposed to the current changeset" but that would be rare AFAIK.

Thank you for the review!

luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Dec 14, 2021
@kiminuo
Copy link
Contributor Author

kiminuo commented Dec 27, 2021

@pg156 Could you please re-review?
@MarcoFalke Would you mind having a look, please?

@pg156
Copy link

pg156 commented Jan 3, 2022

ACK 059f88b

@laanwj
Copy link
Member

laanwj commented Jan 4, 2022

re-ACK 059f88b

@laanwj laanwj merged commit 66be456 into bitcoin:master Jan 4, 2022
@kiminuo kiminuo deleted the feature/2021-10-20-verbosity-level-3-nits branch January 4, 2022 14:39
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jan 4, 2022
059f88b Add RPC help for getblock verbosity level 3 (Kiminuo)
1bdd5f6 Address review comments from bitcoin#22918 (Kiminuo)

Pull request description:

  This is a follow-up PR to bitcoin#22918 which addresses review comments (first commit). The second commit adds missing RPC help for verbosity level 3.

ACKs for top commit:
  pg156:
    ACK bitcoin@059f88b
  laanwj:
    re-ACK 059f88b

Tree-SHA512: f27d53ac34b93a304ef5668701ed2b5c986a926bc8ad0df4de89695fc9e1df26acb008611451319ea897658acd9c56c6a0555d60359960c9cd28238ebefa2d50
maflcko pushed a commit to bitcoin-core/gui that referenced this pull request Feb 21, 2022
…ioning output types

c821ab8 Use `GetAllOutputTypes` in `getblock` RPC function (Kiminuo)
d970a85 Move `GetAllOutputTypes` function from `rpc/rawtransaction.cpp` to `rpc/util.{h|cpp}` (Kiminuo)

Pull request description:

  This PR attempts to replicate https://github.com/bitcoin/bitcoin/blob/0ccf9b2e5594581deef2f60174c3651a57f93b64/src/rpc/rawtransaction.cpp#L547 to one other place (at the moment) so that users have better idea what RPC methods can actually return.

  I created this PR as a follow-up to the idea mentioned here bitcoin/bitcoin#23320 (comment) (resolved).

ACKs for top commit:
  kristapsk:
    re-ACK c821ab8

Tree-SHA512: 5ff66a41ad7c43ec769f4a99933d2d070feea7c617286d94b6f9bfa1a2547a42211915778210a89074ad4b14d99f34852cc6871efed5e6f1e2ffedd40d669386
@bitcoin bitcoin locked and limited conversation to collaborators Jan 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants