mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge bitcoin/bitcoin#30525: doc, rpc : #30275
followups
fa2f26960e
[rpc, fees]: add more detail on the fee estimation modes (ismaelsadeeq)6e7e620864
[doc]: add `30275` release notes (ismaelsadeeq) Pull request description: This PR: 1. Adds release notes for #30275 2. Describe fee estimation modes in RPC help texts ACKs for top commit: achow101: ACKfa2f26960e
glozow: ACKfa2f26960e
willcl-ark: ACKfa2f26960e
tdb3: re ACKfa2f26960e
Tree-SHA512: b8ea000b599297b954dc770137c29b47153e68644c58550a73e34b74ecb8b65e78417875481efdfdf6aab0018a9cd1d90d8baa5a015e70aca0975f6e1dc9598c
This commit is contained in:
commit
2987ba6637
5 changed files with 46 additions and 14 deletions
7
doc/release-notes-30275.md
Normal file
7
doc/release-notes-30275.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
RPC
|
||||||
|
---
|
||||||
|
|
||||||
|
- The default mode for the `estimatesmartfee` RPC has been updated from `conservative` to `economical`.
|
||||||
|
which is expected to reduce overestimation for many users, particularly if Replace-by-Fee is an option.
|
||||||
|
For users that require high confidence in their fee estimates at the cost of potentially overestimating,
|
||||||
|
the `conservative` mode remains available.
|
|
@ -53,6 +53,34 @@ const std::vector<std::pair<std::string, FeeEstimateMode>>& FeeModeMap()
|
||||||
return FEE_MODES;
|
return FEE_MODES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string FeeModeInfo(const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
|
||||||
|
{
|
||||||
|
switch (mode.second) {
|
||||||
|
case FeeEstimateMode::UNSET:
|
||||||
|
return strprintf("%s means no mode set (%s). \n", mode.first, default_info);
|
||||||
|
case FeeEstimateMode::ECONOMICAL:
|
||||||
|
return strprintf("%s estimates use a shorter time horizon, making them more\n"
|
||||||
|
"responsive to short-term drops in the prevailing fee market. This mode\n"
|
||||||
|
"potentially returns a lower fee rate estimate.\n", mode.first);
|
||||||
|
case FeeEstimateMode::CONSERVATIVE:
|
||||||
|
return strprintf("%s estimates use a longer time horizon, making them\n"
|
||||||
|
"less responsive to short-term drops in the prevailing fee market. This mode\n"
|
||||||
|
"potentially returns a higher fee rate estimate.\n", mode.first);
|
||||||
|
default:
|
||||||
|
// Other modes apart from the ones handled are fee rate units; they should not be clarified.
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string FeeModesDetail(std::string default_info)
|
||||||
|
{
|
||||||
|
std::string info;
|
||||||
|
for (const auto& fee_mode : FeeModeMap()) {
|
||||||
|
info += FeeModeInfo(fee_mode, default_info);
|
||||||
|
}
|
||||||
|
return strprintf("%s \n%s", FeeModes(", "), info);
|
||||||
|
}
|
||||||
|
|
||||||
std::string FeeModes(const std::string& delimiter)
|
std::string FeeModes(const std::string& delimiter)
|
||||||
{
|
{
|
||||||
return Join(FeeModeMap(), delimiter, [&](const std::pair<std::string, FeeEstimateMode>& i) { return i.first; });
|
return Join(FeeModeMap(), delimiter, [&](const std::pair<std::string, FeeEstimateMode>& i) { return i.first; });
|
||||||
|
|
|
@ -26,6 +26,8 @@ enum class PSBTError;
|
||||||
bool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode);
|
bool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode);
|
||||||
std::string StringForFeeReason(FeeReason reason);
|
std::string StringForFeeReason(FeeReason reason);
|
||||||
std::string FeeModes(const std::string& delimiter);
|
std::string FeeModes(const std::string& delimiter);
|
||||||
|
std::string FeeModeInfo(std::pair<std::string, FeeEstimateMode>& mode);
|
||||||
|
std::string FeeModesDetail(std::string default_info);
|
||||||
std::string InvalidEstimateModeErrorMessage();
|
std::string InvalidEstimateModeErrorMessage();
|
||||||
bilingual_str PSBTErrorString(PSBTError error);
|
bilingual_str PSBTErrorString(PSBTError error);
|
||||||
bilingual_str TransactionErrorString(const node::TransactionError error);
|
bilingual_str TransactionErrorString(const node::TransactionError error);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using common::FeeModeFromString;
|
using common::FeeModeFromString;
|
||||||
using common::FeeModes;
|
using common::FeeModesDetail;
|
||||||
using common::InvalidEstimateModeErrorMessage;
|
using common::InvalidEstimateModeErrorMessage;
|
||||||
using node::NodeContext;
|
using node::NodeContext;
|
||||||
|
|
||||||
|
@ -37,12 +37,7 @@ static RPCHelpMan estimatesmartfee()
|
||||||
{
|
{
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"economical"}, "The fee estimate mode.\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"economical"}, "The fee estimate mode.\n"
|
||||||
"Whether to return a more conservative estimate which also satisfies\n"
|
+ FeeModesDetail(std::string("default mode will be used"))},
|
||||||
"a longer history. A conservative estimate potentially returns a\n"
|
|
||||||
"higher feerate and is more likely to be sufficient for the desired\n"
|
|
||||||
"target, but is not as responsive to short term drops in the\n"
|
|
||||||
"prevailing fee market. Must be one of (case insensitive):\n"
|
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
|
||||||
},
|
},
|
||||||
RPCResult{
|
RPCResult{
|
||||||
RPCResult::Type::OBJ, "", "",
|
RPCResult::Type::OBJ, "", "",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
using common::FeeModeFromString;
|
using common::FeeModeFromString;
|
||||||
using common::FeeModes;
|
using common::FeeModesDetail;
|
||||||
using common::InvalidEstimateModeErrorMessage;
|
using common::InvalidEstimateModeErrorMessage;
|
||||||
using common::StringForFeeReason;
|
using common::StringForFeeReason;
|
||||||
using common::TransactionErrorString;
|
using common::TransactionErrorString;
|
||||||
|
@ -245,7 +245,7 @@ RPCHelpMan sendtoaddress()
|
||||||
{"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Signal that this transaction can be replaced by a transaction (BIP 125)"},
|
{"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Signal that this transaction can be replaced by a transaction (BIP 125)"},
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used"))},
|
||||||
{"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n"
|
{"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Avoid spending from dirty addresses; addresses are considered\n"
|
||||||
"dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses."},
|
"dirty if they have previously been used in a transaction. If true, this also activates avoidpartialspends, grouping outputs by their addresses."},
|
||||||
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
||||||
|
@ -349,7 +349,7 @@ RPCHelpMan sendmany()
|
||||||
{"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Signal that this transaction can be replaced by a transaction (BIP 125)"},
|
{"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Signal that this transaction can be replaced by a transaction (BIP 125)"},
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used"))},
|
||||||
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
||||||
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, return extra information about the transaction."},
|
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, return extra information about the transaction."},
|
||||||
},
|
},
|
||||||
|
@ -463,7 +463,7 @@ static std::vector<RPCArg> FundTxDoc(bool solving_data = true)
|
||||||
std::vector<RPCArg> args = {
|
std::vector<RPCArg> args = {
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks", RPCArgOptions{.also_positional = true}},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks", RPCArgOptions{.also_positional = true}},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\"", RPCArgOptions{.also_positional = true}},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used")), RPCArgOptions{.also_positional = true}},
|
||||||
{
|
{
|
||||||
"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Marks this transaction as BIP125-replaceable.\n"
|
"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Marks this transaction as BIP125-replaceable.\n"
|
||||||
"Allows this transaction to be replaced by a transaction with higher fees"
|
"Allows this transaction to be replaced by a transaction with higher fees"
|
||||||
|
@ -1018,7 +1018,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
|
||||||
"still be replaceable in practice, for example if it has unconfirmed ancestors which\n"
|
"still be replaceable in practice, for example if it has unconfirmed ancestors which\n"
|
||||||
"are replaceable).\n"},
|
"are replaceable).\n"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used"))},
|
||||||
{"outputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The outputs specified as key-value pairs.\n"
|
{"outputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The outputs specified as key-value pairs.\n"
|
||||||
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
|
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
|
||||||
"At least one output of either type must be specified.\n"
|
"At least one output of either type must be specified.\n"
|
||||||
|
@ -1205,7 +1205,7 @@ RPCHelpMan send()
|
||||||
RPCArgOptions{.skip_type_check = true}},
|
RPCArgOptions{.skip_type_check = true}},
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used"))},
|
||||||
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
||||||
{"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "",
|
{"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "",
|
||||||
Cat<std::vector<RPCArg>>(
|
Cat<std::vector<RPCArg>>(
|
||||||
|
@ -1331,7 +1331,7 @@ RPCHelpMan sendall()
|
||||||
},
|
},
|
||||||
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
{"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
|
||||||
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
|
||||||
"\"" + FeeModes("\"\n\"") + "\""},
|
+ FeeModesDetail(std::string("economical mode is used if the transaction is replaceable;\notherwise, conservative mode is used"))},
|
||||||
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
{"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
|
||||||
{
|
{
|
||||||
"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "",
|
"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "",
|
||||||
|
|
Loading…
Add table
Reference in a new issue