Skip to content

rpc: Use OBJ_NAMED_PARAMS in estimatesmartfee - #36976

Open
maflcko wants to merge 7 commits into
bitcoin:masterfrom
maflcko:2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS
Open

maflcko wants to merge 7 commits into
bitcoin:masterfrom
maflcko:2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS

Conversation

@maflcko

@maflcko maflcko commented Nov 25, 2026

Copy link
Copy Markdown
Member

estimatesmartfee is the only RPC that rejects named arguments for options, which seems confusing and not user friendly.

Fix it by using OBJ_NAMED_PARAMS.

@DrahtBot DrahtBot changed the title rpc: Use OBJ_NAMED_PARAMS in estimatesmartfee rpc: Use OBJ_NAMED_PARAMS in estimatesmartfee Nov 25, 2026
@DrahtBot

DrahtBot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK l0rinc

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36990 (test: replace hard-coded RPC error codes by l0rinc)
  • #36979 (rpc: fix getorphantxs verbosity help and type checking by l0rinc)
  • #36257 (qa: assert_equal -> assert_true/assert_false by hodlinator)
  • #36033 ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko)
  • #35302 (Silent Payments: Sending (take 2) by Eunovo)
  • #33741 (rpc: Optionally print feerates in sat/vb by polespinasa)
  • #32857 (wallet: allow skipping script paths by Sjors)

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.

@maflcko
maflcko force-pushed the 2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS branch 2 times, most recently from fa58135 to bbbbf03 Compare November 26, 2026 11:59
@maflcko

maflcko commented Nov 26, 2026

Copy link
Copy Markdown
Member Author
rendered diff
diff --git a/createwalletdescriptor b/createwalletdescriptor
index e980eb0..1eb21b7 100644
--- a/createwalletdescriptor
+++ b/createwalletdescriptor
@@ -1,4 +1,4 @@
-createwalletdescriptor "type" ( {"internal":bool,"hdkey":"str",...} )
+createwalletdescriptor "type" ( {"internal":bool,"hdkey":"str"} )
 
 Creates the wallet's descriptor for the given address type. The address type must be one that the wallet does not already have a descriptor for.
 Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
diff --git a/derivehdkey b/derivehdkey
index c188cac..edcac65 100644
--- a/derivehdkey
+++ b/derivehdkey
@@ -1,4 +1,4 @@
-derivehdkey "path" ( {"private":bool,"hdkey":"str",...} )
+derivehdkey "path" ( {"private":bool,"hdkey":"str"} )
 
 Derive extended public or private key from HD key in the wallet at a given path.
 Derivation uses wallet private key material.
diff --git a/dumptxoutset b/dumptxoutset
index 44c8948..24b6491 100644
--- a/dumptxoutset
+++ b/dumptxoutset
@@ -1,4 +1,4 @@
-dumptxoutset "path" ( "type" {"rollback":n,"in_memory":bool,...} )
+dumptxoutset "path" ( "type" {"rollback":n,"in_memory":bool} )
 
 Write the serialized UTXO set to a file. This can be used in loadtxoutset afterwards if this snapshot height is supported in the chainparams as well.
 This creates a temporary UTXO database when rolling back, keeping the main chain intact. Should the node experience an unclean shutdown the temporary database may need to be removed from the datadir manually.
diff --git a/estimatesmartfee b/estimatesmartfee
index 9d43f19..c39b2d1 100644
--- a/estimatesmartfee
+++ b/estimatesmartfee
@@ -13,17 +13,17 @@ Arguments:
                     economical mode potentially returns a lower fee rate estimate.
                     conservative potentially returns a higher fee rate estimate.
                     
-3. options                             (json object, optional)
-     {
-       "fee_rate_estimator": "str",    (string, optional, default="auto") Selects which fee rate estimator to use.
+3. options          (json object, optional) Options object that can be used to pass named arguments, listed below.
+
+Named Arguments:
+fee_rate_estimator    (string, optional, default="auto") Selects which fee rate estimator to use.
                       "auto" (the default) combines both estimators, returning the lower of the block policy and
                       mempool fee rate estimates. If the mempool fee rate estimator cannot produce an estimate, the
                       block policy fee rate estimate is returned instead. An error is returned only if the block
                       policy fee rate estimate is unavailable.
                       "block_policy" uses only the block policy fee rate estimator.
                       "mempool_policy" uses only the mempool fee rate estimator.
-       "verbosity": n,                 (numeric, optional, default=1) 1 returns feerate or errors. 2 also returns "mempool_health_statistics".
-     }
+verbosity             (numeric, optional, default=1) 1 returns feerate or errors. 2 also returns "mempool_health_statistics".
 
 Result:
 {                                    (json object)
diff --git a/gethdkeys b/gethdkeys
index 46a1a8a..2a35a44 100644
--- a/gethdkeys
+++ b/gethdkeys
@@ -1,4 +1,4 @@
-gethdkeys ( {"active_only":bool,"private":bool,...} )
+gethdkeys ( {"active_only":bool,"private":bool} )
 
 List all BIP 32 HD keys in the wallet and which descriptors use them.
 
diff --git a/gettxspendingprevout b/gettxspendingprevout
index 7f42ee7..721404b 100644
--- a/gettxspendingprevout
+++ b/gettxspendingprevout
@@ -1,4 +1,4 @@
-gettxspendingprevout [{"txid":"hex","vout":n},...] ( {"mempool_only":bool,"return_spending_tx":bool,...} )
+gettxspendingprevout [{"txid":"hex","vout":n},...] ( {"mempool_only":bool,"return_spending_tx":bool} )
 
 Scans the mempool (and the txospenderindex, if available) to find transactions spending any of the given outputs
 
diff --git a/simulaterawtransaction b/simulaterawtransaction
index 5a19296..8bdb56c 100644
--- a/simulaterawtransaction
+++ b/simulaterawtransaction
@@ -1,4 +1,4 @@
-simulaterawtransaction ["rawtx",...] ( {"include_watchonly":bool,...} )
+simulaterawtransaction ["rawtx",...] ( {"include_watchonly":bool} )
 
 Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
 

@maflcko
maflcko force-pushed the 2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS branch from bbbbf03 to fa73731 Compare November 26, 2026 12:24

@l0rinc l0rinc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Concept ACK

I only took a quick look, but more consistent named options for estimatesmartfee make sense to me.

Since my PR depends on the TestNodeCLI parser fix, I’d prefer splitting the fix into its own PR - unless others are more comfortable reviewing it here.

Comment thread test/functional/test_framework/util.py Resolved
Comment thread test/functional/rpc_estimatefee.py Resolved
MarcoFalke added 6 commits November 27, 2026 12:00
This is needed to get the full error message. Otherwise running the test
with --usecli fails with:

AssertionError: Expected substring not found in error message:
substring: 'JSON value of type bool is not of expected type number'
error message: 'Wrong type passed:'.
This checks that OBJ_NAMED_PARAMS are "closed" (reject unkown keys)
Unknown keys are rejected, so the help should indicate that.
@maflcko
maflcko force-pushed the 2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS branch from fa73731 to fa948f5 Compare November 27, 2026 11:08
@maflcko
maflcko force-pushed the 2611-rpc-estimatesmartfee-OBJ_NAMED_PARAMS branch from fa948f5 to fad909a Compare November 27, 2026 11:13
@l0rinc

l0rinc commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

shallow ACK fad909a, reviewed and played with it a bit, someone with more experience in this area should also review it

@maflcko

maflcko commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

someone with more experience in this area

cc @willcl-ark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants