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

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

    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).

      0diff --git a/tmp/old/d_objdump b/tmp/new/d_objdump
      1index 6bd4ff20d4..1a2f13bc07 100644
      2--- a/tmp/old/d_objdump
      3+++ b/tmp/new/d_objdump
      4@@ -19346 +19346 @@ Disassembly of section .text:
      5   3d495:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
      6@@ -31578 +31578 @@ Disassembly of section .text:
      7   4d31d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
      8@@ -31881 +31881 @@ Disassembly of section .text:
      9   4d9e8:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     10@@ -32610 +32610 @@ Disassembly of section .text:
     11   4ead3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     12@@ -32635 +32635 @@ Disassembly of section .text:
     13   4eb70:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     14@@ -32732 +32732 @@ Disassembly of section .text:
     15   4edc9:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     16@@ -32858 +32858 @@ Disassembly of section .text:
     17   4f0ce:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     18@@ -32879 +32879 @@ Disassembly of section .text:
     19   4f14c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     20@@ -33268 +33268 @@ Disassembly of section .text:
     21   4fad3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     22@@ -33343 +33343 @@ Disassembly of section .text:
     23   4fca1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     24@@ -33359 +33359 @@ Disassembly of section .text:
     25   4fd08:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     26@@ -33415 +33415 @@ Disassembly of section .text:
     27   4fe58:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     28@@ -33443 +33443 @@ Disassembly of section .text:
     29   4ff03:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     30@@ -33895 +33895 @@ Disassembly of section .text:
     31   509ac:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     32@@ -36937 +36937 @@ Disassembly of section .text:
     33   54106:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     34@@ -37772 +37772 @@ Disassembly of section .text:
     35   553a7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     36@@ -37909 +37909 @@ Disassembly of section .text:
     37   55686:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     38@@ -39117 +39117 @@ Disassembly of section .text:
     39   56fec:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     40@@ -39219 +39219 @@ Disassembly of section .text:
     41   571d6:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     42@@ -40946 +40946 @@ Disassembly of section .text:
     43   597cc:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     44@@ -41106 +41106 @@ Disassembly of section .text:
     45   59b40:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     46@@ -41118 +41118 @@ Disassembly of section .text:
     47   59b90:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     48@@ -43828 +43828 @@ Disassembly of section .text:
     49   5d4e2:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     50@@ -43855 +43855 @@ Disassembly of section .text:
     51   5d58f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     52@@ -43940 +43940 @@ Disassembly of section .text:
     53   5d758:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     54@@ -69277 +69277 @@ Disassembly of section .text:
     55   77720:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     56@@ -69457 +69457 @@ Disassembly of section .text:
     57   77a03:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     58@@ -70352 +70352 @@ Disassembly of section .text:
     59   78880:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     60@@ -71732 +71732 @@ Disassembly of section .text:
     61   7a12c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     62@@ -97948 +97948 @@ Disassembly of section .text:
     63   97257:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     64@@ -97977 +97977 @@ Disassembly of section .text:
     65   972da:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     66@@ -138273 +138273 @@ Disassembly of section .text:
     67   c20bd:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     68@@ -155265 +155265 @@ Disassembly of section .text:
     69   d6a5a:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     70@@ -169911 +169911 @@ Disassembly of section .text:
     71   e6eea:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     72@@ -229830 +229830 @@ Disassembly of section .text:
     73  123600:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     74@@ -229855 +229855 @@ Disassembly of section .text:
     75  123677:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     76@@ -229947 +229947 @@ Disassembly of section .text:
     77  12383c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     78@@ -229971 +229971 @@ Disassembly of section .text:
     79  1238d1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     80@@ -229996 +229996 @@ Disassembly of section .text:
     81  12396e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     82@@ -230022 +230022 @@ Disassembly of section .text:
     83  123a0f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     84@@ -230302 +230302 @@ Disassembly of section .text:
     85  123e93:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     86@@ -325034 +325034 @@ Disassembly of section .text:
     87  182109:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     88@@ -385583 +385583 @@ Disassembly of section .text:
     89  1cfd9b:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     90@@ -556782 +556782 @@ Disassembly of section .text:
     91  29fc3a:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     92@@ -564683 +564683 @@ Disassembly of section .text:
     93  2a71a3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     94@@ -573015 +573015 @@ Disassembly of section .text:
     95  2af871:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     96@@ -593321 +593321 @@ Disassembly of section .text:
     97  2c4f9c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
     98@@ -593337 +593337 @@ Disassembly of section .text:
     99  2c5007:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    100@@ -637996 +637996 @@ Disassembly of section .text:
    101  2f1cb7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    102@@ -638009 +638009 @@ Disassembly of section .text:
    103  2f1d06:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    104@@ -639214 +639214 @@ Disassembly of section .text:
    105  2f346d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    106@@ -639227 +639227 @@ Disassembly of section .text:
    107  2f34d1:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    108@@ -643073 +643073 @@ Disassembly of section .text:
    109  2f7dbc:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    110@@ -643098 +643098 @@ Disassembly of section .text:
    111  2f7e33:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    112@@ -643124 +643124 @@ Disassembly of section .text:
    113  2f7eb6:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    114@@ -643149 +643149 @@ Disassembly of section .text:
    115  2f7f2e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    116@@ -645647 +645647 @@ Disassembly of section .text:
    117  2fa8b7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    118@@ -652571 +652571 @@ Disassembly of section .text:
    119  302cf5:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    120@@ -652776 +652776 @@ Disassembly of section .text:
    121  3030a3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    122@@ -660428 +660428 @@ Disassembly of section .text:
    123  30bf6d:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    124@@ -671358 +671358 @@ Disassembly of section .text:
    125  317b1f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    126@@ -671453 +671453 @@ Disassembly of section .text:
    127  317cb7:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    128@@ -683716 +683716 @@ Disassembly of section .text:
    129  325c04:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    130@@ -687507 +687507 @@ Disassembly of section .text:
    131  32a9c3:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    132@@ -722831 +722831 @@ Disassembly of section .text:
    133  34e94c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    134@@ -774728 +774728 @@ Disassembly of section .text:
    135  384581:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    136@@ -774756 +774756 @@ Disassembly of section .text:
    137  384613:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    138@@ -775515 +775515 @@ Disassembly of section .text:
    139  385752:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    140@@ -778167 +778167 @@ Disassembly of section .text:
    141  38890b:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    142@@ -816776 +816776 @@ Disassembly of section .text:
    143  3b1039:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    144@@ -817168 +817168 @@ Disassembly of section .text:
    145  3b174f:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    146@@ -1018869 +1018869 @@ Disassembly of section .text:
    147  49fc24:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    148@@ -1027664 +1027664 @@ Disassembly of section .text:
    149  4a8c38:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    150@@ -1031786 +1031786 @@ Disassembly of section .text:
    151  4acef0:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    152@@ -1078195 +1078195 @@ Disassembly of section .text:
    153  4ded92:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    154@@ -1175949 +1175949 @@ Disassembly of section .text:
    155  54387c:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    156@@ -1232047 +1232047 @@ Disassembly of section .text:
    157  5867bf:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    158@@ -1241981 +1241981 @@ Disassembly of section .text:
    159  59097e:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    160@@ -1422701 +1422701 @@ Disassembly of section .text:
    1610000000000647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>:
    162@@ -1422714 +1422714 @@ Disassembly of section .text:
    163  64773d:	je     64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    164@@ -1422716 +1422716 @@ Disassembly of section .text:
    165  647742:	jne    64777d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x6d>
    166@@ -1422721 +1422721 @@ Disassembly of section .text:
    167  647757:	je     64775d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x4d>
    168@@ -1422723 +1422723 @@ Disassembly of section .text:
    169  64775b:	jmp    64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    170@@ -1422726 +1422726 @@ Disassembly of section .text:
    171  647763:	jne    64777d <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x6d>
    172@@ -1422731 +1422731 @@ Disassembly of section .text:
    173  647778:	je     6477c0 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0xb0>
    174@@ -1422734 +1422734 @@ Disassembly of section .text:
    175  647780:	jne    64778c <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x7c>
    176@@ -1422737 +1422737 @@ Disassembly of section .text:
    177  64778a:	jmp    64779c <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8c>
    178@@ -1422747 +1422747 @@ Disassembly of section .text:
    179  6477b5:	jne    6477c7 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0xb7>
    180@@ -1422753 +1422753 @@ Disassembly of section .text:
    181  6477c5:	jmp    64779f <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const+0x8f>
    182@@ -1469343 +1469343 @@ Disassembly of section .text:
    183  675206:	callq  647710 <ArgsManager::Get{+Int+}Arg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const>
    
  24. MarcoFalke commented at 7:53 am on September 22, 2021: member

    review ACK 5b4749680485bfc32b1ed453bce5015f8a087189 💜

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3review ACK 5b4749680485bfc32b1ed453bce5015f8a087189 💜
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUgy/gv+KxAwgYwxopQXdUWnvHNEXwVR+3pwrRDki3U1WA7vP3X2rYWKYvVrr02c
     8YpR4361XtL9C/SAJbfCeHnKA9gEwmTgZophCx8jRJi1+SyzgSkAYqzlLfV7J8mxC
     953khFqgLzxlQ4QdPCDdYyQZXJYPRIwnrN+2TWkCoDqCwYSf+9Nml9ZZxwdv6uGE0
    10fMxMg3Jes5z5N9kNe3SFIUb6BSVe0oMJRH/ZSgWJbEiQ51ECzALAKrygtTvXD3TE
    11o8aOD+CdRU53cm7605Z7TD3tZt2KdYeHuv8u8xnt7z/L/HwJuk6nCyZbw+xDCPJx
    12ws2nDYclKoqWm+5dNIDQcrPKHA/rSBzMK1Qx/NDwejVZt4FZcMmWU8NUeb5rQ4tl
    13uhAZKNOgLDNuJLozgh4gjBjPChsAcPG8iN9hWQvVWbiKvoN3eYulp/JA0JrVW2b8
    14XptnTG2WjolKPN484SpA0vamCWx+4IGUbVIA8d3dhjpiG2sZwv+AUicaq2+LCMzE
    15y+U8Sdd4
    16=ENki
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 4f858a3b99bca7b8ec087959266bafe189cdb41593a9ae56bcea40bae04969f5 -

  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:

    0@@ -7,5 +7,5 @@
    1 with compile time checking.
    2 
    3 -BEGIN VERIFY SCRIPT-
    4-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'
    5+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'
    6 -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 📨

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3re-ACK 93b9800fec588fc0c258e754405db1e9f89cfb81 📨
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUhsoQv+NLfJRdSCRTCqPhR9Dep3iK1duj4XvvoYRP89eikIjevfNPM3bRCXEm0Q
     8rgyEaxfo5QdvbOZU9gwLjCFUbYGrkNAD1m66LRBf71Bqk+5FJ+wZHDo6cd/RpRxZ
     9Ijv73U9D1L/bI33ftzVc8yrRCLzU7oYuxgSwX9/OxJqmm1GfdQ4TsJ3xwtX9aBz9
    10etqr5pX+iTPNfGPMKbKci6qGCkUys8ANt7XoNV8O92cczq9IPlQrau0YJ81Mulaw
    11jwWn48I3P1gMHx4y9MoWl1xH+0ddoBnGI4PyVwKECUBPac//jZspAkp5PtF3oF8l
    124/ejTHzDeA84oanUoAEq3jMbv0dleBxdQkVDB4fs7+JhIxCgW5H7IjSgtlU3G07r
    13POmz9Y6N/5JG1c22T9tPn385M5pCda2LTfXawusRPuLzCtcrvOC1JnfU/MbKfkvX
    14zPfVFe8Vt/2W9VKGnOjvkTtQCgwLMOHEc9OjTSOSBL+GoffQrBUwN8KOUVRewCtX
    15PYZLdVyl
    16=6CRv
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 6a0788037cf2c7d2a33005e2ca5b19d4e0ecf44890a2d5133d708fd3c90446a9 -

  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: 2024-12-18 21:12 UTC

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