{
 "number": 36384,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36384",
 "title": "rpc: Use self.Arg<_>(name) helper over manual and duplicate parsing",
 "author": "maflcko",
 "author_association": "MEMBER",
 "created_at": "2026-09-29T20:05:33Z",
 "updated_at": "2026-10-31T19:17:36Z",
 "description_hash": "dc490178d8a47c2f",
 "age_days": 33,
 "draft": false,
 "labels": [
  "RPC/REST/ZMQ"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "faf493feb4b062ff8d74a5792e3254f0daf98ac6",
 "head_ref": "2609-rpc-arg-defaults-duplicate",
 "head_repo": "maflcko/bitcoin-core",
 "head_history": [
  {
   "t": "2026-09-29T20:27:23Z",
   "sha": "fad770d4df265a1f4dfa13e9290ff8191a9516b9"
  },
  {
   "t": "2026-09-29T20:41:28Z",
   "sha": "fa745e120ebdc6e25a03b570c5e63abf0052bbac"
  },
  {
   "t": "2026-09-30T14:41:13Z",
   "sha": "fac03fd4e9f27aa7fc9ce9a4c614bfde0b378f2c"
  },
  {
   "t": "2026-09-30T15:49:35Z",
   "sha": "fa77e126033aaa19bee00a91ab7af0027db8d20b"
  },
  {
   "t": "2026-10-19T13:49:34Z",
   "sha": "faf493feb4b062ff8d74a5792e3254f0daf98ac6"
  }
 ],
 "additions": 75,
 "deletions": 133,
 "changed_files": 14,
 "commit_count": 4,
 "size_bucket": "M",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "fanquake",
      "url": "https://github.com/bitcoin/bitcoin/pull/36384#issuecomment-5928556190"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "fanquake": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-10-01T09:23:33Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 1,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "fanquake"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-19T13:49:34Z",
  "last_reviewer_activity": "2026-10-01T09:23:33Z",
  "last_reviewer": "fanquake",
  "author_silent_days": 13,
  "waiting_on_author_days": 0,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "The `Arg()` helper has many benefits:\n\n* It does not require manual `isNull` checks\n* It does not require hard-coding the fallback/default value a second time\n* It does not require manually specifying the getter for the type. Specifying the type is enough.\n\nSo use it more broadly.",
 "commits": [
  {
   "sha": "faf3065478203656eec44dd0a9f2c5ba3d7d7f58",
   "date": "2026-10-19T13:48:42Z",
   "message": "rpc: Use the first arg name in GetParamIndex\n\nGetName does not support aliases at all. However, it should be fine for\nGetParamIndex (used in Arg and MaybeArg) to support lookup by the first\nname.\n\nThe test is modified to show the second legacy alias is ignored."
  },
  {
   "sha": "fad499442cfcaecdefc70742cda12a716dafd592",
   "date": "2026-10-19T13:48:43Z",
   "message": "rpc: doc: Use proper RPCArg::Default in verifychain"
  },
  {
   "sha": "fa7770e3740cea0d606cb49371b92f1dc30c88e2",
   "date": "2026-10-19T13:48:47Z",
   "message": "refactor: rpc: Use self.Arg<_>(name) helper over manual isNull() ? fallback : getter()\n\nThe Arg() helper has many benefits:\n\n* It does not require manual isNull checks\n* It does not require hard-coding the fallback/default value a second time\n* It does not require manually specifying the getter for the type. Specifying the type is enough.\n\nSo use it in this refactor, which does not change any behavior."
  },
  {
   "sha": "faf493feb4b062ff8d74a5792e3254f0daf98ac6",
   "date": "2026-10-19T13:49:04Z",
   "message": "doc: Fix typo in walletcreatefundedpsbt dev comment\n\nUse same wording as in walletprocesspsbt"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-29T20:27:23Z",
   "kind": "force_push",
   "who": "maflcko",
   "commit": "fad770d4df265a1f4dfa13e9290ff8191a9516b9",
   "id": "push:fad770d4df265a1f4dfa13e9290ff8191a9516b9"
  },
  {
   "t": "2026-09-29T20:41:28Z",
   "kind": "force_push",
   "who": "maflcko",
   "commit": "fa745e120ebdc6e25a03b570c5e63abf0052bbac",
   "id": "push:fa745e120ebdc6e25a03b570c5e63abf0052bbac"
  },
  {
   "t": "2026-09-30T14:41:13Z",
   "kind": "force_push",
   "who": "maflcko",
   "commit": "fac03fd4e9f27aa7fc9ce9a4c614bfde0b378f2c",
   "id": "push:fac03fd4e9f27aa7fc9ce9a4c614bfde0b378f2c"
  },
  {
   "t": "2026-09-30T15:49:35Z",
   "kind": "force_push",
   "who": "maflcko",
   "commit": "fa77e126033aaa19bee00a91ab7af0027db8d20b",
   "id": "push:fa77e126033aaa19bee00a91ab7af0027db8d20b"
  },
  {
   "t": "2026-10-01T09:23:33Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "Concept ACK",
   "id": "c:5928556190",
   "url": "https://github.com/bitcoin/bitcoin/pull/36384#issuecomment-5928556190",
   "hash": "e8334cc43879b73c",
   "edited": null
  },
  {
   "t": "2026-10-01T09:39:23Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "Forgot to say that everything here is a refactor, except for the cleanup commit that changes the schema of one RPC:\n\n```diff\ndiff --git a/getopenrpcinfo.full.json b/getopenrpcinfo.full.json\nindex e0cebef..cbbf785 100644\n--- a/getopenrpcinfo.full.json\n+++ b/getopenrpcinfo.full.json\n@@ -15035,5 +15035,5 @@\n                         \"type\": \"number\",\n-                        \"x-bitcoin-default-hint\": \"3, range=0-4\"\n+                        \"default\": 3\n                     },\n-                    \"description\": \"How thorough the block verification is:\\n- level 0 reads the blocks from disk\\n- level 1 verifies block validity\\n- level 2 verifies undo data\\n- level 3 checks disconnection of tip blocks\\n- level 4 tries to reconnect the blocks\\n- each level includes the checks of the previous levels\"\n+                    \"description\": \"How thorough the block verification is (range 0-4):\\n- level 0 reads the blocks from disk\\n- level 1 verifies block validity\\n- level 2 verifies undo data\\n- level 3 checks disconnection of tip blocks\\n- level 4 tries to reconnect the blocks\\n- each level includes the checks of the previous levels\"\n                 },\n@@ -15044,5 +15044,5 @@\n                         \"type\": \"number\",\n-                        \"x-bitcoin-default-hint\": \"6, 0=all\"\n+                        \"default\": 6\n                     },\n-                    \"description\": \"The number of blocks to check.\"\n+                    \"description\": \"The number of blocks to check (0=all).\"\n                 }\ndiff --git a/verifychain b/verifychain\nindex b742f17..1863a80 100644\n--- a/verifychain\n+++ b/verifychain\n@@ -5,3 +5,3 @@ Verifies blockchain database.\n Arguments:\n-1. checklevel    (numeric, optional, default=3, range=0-4) How thorough the block verification is:\n+1. checklevel    (numeric, optional, default=3) How thorough the block verification is (range 0-4):\n                  - level 0 reads the blocks from disk\n@@ -12,3 +12,3 @@ Arguments:\n                  - each level includes the checks of the previous levels\n-2. nblocks       (numeric, optional, default=6, 0=all) The number of blocks to check.\n+2. nblocks       (numeric, optional, default=6) The number of blocks to check (0=all).",
   "id": "c:5928815864",
   "url": "https://github.com/bitcoin/bitcoin/pull/36384#issuecomment-5928815864",
   "hash": "4d679f3d4d295854",
   "edited": null
  },
  {
   "t": "2026-10-19T13:49:34Z",
   "kind": "force_push",
   "who": "maflcko",
   "commit": "faf493feb4b062ff8d74a5792e3254f0daf98ac6",
   "id": "push:faf493feb4b062ff8d74a5792e3254f0daf98ac6"
  }
 ],
 "labels_log": [
  {
   "t": "2026-09-29T20:05:37Z",
   "action": "labeled",
   "label": "RPC/REST/ZMQ",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-29T20:28:41Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-09-30T16:58:51Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 3391,
 "text_tokens_estimate": 847,
 "changed_paths": [
  "src/rpc/blockchain.cpp",
  "src/rpc/fees.cpp",
  "src/rpc/mempool.cpp",
  "src/rpc/mining.cpp",
  "src/rpc/net.cpp",
  "src/rpc/rawtransaction.cpp",
  "src/rpc/util.cpp",
  "src/test/rpc_tests.cpp",
  "src/wallet/rpc/addresses.cpp",
  "src/wallet/rpc/backup.cpp",
  "src/wallet/rpc/coins.cpp",
  "src/wallet/rpc/spend.cpp",
  "src/wallet/rpc/transactions.cpp",
  "src/wallet/rpc/wallet.cpp"
 ],
 "files": [
  {
   "path": "src/rpc/blockchain.cpp",
   "add": 18,
   "del": 34
  },
  {
   "path": "src/rpc/fees.cpp",
   "add": 1,
   "del": 4
  },
  {
   "path": "src/rpc/mempool.cpp",
   "add": 6,
   "del": 16
  },
  {
   "path": "src/rpc/mining.cpp",
   "add": 3,
   "del": 3
  },
  {
   "path": "src/rpc/net.cpp",
   "add": 4,
   "del": 7
  },
  {
   "path": "src/rpc/rawtransaction.cpp",
   "add": 6,
   "del": 12
  },
  {
   "path": "src/rpc/util.cpp",
   "add": 4,
   "del": 4
  },
  {
   "path": "src/test/rpc_tests.cpp",
   "add": 2,
   "del": 2
  },
  {
   "path": "src/wallet/rpc/addresses.cpp",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/wallet/rpc/backup.cpp",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/wallet/rpc/coins.cpp",
   "add": 4,
   "del": 14
  },
  {
   "path": "src/wallet/rpc/spend.cpp",
   "add": 9,
   "del": 12
  },
  {
   "path": "src/wallet/rpc/transactions.cpp",
   "add": 11,
   "del": 18
  },
  {
   "path": "src/wallet/rpc/wallet.cpp",
   "add": 5,
   "del": 5
  }
 ],
 "test_lines": 4,
 "git": {
  "head": "faf493feb4b062ff8d74a5792e3254f0daf98ac6",
  "head_matches_backup": true,
  "base": "3983b5823badc14e92fe77996da7ed7587aba1fc",
  "patch_id": "1203b129330c3cba",
  "commits": [
   {
    "sha": "faf3065478",
    "subject": "rpc: Use the first arg name in GetParamIndex",
    "files": 2,
    "add": 4,
    "del": 6
   },
   {
    "sha": "fad499442c",
    "subject": "rpc: doc: Use proper RPCArg::Default in verifychain",
    "files": 1,
    "add": 8,
    "del": 8
   },
   {
    "sha": "fa7770e374",
    "subject": "refactor: rpc: Use self.Arg<_>(name) helper over manual isNull() ? fallback : getter()",
    "files": 13,
    "add": 62,
    "del": 118
   },
   {
    "sha": "faf493feb4",
    "subject": "doc: Fix typo in walletcreatefundedpsbt dev comment",
    "files": 1,
    "add": 1,
    "del": 1
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "1203b129330c3cba",
 "input_hash": "4a0f567efe533027",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}