rpc: Remove duplicate name and argNames from CRPCCommand #20012

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:2009-rpcCheckMapping changing 16 files +284 −349
  1. MarcoFalke commented at 7:28 AM on September 25, 2020: member

    Currently, the RPC argument names are specified twice to simplify consistency linting. To avoid having to specify the argnames twice when adding new arguments, remove the linter and add an equivalent test based on RPCHelpMan.

  2. MarcoFalke force-pushed on Sep 25, 2020
  3. DrahtBot added the label GUI on Sep 25, 2020
  4. DrahtBot added the label Mining on Sep 25, 2020
  5. DrahtBot added the label RPC/REST/ZMQ on Sep 25, 2020
  6. DrahtBot added the label Wallet on Sep 25, 2020
  7. promag commented at 9:24 AM on September 25, 2020: member

    Concept ACK

  8. MarcoFalke cross-referenced this on Sep 25, 2020 from issue rpc: remove deprecated CRPCCommand constructor by MarcoFalke
  9. DrahtBot commented at 1:05 PM on September 25, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20664 (Add scanblocks RPC call by jonasschnelli)
    • #20459 (rpc: Fail to return undocumented return values by MarcoFalke)
    • #20429 (refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size by theStack)
    • #20391 (wallet: introduce setfeerate (an improved settxfee, in sat/vB) by jonatack)
    • #20295 (rpc: getblockfrompeer by Sjors)
    • #19825 (rpc: simpler setban and new ban manipulation commands by dhruv)
    • #19602 (wallet: Migrate legacy wallets to descriptor wallets by achow101)
    • #19521 (Coinstats Index (without UTXO set hash) by fjahr)
    • #19443 (rpc: Add options argument to listtransactions, with paginatebypointer options by kristapsk)
    • #19160 (multiprocess: Add basic spawn and IPC support by ryanofsky)
    • #17211 (Allow fundrawtransaction and walletcreatefundedpsbt to take external inputs by achow101)
    • #16546 (External signer support - Wallet Box edition by Sjors)
    • #16439 (cli/gui: support "@height" in place of blockhash for getblock on client side by ajtowns)
    • #15129 (rpc: Added ability to remove watch only addresses by benthecarman)
    • #14707 ([RPC] Include coinbase transactions in receivedby RPCs by andrewtoth)

    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.

  10. DrahtBot cross-referenced this on Sep 25, 2020 from issue rpc: Add dumpcoinstats by fjahr
  11. DrahtBot cross-referenced this on Sep 25, 2020 from issue wallet: Migrate legacy wallets to descriptor wallets by achow101
  12. DrahtBot cross-referenced this on Sep 25, 2020 from issue Coinstats Index by fjahr
  13. DrahtBot cross-referenced this on Sep 25, 2020 from issue send* RPCs in the wallet returns the "fee reason" by stackman27
  14. DrahtBot cross-referenced this on Sep 25, 2020 from issue multiprocess: Add basic spawn and IPC support by ryanofsky
  15. DrahtBot cross-referenced this on Sep 25, 2020 from issue RPC: Internal named params by luke-jr
  16. DrahtBot cross-referenced this on Sep 25, 2020 from issue Allow fundrawtransaction and walletcreatefundedpsbt to take external inputs by achow101
  17. DrahtBot cross-referenced this on Sep 25, 2020 from issue External signer support - Wallet Box edition by Sjors
  18. DrahtBot cross-referenced this on Sep 25, 2020 from issue rpc: Added ability to remove watch only addresses by benthecarman
  19. DrahtBot cross-referenced this on Sep 25, 2020 from issue [tests] Allow outbound & block-relay-only connections in functional tests. by amitiuttarwar
  20. DrahtBot cross-referenced this on Sep 26, 2020 from issue rpc: Add options argument to listtransactions, with paginatebypointer options by kristapsk
  21. DrahtBot cross-referenced this on Sep 29, 2020 from issue multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky
  22. DrahtBot cross-referenced this on Sep 29, 2020 from issue multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky
  23. DrahtBot cross-referenced this on Sep 29, 2020 from issue Multiprocess bitcoin by ryanofsky
  24. MarcoFalke force-pushed on Nov 19, 2020
  25. MarcoFalke removed the label GUI on Nov 19, 2020
  26. MarcoFalke removed the label Mining on Nov 19, 2020
  27. MarcoFalke removed the label Wallet on Nov 19, 2020
  28. MarcoFalke added the label Refactoring on Nov 19, 2020
  29. MarcoFalke marked this as ready for review on Nov 19, 2020
  30. DrahtBot cross-referenced this on Nov 19, 2020 from issue rpc: getblockfrompeer by Sjors
  31. DrahtBot cross-referenced this on Nov 19, 2020 from issue wallet, rpc: add listdescriptors command by S3RK
  32. DrahtBot cross-referenced this on Nov 19, 2020 from issue BIP-322 support by kallewoof
  33. DrahtBot cross-referenced this on Nov 19, 2020 from issue rpc: Add RPCContext by promag
  34. DrahtBot cross-referenced this on Nov 19, 2020 from issue Prune locks by luke-jr
  35. DrahtBot cross-referenced this on Nov 20, 2020 from issue Add address-based index (attempt 4?) by marcinja
  36. MarcoFalke force-pushed on Nov 20, 2020
  37. MarcoFalke force-pushed on Nov 20, 2020
  38. MarcoFalke force-pushed on Nov 20, 2020
  39. MarcoFalke force-pushed on Nov 20, 2020
  40. DrahtBot cross-referenced this on Nov 23, 2020 from issue rpc: Fail to return undocumented return values by MarcoFalke
  41. DrahtBot cross-referenced this on Nov 28, 2020 from issue wallet: introduce setfeerate (an improved settxfee, in sat/vB) by jonatack
  42. DrahtBot cross-referenced this on Dec 3, 2020 from issue RPC/Net: Allow changing the connection_type for addnode onetry by luke-jr
  43. DrahtBot cross-referenced this on Dec 14, 2020 from issue rpc: simpler setban and new ban manipulation commands by dhruv
  44. DrahtBot cross-referenced this on Dec 16, 2020 from issue Add scanblocks RPC call by jonasschnelli
  45. DrahtBot cross-referenced this on Dec 18, 2020 from issue [RPC] Include coinbase transactions in receivedby RPCs by andrewtoth
  46. DrahtBot cross-referenced this on Dec 18, 2020 from issue rpc: Add getblocklocations call by romanz
  47. DrahtBot cross-referenced this on Dec 23, 2020 from issue rpc: Allow to ignore specific policy reject reasons by MarcoFalke
  48. stackman27 commented at 1:44 AM on December 29, 2020: contributor

    ACK Code review and Built successful. This definitely looks cleaner than the old version and eliminates lots of repetitions

  49. DrahtBot added the label Needs rebase on Jan 11, 2021
  50. MarcoFalke force-pushed on Jan 12, 2021
  51. DrahtBot removed the label Needs rebase on Jan 12, 2021
  52. MarcoFalke commented at 9:34 AM on January 12, 2021: member

    Rebased

  53. DrahtBot cross-referenced this on Jan 12, 2021 from issue refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size by theStack
  54. DrahtBot cross-referenced this on Jan 12, 2021 from issue cli/gui: support "@height" in place of blockhash for getblock on client side by ajtowns
  55. ryanofsky approved
  56. ryanofsky commented at 4:10 PM on January 21, 2021: contributor

    Code review ACK fafd58e4dc4089d5aa450feefa9af27f9b34c297. Nice cleanup which gets rid of some parameter repetition dealing with RPCs. It's also nice to drop some c++ parsing code. The previous asserts and new test updates seem to make this pretty foolproof and ensure there's no change in behavior.

  57. MarcoFalke cross-referenced this on Jan 22, 2021 from issue doc: add instructions for generating RPC docs by ben-kaufman
  58. jonasschnelli commented at 7:52 AM on January 25, 2021: contributor

    Much tidier! Concept ACK

  59. DrahtBot added the label Needs rebase on Jan 28, 2021
  60. rpc: [refactor] Use concise C++11 code in CRPCConvertTable constructor faf835680b
  61. rpc: Use RPCHelpMan for check-rpc-mappings linter fa92912b4b
  62. MarcoFalke force-pushed on Jan 28, 2021
  63. rpc: Remove duplicate name and argNames from CRPCCommand fa04f9b4dd
  64. MarcoFalke force-pushed on Jan 28, 2021
  65. MarcoFalke commented at 7:43 AM on January 28, 2021: member

    Rebased, should be trivial to re-ACK

  66. MarcoFalke commented at 7:43 AM on January 28, 2021: member

    @laanwj As the author of test/lint/check-rpc-mappings.py, could you take a look here on the python changes?

  67. DrahtBot removed the label Needs rebase on Jan 28, 2021
  68. laanwj commented at 6:24 PM on January 28, 2021: member

    ACK fa04f9b4ddffc5ef23c2ee7f3cc72a7c2ae49204 Not sad to see that script go.

  69. laanwj merged this on Jan 28, 2021
  70. laanwj closed this on Jan 28, 2021

  71. MarcoFalke deleted the branch on Jan 28, 2021
  72. sidhujag referenced this in commit 30a8d4142f on Jan 29, 2021
  73. sidhujag referenced this in commit 48442dd499 on Jan 29, 2021
  74. in src/rpc/server.cpp:492 in fa92912b4b outdated
     483 | @@ -479,6 +484,18 @@ std::vector<std::string> CRPCTable::listCommands() const
     484 |      return commandList;
     485 |  }
     486 |  
     487 | +UniValue CRPCTable::dumpArgMap() const
     488 | +{
     489 | +    UniValue ret{UniValue::VARR};
     490 | +    for (const auto& cmd : mapCommands) {
     491 | +        for (const auto& c : cmd.second) {
     492 | +            const auto help = RpcMethodFnType(c->unique_id)();
    


    ryanofsky commented at 11:58 PM on January 29, 2021:

    In commit "rpc: Use RPCHelpMan for check-rpc-mappings linter" (fa92912b4bb4629addcbfdfb7cc000be701614af)

    I missed this in initial review, but this cast from unique_id to function pointer isn't really safe. Or at least it results in segfaults with #10102 (https://cirrus-ci.com/task/5469433013469184?command=ci#L2275). The unique_id field was really only supposed to be used to detect RPC aliases, not be converted to a function pointer and called. #21035 updates this to take a different approach making arg retrieval work more like help retrieval.

  75. domob1812 referenced this in commit dd4f6f1a8b on Feb 1, 2021
  76. domob1812 referenced this in commit c4af2fd596 on Feb 1, 2021
  77. luke-jr cross-referenced this on Jul 7, 2021 from issue Bugfix: Workaround UniValue push_back(bool) limitation with push_back(UniValue(bool)) by luke-jr
  78. Fabcien referenced this in commit 427e5fc8ea on Jan 5, 2022
  79. Fabcien referenced this in commit 25e918ce93 on Jan 5, 2022
  80. Fabcien referenced this in commit 27d3f1aaa0 on Jan 5, 2022
  81. bitcoin locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC