Skip to content

Conversation

@ismaelsadeeq
Copy link
Member

@ismaelsadeeq ismaelsadeeq commented Jul 25, 2024

This PR:

  1. Adds release notes for Fee Estimation: change estimatesmartfee default mode to economical #30275
  2. Describe fee estimation modes in RPC help texts

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 25, 2024

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK glozow, willcl-ark, tdb3, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

Release note looks good to me.

Left a few thoughts on the RPC help strings for consideration.

@ismaelsadeeq ismaelsadeeq force-pushed the 07-2024-estimatesmartfee-doc-update branch 2 times, most recently from eaa4337 to c4671e9 Compare July 25, 2024 17:14
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Debug: https://github.com/bitcoin/bitcoin/runs/27925476433

Hints

Make sure to run all tests locally, according to the documentation.

The failure may happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Approach ACK
Nice follow-up. Left a couple of small comments.
Also manually ran "help " for each change and didn't notice any rendering issues.

@ismaelsadeeq ismaelsadeeq force-pushed the 07-2024-estimatesmartfee-doc-update branch from c4671e9 to f38aaef Compare July 26, 2024 09:22
Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

ACK f38aaefbbfbc3be3751eff61ea3995ce30d303ba

@ismaelsadeeq ismaelsadeeq force-pushed the 07-2024-estimatesmartfee-doc-update branch from f38aaef to 4f5ded6 Compare July 31, 2024 15:11
Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

ACK 4f5ded6905ff7a425aabe53c1a4124f2cb7b5365
Nice cleanup
Re-inspected "help" for each changed RPC and didn't notice any rendering issues. Seems ok to remove Available modes: text.

- Add description that indicates the fee estimation modes behaviour.
- This description will be returned in the RPC's help texts.
@ismaelsadeeq ismaelsadeeq force-pushed the 07-2024-estimatesmartfee-doc-update branch 3 times, most recently from e387642 to fa2f269 Compare August 6, 2024 13:43
Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

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

ACK fa2f269

@DrahtBot DrahtBot requested a review from tdb3 August 6, 2024 13:54
Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

ACK fa2f269

This changes the help text from

2. estimate_mode    (string, optional, default="conservative") The fee estimate mode.
                    Whether to return a more conservative estimate which also satisfies
                    a longer history. A conservative estimate potentially returns a
                    higher feerate and is more likely to be sufficient for the desired
                    target, but is not as responsive to short term drops in the
                    prevailing fee market. Must be one of (case insensitive):
                    "unset"
                    "economical"
                    "conservative"

to

2. estimate_mode    (string, optional, default="economical") The fee estimate mode.
                    unset, economical, conservative
                    unset means no mode set (default mode will be used).
                    economical estimates use a shorter time horizon, making them more
                    responsive to short-term drops in the prevailing fee market. This mode
                    potentially returns a lower fee rate estimate.
                    conservative estimates use a longer time horizon, making them
                    less responsive to short-term drops in the prevailing fee market. This mode
                    potentially returns a higher fee rate estimate.

Not a blocker for me but IMO a patch to fa2f269 could make this slightly clearer by wrapping modes in quotes and helping to break up the large block of text:

Patch
diff --git a/src/common/messages.cpp b/src/common/messages.cpp
index da464106777..3666d4953b3 100644
--- a/src/common/messages.cpp
+++ b/src/common/messages.cpp
@@ -46,9 +46,9 @@ std::string StringForFeeReason(FeeReason reason)
 const std::vector<std::pair<std::string, FeeEstimateMode>>& FeeModeMap()
 {
     static const std::vector<std::pair<std::string, FeeEstimateMode>> FEE_MODES = {
-        {"unset", FeeEstimateMode::UNSET},
-        {"economical", FeeEstimateMode::ECONOMICAL},
-        {"conservative", FeeEstimateMode::CONSERVATIVE},
+        {"'unset'", FeeEstimateMode::UNSET},
+        {"'economical'", FeeEstimateMode::ECONOMICAL},
+        {"'conservative'", FeeEstimateMode::CONSERVATIVE},
     };
     return FEE_MODES;
 }
@@ -83,7 +83,9 @@ std::string FeeModesDetail(std::string default_info)
 
 std::string FeeModes(const std::string& delimiter)
 {
-    return Join(FeeModeMap(), delimiter, [&](const std::pair<std::string, FeeEstimateMode>& i) { return i.first; });
+    std::string modes = "Available modes: ";
+    modes += Join(FeeModeMap(), delimiter, [&](const std::pair<std::string, FeeEstimateMode>& i) { return i.first; });
+    return modes;
 }
 
 std::string InvalidEstimateModeErrorMessage()

which would render as:

2. estimate_mode    (string, optional, default="economical") The fee estimate mode.
                    Available modes: 'unset', 'economical', 'conservative'
                    'unset' means no mode set (default mode will be used).
                    'economical' estimates use a shorter time horizon, making them more
                    responsive to short-term drops in the prevailing fee market. This mode
                    potentially returns a lower fee rate estimate.
                    'conservative' estimates use a longer time horizon, making them
                    less responsive to short-term drops in the prevailing fee market. This mode
                    potentially returns a higher fee rate estimate.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

re ACK fa2f269

for (const auto& fee_mode : FeeModeMap()) {
info += FeeModeInfo(fee_mode, default_info);
}
return strprintf("%s \n%s", FeeModes(", "), info);
Copy link
Contributor

Choose a reason for hiding this comment

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

nitty nit: If this file ends up being changed again, could remove the extra space between the first %s and the newline.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you.
I will address this and @willcl-ark nit if there is need to retouch.

@achow101
Copy link
Member

achow101 commented Aug 7, 2024

ACK fa2f269

@achow101 achow101 merged commit 2987ba6 into bitcoin:master Aug 7, 2024
@ismaelsadeeq ismaelsadeeq deleted the 07-2024-estimatesmartfee-doc-update branch August 7, 2024 07:40
@bitcoin bitcoin locked and limited conversation to collaborators Aug 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants