scripted-diff: Rename overloaded int GetArg to GetIntArg #22976

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/intarg changing 26 files +93 −93
  1. ryanofsky commented at 1:35 AM on September 15, 2021: member

    This is meant to improve readability of code and remove guesswork needed to determine argument types and migrate to typed arguments (#22978) by having distinctly named GetArg GetArgs GetBoolArg and GetIntArg methods.


    This commit was originally part of #22766 and had some review discussion there. But it was wisely suggested to be split off to make that PR smaller.

  2. DrahtBot added the label Consensus on Sep 15, 2021
  3. DrahtBot added the label GUI on Sep 15, 2021
  4. DrahtBot added the label Mining on Sep 15, 2021
  5. DrahtBot added the label P2P on Sep 15, 2021
  6. DrahtBot added the label Refactoring on Sep 15, 2021
  7. DrahtBot added the label RPC/REST/ZMQ on Sep 15, 2021
  8. DrahtBot added the label Utils/log/libs on Sep 15, 2021
  9. DrahtBot added the label UTXO Db and Indexes on Sep 15, 2021
  10. DrahtBot added the label Validation on Sep 15, 2021
  11. DrahtBot added the label Wallet on Sep 15, 2021
  12. MarcoFalke removed the label GUI on Sep 15, 2021
  13. MarcoFalke removed the label Wallet on Sep 15, 2021
  14. MarcoFalke removed the label UTXO Db and Indexes on Sep 15, 2021
  15. MarcoFalke removed the label RPC/REST/ZMQ on Sep 15, 2021
  16. MarcoFalke removed the label P2P on Sep 15, 2021
  17. MarcoFalke removed the label Mining on Sep 15, 2021
  18. MarcoFalke removed the label Validation on Sep 15, 2021
  19. MarcoFalke removed the label Consensus on Sep 15, 2021
  20. MarcoFalke removed the label Utils/log/libs on Sep 15, 2021
  21. DrahtBot commented at 10:01 PM on September 15, 2021: member

    <!--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:

    • #23095 (refactor: Use C++17 std::clamp by hebasto)
    • #23061 (Fix (inverse) meaning of -persistmempool by MarcoFalke)
    • #22950 ([p2p] Pimpl AddrMan to abstract implementation details by amitiuttarwar)
    • #22674 (validation: mempool validation and submission for packages of 1 child + parents by glozow)
    • #22290 (Package Mempool Submission with Package Fee-Bumping by glozow)
    • #21726 (Improve Indices on pruned nodes via prune blockers by fjahr)
    • #21527 (net_processing: lock clean up by ajtowns)
    • #20196 (net: fix GetListenPort() to derive the proper port by vasild)

    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.

  22. fanquake added this to the "Blockers" column in a project

  23. MarcoFalke commented at 7:53 AM on September 22, 2021: member

    Inspected the binary to check that only the right calls (with second argument long) are replaced. IIUC the patch should be correct if it compiles, because GetArg was only used for types that don't convert into each other (strings and integers).

    <details><summary>git diff --word-diff-regex=. -U0 -- /tmp/{old,new}/d_objdump</summary>

    diff --git a/tmp/old/d_objdump b/tmp/new/d_objdump
    index 6bd4ff20d4..1a2f13bc07 100644
    --- a/tmp/old/d_objdump
    +++ b/tmp/new/d_objdump
    @@ -19346 +19346 @@ Disassembly of section .text:
       3d495:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -31578 +31578 @@ Disassembly of section .text:
       4d31d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -31881 +31881 @@ Disassembly of section .text:
       4d9e8:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -32610 +32610 @@ Disassembly of section .text:
       4ead3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -32635 +32635 @@ Disassembly of section .text:
       4eb70:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -32732 +32732 @@ Disassembly of section .text:
       4edc9:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -32858 +32858 @@ Disassembly of section .text:
       4f0ce:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -32879 +32879 @@ Disassembly of section .text:
       4f14c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33268 +33268 @@ Disassembly of section .text:
       4fad3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33343 +33343 @@ Disassembly of section .text:
       4fca1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33359 +33359 @@ Disassembly of section .text:
       4fd08:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33415 +33415 @@ Disassembly of section .text:
       4fe58:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33443 +33443 @@ Disassembly of section .text:
       4ff03:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -33895 +33895 @@ Disassembly of section .text:
       509ac:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -36937 +36937 @@ Disassembly of section .text:
       54106:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -37772 +37772 @@ Disassembly of section .text:
       553a7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -37909 +37909 @@ Disassembly of section .text:
       55686:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -39117 +39117 @@ Disassembly of section .text:
       56fec:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -39219 +39219 @@ Disassembly of section .text:
       571d6:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -40946 +40946 @@ Disassembly of section .text:
       597cc:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -41106 +41106 @@ Disassembly of section .text:
       59b40:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -41118 +41118 @@ Disassembly of section .text:
       59b90:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -43828 +43828 @@ Disassembly of section .text:
       5d4e2:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -43855 +43855 @@ Disassembly of section .text:
       5d58f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -43940 +43940 @@ Disassembly of section .text:
       5d758:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -69277 +69277 @@ Disassembly of section .text:
       77720:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -69457 +69457 @@ Disassembly of section .text:
       77a03:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -70352 +70352 @@ Disassembly of section .text:
       78880:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -71732 +71732 @@ Disassembly of section .text:
       7a12c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -97948 +97948 @@ Disassembly of section .text:
       97257:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -97977 +97977 @@ Disassembly of section .text:
       972da:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -138273 +138273 @@ Disassembly of section .text:
       c20bd:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -155265 +155265 @@ Disassembly of section .text:
       d6a5a:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -169911 +169911 @@ Disassembly of section .text:
       e6eea:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -229830 +229830 @@ Disassembly of section .text:
      123600:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -229855 +229855 @@ Disassembly of section .text:
      123677:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -229947 +229947 @@ Disassembly of section .text:
      12383c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -229971 +229971 @@ Disassembly of section .text:
      1238d1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -229996 +229996 @@ Disassembly of section .text:
      12396e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -230022 +230022 @@ Disassembly of section .text:
      123a0f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -230302 +230302 @@ Disassembly of section .text:
      123e93:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -325034 +325034 @@ Disassembly of section .text:
      182109:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -385583 +385583 @@ Disassembly of section .text:
      1cfd9b:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -556782 +556782 @@ Disassembly of section .text:
      29fc3a:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -564683 +564683 @@ Disassembly of section .text:
      2a71a3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -573015 +573015 @@ Disassembly of section .text:
      2af871:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -593321 +593321 @@ Disassembly of section .text:
      2c4f9c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -593337 +593337 @@ Disassembly of section .text:
      2c5007:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -637996 +637996 @@ Disassembly of section .text:
      2f1cb7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -638009 +638009 @@ Disassembly of section .text:
      2f1d06:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -639214 +639214 @@ Disassembly of section .text:
      2f346d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -639227 +639227 @@ Disassembly of section .text:
      2f34d1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -643073 +643073 @@ Disassembly of section .text:
      2f7dbc:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -643098 +643098 @@ Disassembly of section .text:
      2f7e33:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -643124 +643124 @@ Disassembly of section .text:
      2f7eb6:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -643149 +643149 @@ Disassembly of section .text:
      2f7f2e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -645647 +645647 @@ Disassembly of section .text:
      2fa8b7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -652571 +652571 @@ Disassembly of section .text:
      302cf5:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -652776 +652776 @@ Disassembly of section .text:
      3030a3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -660428 +660428 @@ Disassembly of section .text:
      30bf6d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -671358 +671358 @@ Disassembly of section .text:
      317b1f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -671453 +671453 @@ Disassembly of section .text:
      317cb7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -683716 +683716 @@ Disassembly of section .text:
      325c04:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -687507 +687507 @@ Disassembly of section .text:
      32a9c3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -722831 +722831 @@ Disassembly of section .text:
      34e94c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -774728 +774728 @@ Disassembly of section .text:
      384581:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -774756 +774756 @@ Disassembly of section .text:
      384613:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -775515 +775515 @@ Disassembly of section .text:
      385752:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -778167 +778167 @@ Disassembly of section .text:
      38890b:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -816776 +816776 @@ Disassembly of section .text:
      3b1039:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -817168 +817168 @@ Disassembly of section .text:
      3b174f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1018869 +1018869 @@ Disassembly of section .text:
      49fc24:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1027664 +1027664 @@ Disassembly of section .text:
      4a8c38:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1031786 +1031786 @@ Disassembly of section .text:
      4acef0:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1078195 +1078195 @@ Disassembly of section .text:
      4ded92:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1175949 +1175949 @@ Disassembly of section .text:
      54387c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1232047 +1232047 @@ Disassembly of section .text:
      5867bf:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1241981 +1241981 @@ Disassembly of section .text:
      59097e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    @@ -1422701 +1422701 @@ Disassembly of section .text:
    0000000000647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>:
    @@ -1422714 +1422714 @@ Disassembly of section .text:
      64773d:	je     64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    @@ -1422716 +1422716 @@ Disassembly of section .text:
      647742:	jne    64777d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x6d>
    @@ -1422721 +1422721 @@ Disassembly of section .text:
      647757:	je     64775d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x4d>
    @@ -1422723 +1422723 @@ Disassembly of section .text:
      64775b:	jmp    64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    @@ -1422726 +1422726 @@ Disassembly of section .text:
      647763:	jne    64777d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x6d>
    @@ -1422731 +1422731 @@ Disassembly of section .text:
      647778:	je     6477c0 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0xb0>
    @@ -1422734 +1422734 @@ Disassembly of section .text:
      647780:	jne    64778c <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x7c>
    @@ -1422737 +1422737 @@ Disassembly of section .text:
      64778a:	jmp    64779c <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8c>
    @@ -1422747 +1422747 @@ Disassembly of section .text:
      6477b5:	jne    6477c7 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0xb7>
    @@ -1422753 +1422753 @@ Disassembly of section .text:
      6477c5:	jmp    64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    @@ -1469343 +1469343 @@ Disassembly of section .text:
      675206:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    

    </details>

  24. MarcoFalke commented at 7:53 AM on September 22, 2021: member

    review ACK 5b4749680485bfc32b1ed453bce5015f8a087189 💜

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    review ACK 5b4749680485bfc32b1ed453bce5015f8a087189 💜
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUgy/gv+KxAwgYwxopQXdUWnvHNEXwVR+3pwrRDki3U1WA7vP3X2rYWKYvVrr02c
    YpR4361XtL9C/SAJbfCeHnKA9gEwmTgZophCx8jRJi1+SyzgSkAYqzlLfV7J8mxC
    53khFqgLzxlQ4QdPCDdYyQZXJYPRIwnrN+2TWkCoDqCwYSf+9Nml9ZZxwdv6uGE0
    fMxMg3Jes5z5N9kNe3SFIUb6BSVe0oMJRH/ZSgWJbEiQ51ECzALAKrygtTvXD3TE
    o8aOD+CdRU53cm7605Z7TD3tZt2KdYeHuv8u8xnt7z/L/HwJuk6nCyZbw+xDCPJx
    ws2nDYclKoqWm+5dNIDQcrPKHA/rSBzMK1Qx/NDwejVZt4FZcMmWU8NUeb5rQ4tl
    uhAZKNOgLDNuJLozgh4gjBjPChsAcPG8iN9hWQvVWbiKvoN3eYulp/JA0JrVW2b8
    XptnTG2WjolKPN484SpA0vamCWx+4IGUbVIA8d3dhjpiG2sZwv+AUicaq2+LCMzE
    y+U8Sdd4
    =ENki
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 4f858a3b99bca7b8ec087959266bafe189cdb41593a9ae56bcea40bae04969f5 -

    </details>

  25. in src/init.cpp:221 in 5b47496804 outdated
     216 | @@ -217,7 +217,7 @@ void Shutdown(NodeContext& node)
     217 |      node.banman.reset();
     218 |      node.addrman.reset();
     219 |  
     220 | -    if (node.mempool && node.mempool->IsLoaded() && node.args->GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
     221 | +    if (node.mempool && node.mempool->IsLoaded() && node.args->GetIntArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
    


    fanquake commented at 8:58 AM on September 23, 2021:

    @MarcoFalke's #23061 changes this to GetBoolArg. Given the ACK there, I assume that is the more correct change? If that is going to be backported then it can be merged first and this PR rebased on top.


    kiminuo commented at 7:48 PM on September 23, 2021:

    (I would expect so too as DEFAULT_PERSIST_MEMPOOL is a boolean constant.)

  26. LarryRuane commented at 4:52 PM on September 23, 2021: contributor

    ACK 5b4749680485bfc32b1ed453bce5015f8a087189 I verified that all remaining calls to GetArg() have a string as the second argument (although I guess I didn't need to, any of those would not have compiled), and ran the unit (boost) tests.

  27. in src/init.cpp:1219 in 5b47496804 outdated
    1216 | @@ -1217,7 +1217,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
    1217 |      if (!ignores_incoming_txs) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
    1218 |  
    1219 |      assert(!node.mempool);
    1220 | -    int check_ratio = std::min<int>(std::max<int>(args.GetArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
    1221 | +    int check_ratio = std::min<int>(std::max<int>(args.GetIntArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
    


    kiminuo commented at 7:55 PM on September 23, 2021:

    (Not for this PR but looking at the line I would expect std::clamp here)

    edit: Addressed by #23095

  28. in src/validation.cpp:1276 in 5b47496804 outdated
    1262 | @@ -1263,7 +1263,7 @@ void InitScriptExecutionCache() {
    1263 |      g_scriptExecutionCacheHasher.Write(nonce.begin(), 32);
    1264 |      // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,
    1265 |      // setup_bytes creates the minimum possible cache (2 elements).
    1266 | -    size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
    1267 | +    size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetIntArg("-maxsigcachesize", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);
    


    kiminuo commented at 8:06 PM on September 23, 2021:

    (Not for this PR but looking at the line I would expect std::clamp here)

    edit: Addressed by #23095

  29. in src/validation.cpp:2555 in 5b47496804 outdated
    2516 | @@ -2517,7 +2517,7 @@ bool CChainState::ActivateBestChain(BlockValidationState& state, std::shared_ptr
    2517 |  
    2518 |      CBlockIndex *pindexMostWork = nullptr;
    2519 |      CBlockIndex *pindexNewTip = nullptr;
    2520 | -    int nStopAtHeight = gArgs.GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
    2521 | +    int nStopAtHeight = gArgs.GetIntArg("-stopatheight", DEFAULT_STOPATHEIGHT);
    


    kiminuo commented at 8:07 PM on September 23, 2021:

    Not for this PR but isn't it better to cast it explicitely here? It's very easy to think that GetIntArg returns int and not int64_t.

  30. kiminuo approved
  31. kiminuo commented at 8:16 PM on September 23, 2021: contributor

    utACK 5b4749680485bfc32b1ed453bce5015f8a087189

    Went line by line and the patch looks correct to me. https://github.com/bitcoin/bitcoin/pull/22976/files#r714600644 seems good to address though.

  32. DrahtBot added the label Needs rebase on Sep 24, 2021
  33. ryanofsky force-pushed on Sep 24, 2021
  34. ryanofsky commented at 8:58 PM on September 24, 2021: member

    Rebased 5b4749680485bfc32b1ed453bce5015f8a087189 -> 89b96f9082ca32c52e5db646c3b8fcb1299ee2f5 (pr/intarg.1 -> pr/intarg.2, compare) due to conflict with #22818

  35. DrahtBot removed the label Needs rebase on Sep 24, 2021
  36. hebasto commented at 8:09 AM on September 25, 2021: member

    Concept ACK.

  37. hebasto commented at 8:46 AM on September 25, 2021: member

    Suggesting script change:

    @@ -7,5 +7,5 @@
     with compile time checking.
     
     -BEGIN VERIFY SCRIPT-
    -git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_MEMPOOL\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_SIZE\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g'
    +git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g'
     -END VERIFY SCRIPT-
    
  38. DrahtBot added the label Needs rebase on Sep 27, 2021
  39. scripted-diff: Rename overloaded int GetArg to GetIntArg
    Improve readability of code, simplify future scripted diff cleanup PRs, and be
    more consistent with naming for GetBoolArg.
    
    This will also be useful for replacing runtime settings type checking
    with compile time checking.
    
    -BEGIN VERIFY SCRIPT-
    git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g'
    -END VERIFY SCRIPT-
    
    Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
    93b9800fec
  40. ryanofsky force-pushed on Sep 27, 2021
  41. ryanofsky commented at 11:56 AM on September 27, 2021: member

    Rebased 89b96f9082ca32c52e5db646c3b8fcb1299ee2f5 -> 93b9800fec588fc0c258e754405db1e9f89cfb81 (pr/intarg.2 -> pr/intarg.3, compare) due to conflict with #23061. Thanks @hebasto for simplifying the scripted diff after that PR!

  42. hebasto approved
  43. hebasto commented at 12:12 PM on September 27, 2021: member

    ACK 93b9800fec588fc0c258e754405db1e9f89cfb81.

  44. DrahtBot removed the label Needs rebase on Sep 27, 2021
  45. MarcoFalke approved
  46. MarcoFalke commented at 1:12 PM on September 27, 2021: member

    re-ACK 93b9800fec588fc0c258e754405db1e9f89cfb81 📨

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    re-ACK 93b9800fec588fc0c258e754405db1e9f89cfb81 📨
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhsoQv+NLfJRdSCRTCqPhR9Dep3iK1duj4XvvoYRP89eikIjevfNPM3bRCXEm0Q
    rgyEaxfo5QdvbOZU9gwLjCFUbYGrkNAD1m66LRBf71Bqk+5FJ+wZHDo6cd/RpRxZ
    Ijv73U9D1L/bI33ftzVc8yrRCLzU7oYuxgSwX9/OxJqmm1GfdQ4TsJ3xwtX9aBz9
    etqr5pX+iTPNfGPMKbKci6qGCkUys8ANt7XoNV8O92cczq9IPlQrau0YJ81Mulaw
    jwWn48I3P1gMHx4y9MoWl1xH+0ddoBnGI4PyVwKECUBPac//jZspAkp5PtF3oF8l
    4/ejTHzDeA84oanUoAEq3jMbv0dleBxdQkVDB4fs7+JhIxCgW5H7IjSgtlU3G07r
    POmz9Y6N/5JG1c22T9tPn385M5pCda2LTfXawusRPuLzCtcrvOC1JnfU/MbKfkvX
    zPfVFe8Vt/2W9VKGnOjvkTtQCgwLMOHEc9OjTSOSBL+GoffQrBUwN8KOUVRewCtX
    PYZLdVyl
    =6CRv
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 6a0788037cf2c7d2a33005e2ca5b19d4e0ecf44890a2d5133d708fd3c90446a9 -

    </details>

  47. MarcoFalke merged this on Sep 27, 2021
  48. MarcoFalke closed this on Sep 27, 2021

  49. laanwj removed this from the "Blockers" column in a project

  50. sidhujag referenced this in commit d184e0a578 on Sep 27, 2021
  51. Fabcien referenced this in commit 6b97017285 on Sep 12, 2022
  52. DrahtBot locked this on Oct 30, 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-02 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me