rpc: Optionally print feerates in sat/vb #33741

pull polespinasa wants to merge 7 commits into bitcoin:master from polespinasa:2025-10-29-PoC-rpc-satvb changing 12 files +241 −29
  1. polespinasa commented at 12:39 AM on October 30, 2025: member

    Part of #32093

    Returning feerates in BTC/kvB it can be very burdensome and is not good practice, as the most widely adopted units are sat/vB.

    The RPC affectd by this PR are getmempoolinfo, getnetworkinfo, estimatesmartfee and estimaterawfee.

    Because of sub 1sat/vB environment we cannot rely on GetFee() because it internally uses FeeFrac EvaluateFee() function which rounds the values to always return an int. If the feerate < 1 then it will be rounded to 1 or 0.

    For more context or discuss how to migrate also arguments please refer to the open issue #32093.

  2. DrahtBot added the label RPC/REST/ZMQ on Oct 30, 2025
  3. DrahtBot commented at 12:39 AM on October 30, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    Concept ACK jonatack
    Stale ACK willcl-ark, w0xlt, musaHaruna

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. polespinasa renamed this:
    rpc: [PoC] Optionally print feerates in sat/vb
    rpc: Optionally print feerates in sat/vb
    on Oct 30, 2025
  5. polespinasa force-pushed on Oct 30, 2025
  6. w0xlt commented at 12:59 AM on October 30, 2025: contributor

    Concept ACK

  7. in src/rpc/fees.cpp:88 in 1389b97904
      84 | @@ -84,7 +85,11 @@ static RPCHelpMan estimatesmartfee()
      85 |                  CFeeRate min_mempool_feerate{mempool.GetMinFee()};
      86 |                  CFeeRate min_relay_feerate{mempool.m_opts.min_relay_feerate};
      87 |                  feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate});
      88 | -                result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));
      89 | +                if (!request.params[2].isNull() && request.params[2].get_bool()) {
    


    maflcko commented at 7:10 AM on October 30, 2025:

    Please don't encode default values in how the code is written. This makes it impossible to change the default values without rewriting the code logic.

    Also, could use self.(Maybe)Arg<bool> instead?


    polespinasa commented at 8:21 PM on October 30, 2025:

    I think with the rebase it's easier to change defaults without touching code logic.

    What would be the benefits of using self.MaybeArg<bool>? I'm not really familiar with it tbh.


    maflcko commented at 7:46 AM on October 31, 2025:

    What would be the benefits of using self.MaybeArg<bool>? I'm not really familiar with it tbh.

    The function is explained in the docstring above the function. It will read the default value by itself, so it doesn't need to be hardcoded several times.

    I think with the rebase it's easier to change defaults without touching code logic.

    I don't think so. I can still see FeeEstimateMode feerate_units = (!request.params[2].isNull() && request.params[2].get_bool()) ? FeeEstimateMode::SAT_VB : FeeEstimateMode::BTC_KVB;


    polespinasa commented at 6:51 PM on October 31, 2025:

    Thanks for the suggestion, yep it is cleaner. Now should be as easy as changing the default in the arg definition.

    btw: I used self.Arg<bool>, I think it makes more sense, self.MaybeArg<bool> is defined for optional params with no defaults.

  8. in src/rpc/fees.cpp:89 in 1389b97904
      84 | @@ -84,7 +85,11 @@ static RPCHelpMan estimatesmartfee()
      85 |                  CFeeRate min_mempool_feerate{mempool.GetMinFee()};
      86 |                  CFeeRate min_relay_feerate{mempool.m_opts.min_relay_feerate};
      87 |                  feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate});
      88 | -                result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));
      89 | +                if (!request.params[2].isNull() && request.params[2].get_bool()) {
      90 | +                    result.pushKV("feerate", static_cast<double>(feeRate.GetFeePerK()) / 1000.0);
    


    maflcko commented at 7:29 AM on October 30, 2025:

    this is wrong, you can't use double to denote monetary amounts. double is a floating point type, which can not represent decimal values accurately.

    For example, if GetFeePerK() returns CAmount{665714}, the Univalue will be 665.7140000000001, which is confusing at best, but also wrong.


    polespinasa commented at 8:19 PM on October 30, 2025:

    You are right, although I think it would not be a problem because we don't print that many decimals.

    Anyway, I think the approach in afeeac1596da47b0e431d468a665d344b39e1a87 is cleaner and follows what we already do for btc/kvB. What do you think?


    maflcko commented at 7:47 AM on October 31, 2025:

    You are right, although I think it would not be a problem because we don't print that many decimals.

    They are printed. You can try it locally by printing the constructed univalue or by checking it in a test.

    Anyway, I think the approach in afeeac1 is cleaner and follows what we already do for btc/kvB. What do you think?

    I don't think it handles negative feerates correctly. Generally, it is best to write unit or fuzz tests for newly written code. Also, I am not sure if CFeeRate should be bundled with univalue. The conversion could be a standalone helper, but this is just a nit.


    polespinasa commented at 10:00 PM on October 31, 2025:

    Generally, it is best to write unit or fuzz tests for newly written code

    Done

    Also, I am not sure if CFeeRate should be bundled with univalue. The conversion could be a standalone helper, but this is just a nit.

    I decided to make it a function of CFeeRate because is the only class that should use it. But I'm ok moving it to core_writte.

  9. maflcko commented at 7:32 AM on October 30, 2025: member

    I guess it is a bit verbose to have each RPC annotated with a type optional arg, but there probably isn't an easier solution.

    There could be a global option to toggle the default, to improve the UX.

    Though, please don't use floating point types. For monetary values, a fixed point type should be used.

  10. polespinasa force-pushed on Oct 30, 2025
  11. polespinasa commented at 8:29 PM on October 30, 2025: member

    @maflcko thanks for reviewing :)

    I guess it is a bit verbose to have each RPC annotated with a type optional arg, but there probably isn't an easier solution.

    I don't think there is either, at least not in a backwards compatible way.

    There could be a global option to toggle the default, to improve the UX.

    That would be great for a bitcoin-cli user, but probably fatal for other programs that rely on the Bitcoin Core RPC. E.g. if a user with a Lightning Node enables sat/vB, thus making estimatesmartfee return sat/vb by default, probably the LN node will force close the channels due to lack of fees to pay.

  12. polespinasa force-pushed on Oct 31, 2025
  13. polespinasa force-pushed on Oct 31, 2025
  14. polespinasa force-pushed on Oct 31, 2025
  15. in src/policy/feerate.h:11 in c34f6a3514
       7 | @@ -8,6 +8,7 @@
       8 |  
       9 |  #include <consensus/amount.h>
      10 |  #include <serialize.h>
      11 | +#include <univalue/include/univalue.h>
    


    w0xlt commented at 1:34 AM on November 6, 2025:

    This drags an RPC‑only dependency (UniValue) into a widely included policy header. Instead, a helper in rpc/util.{h,cpp} (or rpc/fees.h) could be added such as:

    enum class FeeRateUnit { BTC_KVB, SAT_VB };
    UniValue ValueFromFeeRate(const CFeeRate& fr, FeeRateUnit unit);
    

    polespinasa commented at 11:28 PM on November 10, 2025:

    Yes maybe it's a better approach. Moved the function into core_write.cpp and core_io.h similar to function ValueFromAmount.

  16. in src/test/amount_tests.cpp:183 in c34f6a3514
     178 | +    BOOST_CHECK_EQUAL(CFeeRate(1, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "1.000");
     179 | +    BOOST_CHECK_EQUAL(CFeeRate(10, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "10.000");
     180 | +    BOOST_CHECK_EQUAL(CFeeRate(1000, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "1000.000");
     181 | +    BOOST_CHECK_EQUAL(CFeeRate(1, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "1.000");
     182 | +    BOOST_CHECK_EQUAL(CFeeRate(10, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "10.000");
     183 | +    BOOST_CHECK_EQUAL(CFeeRate(1000, 1).ToUniValue(FeeEstimateMode::SAT_VB).write(), "1000.000");
    


    w0xlt commented at 1:38 AM on November 6, 2025:

    Do the last six lines duplicate three assertions ? You probably intended to add negative sat/vB cases.


    polespinasa commented at 11:27 PM on November 10, 2025:

    yup, good catch tanks! :)

  17. in src/rpc/net.cpp:718 in c34f6a3514
     714 | @@ -712,9 +715,9 @@ static RPCHelpMan getnetworkinfo()
     715 |      }
     716 |      obj.pushKV("networks",      GetNetworksInfo());
     717 |      if (node.mempool) {
     718 | -        // Those fields can be deprecated, to be replaced by the getmempoolinfo fields
     719 | -        obj.pushKV("relayfee", ValueFromAmount(node.mempool->m_opts.min_relay_feerate.GetFeePerK()));
     720 | -        obj.pushKV("incrementalfee", ValueFromAmount(node.mempool->m_opts.incremental_relay_feerate.GetFeePerK()));
     721 | +        UniValue mempool_info = MempoolInfoToJSON(*node.mempool, self.Arg<bool>("satvB"));
    


    w0xlt commented at 1:43 AM on November 6, 2025:

    This line constructs a full object (with locking) only to reuse two values. It also adds a new include <rpc/mempool.h> into rpc/net.cpp, creating an RPC‑RPC dependency. It may be better to compute these two fields directly.


    polespinasa commented at 11:22 PM on November 10, 2025:

    True! I thought that there was the intention to add all values and not only relayfee and incrementalfee here as the comment // Those fields can be deprecated, to be replaced by the getmempoolinfo fields seems suggest.

    But seeing https://github.com/bitcoin/bitcoin/pull/25648/files#r935563077 I think I just misunderstood and the intention was to maybe remove them in the future and just use getmempool rpc to know that info.

  18. polespinasa force-pushed on Nov 11, 2025
  19. polespinasa commented at 12:25 AM on November 11, 2025: member

    Rebased following @w0xlt suggestions :)

  20. polespinasa force-pushed on Nov 11, 2025
  21. glozow commented at 2:27 PM on November 11, 2025: contributor

    Returning feerates in BTC/kvB it can be very burdensome and is not good practice, as the most widely adopted units are sat/vB.

    Can you explain why it's not good practice? I agree it's not as human-readable but I don't software minds either way. Not to be snarky, but I think the most widely adopted usage of this RPC interface must be to handle what it returns, including converting it before printing to users.

    This PR aims to show a PoC of how we could migrate to sat/vb in a backwards compatible manner.

    It seems extremely dangerous to ever change the default... no matter how much notice is given, it's a massive api break that would cause software to suddenly be several orders of magnitude off.

    A different approach could be to add another field to each result, like "feerate_satvb". A global config option like `-feeraterepresentation" could determine which results are returned so that RPC results aren't bloated. I'm not familiar with how we might pass a global config option to the RPCs though.

  22. polespinasa commented at 6:46 PM on November 11, 2025: member

    @glozow thanks for your comments :)

    Can you explain why it's not good practice?

    We open the door to other software/users to make easy mistakes by forcing them to do a unit conversion that Core shouldn't have done in the first place. I understand that this has been like this since ¿always?, but giving users the option to have sat/vB (or even more units thanks to FeeFrac) can be useful and reduce the burden on other software.

    It seems extremely dangerous to ever change the default... no matter how much notice is given, it's a massive api break that would cause software to suddenly be several orders of magnitude off.

    I agree, this PR doesn't change any default behavior. It MUST be done in a backwards compatible way.

    A different approach could be to add another field to each result, like "feerate_satvb".

    Yes! This is another approach already taken by fundrawtransaction for example (context).

    A global config option like `-feeraterepresentation" could determine which results are returned so that RPC results aren't bloated. I'm not familiar with how we might pass a global config option to the RPCs though.

    I don't dislike at all this approach and I would probably be open to switching to it if there's consensus that it is better. But I am afraid that with that approach users can easily make huge mistakes. They could start their node with -feeraterepresentation=satvB and then use some software on top that expects BTC/kvB. That could be fatal. Because of that, I decided to follow the bool option in each RPC call. See #33741 (comment)

  23. glozow commented at 7:14 PM on November 11, 2025: contributor

    forcing them to do a unit conversion that Core shouldn't have done in the first place.

    I still don't see the argument for why a unit per kvB is so problematic. BTC and satoshis are easily convertible.

    I do think it's worthwhile to unify the format for inputting and and outputting feerates. And I agree it should be configurable, given there are multiple preferred formats.

    My concern is the idea that the default format might be changed in the future, causing somebody's reading of a feerate to be off by a factor of 100,000. I think the acceptable way to do this is to create new fields and maybe phase out the old ones.

    They could start their node with -feeraterepresentation=satvB and then use some software on top that expects BTC/kvB. That could be fatal.

    That's why the results must have different names. If they forget the config option, they should get a key error.

  24. w0xlt commented at 10:09 PM on November 12, 2025: contributor

    Adding a new field in the result called feerate_unit (string) to specify the unit used (sat/vB or BTC/kvB) may address this issue. The current approach looks good to me, though.

  25. polespinasa commented at 1:52 AM on November 13, 2025: member

    I do think it's worthwhile to unify the format for inputting and and outputting feerates. And I agree it should be configurable, given there are multiple preferred formats.

    Yes the idea is to be able to use sat/vB or BTC/kvB in inputting and outputting. This PR is just a PoC on how we could do it for outputting.

    My concern is the idea that the default format might be changed in the future

    I don't think the default will ever be changed. I left the door open to it in some comments, but I would not push for it tbh.

    That's why the results must have different names. If they forget the config option, they should get a key error.

    Oh sorry I didn't understand your idea. So you propose to add a startup option to choose the feerate units and then on the outputs change the key so it will return a key error if someone is expecting a different unit? I think that's a good approach, how would you do it for rpc arguments though? Unless you force to use named arguments I think it can still lead to errors.

  26. DrahtBot added the label Needs rebase on Dec 27, 2025
  27. maflcko commented at 6:05 AM on March 30, 2026: member

    @polespinasa What is the status here?

  28. polespinasa commented at 12:35 PM on March 30, 2026: member

    @maflcko will rebase soon.

    Still would like to know more opinions on the approach to take

  29. sedited commented at 10:43 AM on May 14, 2026: contributor

    Still would like to know more opinions on the approach to take

    Reviewers are far less likely to look at PRs that have conflicts, so I would suggest rebasing.

  30. polespinasa force-pushed on May 18, 2026
  31. polespinasa force-pushed on May 18, 2026
  32. polespinasa commented at 5:22 PM on May 18, 2026: member

    rebased on top of master

  33. DrahtBot added the label CI failed on May 18, 2026
  34. DrahtBot commented at 5:23 PM on May 18, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/26048892043/job/76580207525</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU detected incorrect/missing #includes (it auto-edited files and then forced a failure: “Failure generated from IWYU”).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still 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.

    </details>

  35. DrahtBot removed the label Needs rebase on May 18, 2026
  36. polespinasa force-pushed on May 18, 2026
  37. DrahtBot removed the label CI failed on May 18, 2026
  38. w0xlt commented at 11:20 PM on May 26, 2026: contributor

    estimaterawfee is converting only the top-level feerate when satvB=true, while pass/fail.startrange and endrange remained in the sat/kvB units.

    The below patch applies the same unit selection to those bucket range feerates, avoiding mixed-unit RPC responses.

    <details> <summary>diff</summary>

    diff --git a/src/rpc/fees.cpp b/src/rpc/fees.cpp
    index 140ba9d64f..854f4f203f 100644
    --- a/src/rpc/fees.cpp
    +++ b/src/rpc/fees.cpp
    @@ -4,6 +4,7 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     #include <common/messages.h>
    +#include <consensus/amount.h>
     #include <core_io.h>
     #include <node/context.h>
     #include <policy/feerate.h>
    @@ -21,6 +22,7 @@
     #include <algorithm>
     #include <array>
     #include <cmath>
    +#include <limits>
     #include <string>
     #include <string_view>
     
    @@ -29,6 +31,19 @@ using common::FeeModesDetail;
     using common::InvalidEstimateModeErrorMessage;
     using node::NodeContext;
     
    +static UniValue ValueFromEstimateBucketFeeRate(double fee_rate_per_kvb, bool sat_vb)
    +{
    +    const double rounded_fee_rate_per_kvb{round(fee_rate_per_kvb)};
    +
    +    // Preserve estimaterawfee's legacy bucket range unit unless sat/vB was requested.
    +    if (!sat_vb || rounded_fee_rate_per_kvb < 0) return rounded_fee_rate_per_kvb;
    +
    +    if (rounded_fee_rate_per_kvb > static_cast<double>(std::numeric_limits<CAmount>::max())) {
    +        return rounded_fee_rate_per_kvb / 1000.0;
    +    }
    +    return ValueFromFeeRate(CFeeRate{static_cast<CAmount>(rounded_fee_rate_per_kvb)}, FeeRateUnit::SAT_VB);
    +}
    +
     static RPCMethod estimatesmartfee()
     {
         return RPCMethod{
    @@ -168,6 +183,8 @@ static RPCMethod estimaterawfee()
                 }
     
                 UniValue result(UniValue::VOBJ);
    +            const bool sat_vb{self.Arg<bool>("satvB")};
    +            const FeeRateUnit feerate_units{sat_vb ? FeeRateUnit::SAT_VB : FeeRateUnit::BTC_KVB};
     
                 for (const FeeEstimateHorizon horizon : ALL_FEE_ESTIMATE_HORIZONS) {
                     CFeeRate feeRate;
    @@ -180,15 +197,15 @@ static RPCMethod estimaterawfee()
                     UniValue horizon_result(UniValue::VOBJ);
                     UniValue errors(UniValue::VARR);
                     UniValue passbucket(UniValue::VOBJ);
    -                passbucket.pushKV("startrange", round(buckets.pass.start));
    -                passbucket.pushKV("endrange", round(buckets.pass.end));
    +                passbucket.pushKV("startrange", ValueFromEstimateBucketFeeRate(buckets.pass.start, sat_vb));
    +                passbucket.pushKV("endrange", ValueFromEstimateBucketFeeRate(buckets.pass.end, sat_vb));
                     passbucket.pushKV("withintarget", round(buckets.pass.withinTarget * 100.0) / 100.0);
                     passbucket.pushKV("totalconfirmed", round(buckets.pass.totalConfirmed * 100.0) / 100.0);
                     passbucket.pushKV("inmempool", round(buckets.pass.inMempool * 100.0) / 100.0);
                     passbucket.pushKV("leftmempool", round(buckets.pass.leftMempool * 100.0) / 100.0);
                     UniValue failbucket(UniValue::VOBJ);
    -                failbucket.pushKV("startrange", round(buckets.fail.start));
    -                failbucket.pushKV("endrange", round(buckets.fail.end));
    +                failbucket.pushKV("startrange", ValueFromEstimateBucketFeeRate(buckets.fail.start, sat_vb));
    +                failbucket.pushKV("endrange", ValueFromEstimateBucketFeeRate(buckets.fail.end, sat_vb));
                     failbucket.pushKV("withintarget", round(buckets.fail.withinTarget * 100.0) / 100.0);
                     failbucket.pushKV("totalconfirmed", round(buckets.fail.totalConfirmed * 100.0) / 100.0);
                     failbucket.pushKV("inmempool", round(buckets.fail.inMempool * 100.0) / 100.0);
    @@ -196,7 +213,7 @@ static RPCMethod estimaterawfee()
     
                     // CFeeRate(0) is used to indicate error as a return value from estimateRawFee
                     if (feeRate != CFeeRate(0)) {
    -                    horizon_result.pushKV("feerate", ValueFromFeeRate(feeRate, self.Arg<bool>("satvB") ? FeeRateUnit::SAT_VB : FeeRateUnit::BTC_KVB ));
    +                    horizon_result.pushKV("feerate", ValueFromFeeRate(feeRate, feerate_units));
                         horizon_result.pushKV("decay", buckets.decay);
                         horizon_result.pushKV("scale", buckets.scale);
                         horizon_result.pushKV("pass", std::move(passbucket));
    

    </details>

  39. DrahtBot added the label Needs rebase on May 29, 2026
  40. polespinasa force-pushed on May 31, 2026
  41. polespinasa commented at 4:32 PM on May 31, 2026: member

    @w0xlt good catch. I picked it with a slightly different approach. Added you as a co-author.

  42. polespinasa force-pushed on May 31, 2026
  43. DrahtBot added the label CI failed on May 31, 2026
  44. DrahtBot removed the label Needs rebase on May 31, 2026
  45. DrahtBot removed the label CI failed on May 31, 2026
  46. w0xlt commented at 9:15 PM on June 3, 2026: contributor

    ACK 26316c53ef65c1289227b1c2b9dcc2d7ad802aec

    nit: RPC help texts can be update

    <details> <summary>diff</summary>

    diff --git a/src/rpc/fees.cpp b/src/rpc/fees.cpp
    index a1bef9615f..e429c4e473 100644
    --- a/src/rpc/fees.cpp
    +++ b/src/rpc/fees.cpp
    @@ -47,7 +47,7 @@ static RPCMethod estimatesmartfee()
             RPCResult{
                 RPCResult::Type::OBJ, "", "",
                 {
    -                {RPCResult::Type::NUM, "feerate", /*optional=*/true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB (only present if no errors were encountered)"},
    +                {RPCResult::Type::NUM, "feerate", /*optional=*/true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true (only present if no errors were encountered)"},
                     {RPCResult::Type::ARR, "errors", /*optional=*/true, "Errors encountered during processing (if there are any)",
                         {
                             {RPCResult::Type::STR, "", "error"},
    diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp
    index ed5d8fb662..e6428518eb 100644
    --- a/src/rpc/mempool.cpp
    +++ b/src/rpc/mempool.cpp
    @@ -1089,9 +1089,9 @@ static RPCMethod getmempoolinfo()
                         {RPCResult::Type::NUM, "usage", "Total memory usage for the mempool"},
                         {RPCResult::Type::STR_AMOUNT, "total_fee", "Total fees for the mempool in " + CURRENCY_UNIT + ", ignoring modified fees through prioritisetransaction"},
                         {RPCResult::Type::NUM, "maxmempool", "Maximum memory usage for the mempool"},
    -                    {RPCResult::Type::STR_AMOUNT, "mempoolminfee", "Minimum fee rate in " + CURRENCY_UNIT + "/kvB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee"},
    -                    {RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions"},
    -                    {RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"},
    +                    {RPCResult::Type::STR_AMOUNT, "mempoolminfee", "Minimum fee rate in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true, for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee"},
    +                    {RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true"},
    +                    {RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true"},
                         {RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"},
                         {RPCResult::Type::BOOL, "permitbaremultisig", "True if the mempool accepts transactions with bare multisig outputs"},
                         {RPCResult::Type::NUM, "maxdatacarriersize", "Maximum number of bytes that can be used by OP_RETURN outputs in the mempool"},
    diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
    index 742287a12b..ab49a386e7 100644
    --- a/src/rpc/net.cpp
    +++ b/src/rpc/net.cpp
    @@ -670,8 +670,8 @@ static RPCMethod getnetworkinfo()
                                     {RPCResult::Type::BOOL, "proxy_randomize_credentials", "Whether randomized credentials are used"},
                                 }},
                             }},
    -                        {RPCResult::Type::NUM, "relayfee", "minimum relay fee rate for transactions in " + CURRENCY_UNIT + "/kvB"},
    -                        {RPCResult::Type::NUM, "incrementalfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"},
    +                        {RPCResult::Type::NUM, "relayfee", "minimum relay fee rate for transactions in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true"},
    +                        {RPCResult::Type::NUM, "incrementalfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB, or " + CURRENCY_ATOM + "/vB if satvB is true"},
                             {RPCResult::Type::ARR, "localaddresses", "list of local addresses",
                             {
                                 {RPCResult::Type::OBJ, "", "",
    

    </details>

  47. polespinasa force-pushed on Jun 4, 2026
  48. DrahtBot added the label Needs rebase on Jun 20, 2026
  49. polespinasa force-pushed on Jun 20, 2026
  50. polespinasa commented at 6:32 AM on June 20, 2026: member

    Rebased on top of master

  51. DrahtBot removed the label Needs rebase on Jun 20, 2026
  52. musaHaruna commented at 8:45 PM on July 7, 2026: contributor

    Concept ACK on migrating to sat/vb in a backwards compatible manner.

    Code Review 740b6e8

    I noticed that this section handles negative values by mutating the signed variables after division:

        int64_t quotient  = feerate_per_kvb / units;
        int64_t remainder = feerate_per_kvb % units;
    
        if (feerate_per_kvb < 0) {
            quotient = -quotient;
            remainder = -remainder;
        }
    

    Would it make sense, or is there a reason not to simplify this by stripping the negative sign right at the start using static_cast<uint64_t>? i.e:

    const uint64_t abs_feerate = (feerate_per_kvb < 0) ? -static_cast<uint64_t (feerate_per_kvb) : feerate_per_kvb;
        const uint64_t quotient = abs_feerate / units;
        const uint64_t remainder = abs_feerate % units;
    

    Handling the magnitude on pure unsigned types feels like it would eliminate the need for the conditional if block, making the function completely linear.

    I might be likely missing some subtleties that I'm not aware of though.

  53. in src/core_io.cpp:301 in 513555558e
     293 | @@ -293,6 +294,31 @@ UniValue ValueFromAmount(const CAmount amount)
     294 |              strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder));
     295 |  }
     296 |  
     297 | +UniValue ValueFromFeeRate(const CFeeRate& fee_rate, FeeRateUnit fee_rate_unit)
     298 | +{
     299 | +    const CAmount feerate_per_kvb = fee_rate.GetFeePerK();
     300 | +    const bool is_sat_vb = (fee_rate_unit == FeeRateUnit::SAT_VB);
     301 | +    const int64_t units  = is_sat_vb ? 1000 : COIN;
    


    musaHaruna commented at 8:49 PM on July 7, 2026:

    Nit: Extra whitespaces can be removed

        const int64_t units = is_sat_vb ? 1000 : COIN;
        const int8_t decimals = is_sat_vb ? 3 : 8;
    

    polespinasa commented at 11:04 AM on July 28, 2026:

    done

  54. in src/core_io.cpp:320 in 513555558e outdated
     315 | +                  feerate_per_kvb < 0 ? "-" : "",
     316 | +                  quotient,
     317 | +                  decimals,
     318 | +                  remainder)
     319 | +    );
     320 | +}
    


    musaHaruna commented at 8:52 PM on July 7, 2026:

    I think this can be returned on a single line?

    return UniValue(UniValue::VNUM, strprintf("%s%d.%0*d", feerate_per_kvb < 0 ? "-" : "", quotient, decimals, remainder));
    

    polespinasa commented at 11:05 AM on July 28, 2026:

    I like it as is, imho it's more readable.

  55. polespinasa commented at 11:02 AM on July 28, 2026: member

    Handling the magnitude on pure unsigned types feels like it would eliminate the need for the conditional if block, making the function completely linear.

    I rather keep as is for now, unless someone finds a better reason for it. I think is more readable and you are not really eliminating the conditional block, just writing it in a different way ((feerate_per_kvb < 0) ? .... : ....).

  56. polespinasa force-pushed on Jul 28, 2026
  57. DrahtBot added the label Needs rebase on Aug 21, 2026
  58. polespinasa force-pushed on Aug 21, 2026
  59. polespinasa force-pushed on Aug 21, 2026
  60. DrahtBot added the label CI failed on Aug 21, 2026
  61. DrahtBot removed the label CI failed on Aug 21, 2026
  62. DrahtBot removed the label Needs rebase on Aug 21, 2026
  63. in src/rpc/client.cpp:314 in a1f60713fd
     310 | -    { "estimatesmartfee", 2, "options" },
     311 | +    { "estimatesmartfee", 2, "satvB"},
     312 | +    { "estimatesmartfee", 3, "options" },
     313 |      { "estimaterawfee", 0, "conf_target" },
     314 |      { "estimaterawfee", 1, "threshold" },
     315 | +    { "estimaterawfee", 2, "satvB"},
    


    jonatack commented at 7:52 PM on August 21, 2026:

    Would it be better to use sat_vb or satvb for these? (Sorry if this has already been discussed above.) Per the developer notes:

    Argument and field naming: please consider whether there is already a naming
      style or spelling convention in the API for the type of object in question
      (`blockhash`, for example), and if so, try to use that. If not, use snake case
      `fee_delta` (and not, e.g. `feedelta` or camel case `feeDelta`).
    

    polespinasa commented at 8:26 AM on August 22, 2026:

    Fair enough, changed to sat_vb

  64. jonatack commented at 7:52 PM on August 21, 2026: member

    Concept ACK

  65. polespinasa force-pushed on Aug 22, 2026
  66. DrahtBot added the label Needs rebase on Sep 9, 2026
  67. polespinasa force-pushed on Sep 10, 2026
  68. DrahtBot added the label CI failed on Sep 10, 2026
  69. DrahtBot commented at 8:55 AM on September 10, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/34452108257/job/102789962906</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU detected required include/headers fixes (it modified src/rpc/fees.cpp, minisketch.h) and forced a failure.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still 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.

    </details>

  70. polespinasa force-pushed on Sep 10, 2026
  71. polespinasa force-pushed on Sep 10, 2026
  72. DrahtBot removed the label Needs rebase on Sep 10, 2026
  73. polespinasa force-pushed on Sep 10, 2026
  74. DrahtBot removed the label CI failed on Sep 10, 2026
  75. DrahtBot added the label Needs rebase on Sep 29, 2026
  76. polespinasa force-pushed on Oct 7, 2026
  77. DrahtBot removed the label Needs rebase on Oct 7, 2026
  78. w0xlt commented at 3:31 PM on October 7, 2026: contributor

    reACK 03f57602de4ff8a9b38f1cd38eb467b208a6b104

  79. DrahtBot requested review from jonatack on Oct 7, 2026
  80. DrahtBot requested review from musaHaruna on Oct 7, 2026
  81. willcl-ark commented at 4:05 PM on October 7, 2026: member

    I have not reviewed this pull in detail, but the ralph review comments seem worth consideration.

    In particular changing positional RPC arguments porbably warrants a release note (if we do have to break that ordering).

    I think the description needs updating too, if this is no longer a PoC.

  82. maflcko commented at 3:47 PM on October 23, 2026: member

    In particular changing positional RPC arguments porbably warrants a release note (if we do have to break that ordering).

    Should use RPCArg::Type::OBJ_NAMED_PARAMS?

  83. polespinasa force-pushed on Oct 26, 2026
  84. polespinasa commented at 5:16 PM on October 26, 2026: member

    In particular changing positional RPC arguments porbably warrants a release note (if we do have to break that ordering).

    Yeah, right, I should fix that. Will see if setting it inside the options object is an option. Fixed the minor issue in the last fpush.

  85. DrahtBot added the label CI failed on Oct 26, 2026
  86. polespinasa force-pushed on Nov 2, 2026
  87. polespinasa commented at 5:02 PM on November 2, 2026: member

    Added the new sat_vb argument inside an options argument for all rpc calls. Also changed the options argument in estimatesmartfee to OBJ_NAMED_PARAMS. Also added a release note.

  88. polespinasa referenced this in commit ca1ba0fc2f on Nov 2, 2026
  89. DrahtBot removed the label CI failed on Nov 2, 2026
  90. in doc/release-notes-33741.md:4 in ca1ba0fc2f
       0 | @@ -0,0 +1,5 @@
       1 | +JSON-RPC
       2 | +--------
       3 | +
       4 | +The `getmempoolinfo`, `getnetworkinfo`, `getwalletinfo`, `estimatesmartfee` and `estimaterawfee` now take a new options argument `sat_vb`.
    


    willcl-ark commented at 11:45 AM on November 4, 2026:

    In ca1ba0fc2f892c1c6045389edb93785493539465

    Does getwalletinfo actually use sat/vb anywhere?


    polespinasa commented at 3:32 PM on November 4, 2026:

    good catch, tbh idk how that ended up in here 😅

  91. in src/core_io.h:43 in af05ed05f4
      38 | + */
      39 | +enum class FeeRateUnit{
      40 | +    BTC_KVB,
      41 | +    SAT_VB
      42 | +};
      43 | +
    


    willcl-ark commented at 12:01 PM on November 4, 2026:

    In af05ed05f46759e1809441a73f2d6ec3ffe3fed5

    src/feerate.h already has the same enum, which could perhaps be reused.


    polespinasa commented at 3:46 PM on November 4, 2026:

    done

  92. willcl-ark approved
  93. willcl-ark commented at 12:02 PM on November 4, 2026: member

    ACK ca1ba0fc2f892c1c6045389edb93785493539465

    This seems useful, and correct (and a long time coming!)

    The getwalletinfo nit, if correct, should apply to the PR descriptinon too.

  94. DrahtBot requested review from w0xlt on Nov 4, 2026
  95. polespinasa referenced this in commit ece6a3448e on Nov 4, 2026
  96. polespinasa force-pushed on Nov 4, 2026
  97. polespinasa referenced this in commit 1ac3023d3c on Nov 4, 2026
  98. polespinasa force-pushed on Nov 4, 2026
  99. musaHaruna commented at 8:57 AM on November 6, 2026: contributor

    ACK 1ac3023

    The sat_vb option works as expected while preserving existing RPC defaults.

    I also left a few nonblocking inline nits concerning formatting, style, and documentation.

    Two additional commit-message nits, if you update the branch again:

    1. 97a4641eb4 mentions core_write, but the function is added to src/core_io.cpp. The title could be:

      rpc: add ValueFromFeeRate to core_io
      
    2. 8da084437e says it adds a previously missing mempool.h include, but that include already exists in its parent. The commit adds <policy/feerate.h> to rpc/mempool.h instead. The title/body could be:

      rpc: allow MempoolInfoToJSON to return feerates in sat/vB
      
      Add a fee-rate format parameter, defaulting to BTC/kvB to preserve
      existing callers.
      
  100. DrahtBot requested review from willcl-ark on Nov 6, 2026
  101. in src/rpc/fees.cpp:286 in 1ac3023d3c
     286 |                  failbucket.pushKV("leftmempool", round(buckets.fail.leftMempool * 100.0) / 100.0);
     287 |  
     288 |                  // CFeeRate(0) is used to indicate error as a return value from estimateRawFee
     289 |                  if (feeRate != CFeeRate(0)) {
     290 | -                    horizon_result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));
     291 | +                    horizon_result.pushKV("feerate", ValueFromFeeRate(feeRate, sat_vb ? FeeRateFormat::SAT_VB : FeeRateFormat::BTC_KVB ));
    


    musaHaruna commented at 8:58 AM on November 6, 2026:

    Nit: The extra space before closing parentheses can be removed

                        horizon_result.pushKV("feerate", ValueFromFeeRate(feeRate, sat_vb ? FeeRateFormat::SAT_VB : FeeRateFormat::BTC_KVB));
    
  102. in src/rpc/mempool.cpp:1180 in 1ac3023d3c
    1173 | @@ -1167,7 +1174,11 @@ static RPCMethod getmempoolinfo()
    1174 |          },
    1175 |          [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue
    1176 |  {
    1177 | -    return MempoolInfoToJSON(EnsureAnyMemPool(request.context));
    1178 | +    const UniValue options{request.params[0].isNull() ? UniValue::VOBJ : request.params[0]};
    1179 | +    RPCTypeCheckObj(options, {{"sat_vb", UniValueType(UniValue::VBOOL)}}, /*fAllowNull=*/true, /*fStrict=*/true);
    1180 | +    const bool sat_vb{options["sat_vb"].isNull() ? DEFAULT_SAT_VB : options["sat_vb"].get_bool()};
    1181 | +    FeeRateFormat feerate_units = sat_vb ? FeeRateFormat::SAT_VB : FeeRateFormat::BTC_KVB;
    


    musaHaruna commented at 8:58 AM on November 6, 2026:

    Nit: feerate_units could be const here and in getnetworkinfo and maybe switch to brace initialization to be consistent with the nearby declarations.

     const FeeRateFormat feerate_units{sat_vb ? FeeRateFormat::SAT_VB : FeeRateFormat::BTC_KVB};
    
  103. in src/rpc/fees.cpp:252 in 1ac3023d3c outdated
     247 | +            const bool sat_vb{options["sat_vb"].isNull() ? DEFAULT_SAT_VB : options["sat_vb"].get_bool()};
     248 |  
     249 | +            auto ValueFromEstimateBucketFeeRate = [&sat_vb](const double fee_rate_per_kvb) -> UniValue {
     250 | +                const double rounded_fee_rate_per_kvb{round(fee_rate_per_kvb)};
     251 | +
     252 | +                if (!sat_vb || rounded_fee_rate_per_kvb == -1) return rounded_fee_rate_per_kvb;
    


    musaHaruna commented at 9:01 AM on November 6, 2026:

    Nit: Here I don't think the reason for preserving -1 is immediately apparent, A useful comment would explain the meaning:

    // Preserve -1, which marks an unavailable bucket boundary.
                    if (!sat_vb || rounded_fee_rate_per_kvb == -1) return rounded_fee_rate_per_kvb;
    
  104. polespinasa referenced this in commit 72378c7a49 on Nov 6, 2026
  105. polespinasa force-pushed on Nov 6, 2026
  106. polespinasa commented at 11:57 AM on November 6, 2026: member

    pushed to address the nits, mostly left-overs after rebasing again and again :'(

  107. in doc/release-notes-33741.md:5 in 72378c7a49
       0 | @@ -0,0 +1,5 @@
       1 | +JSON-RPC
       2 | +--------
       3 | +
       4 | +The `getmempoolinfo`, `getnetworkinfo`, `estimatesmartfee` and `estimaterawfee` now take a new options argument `sat_vb`.
       5 | +If enabled feerates on the RPC result will be represented in `sat/vB` instead of `BTC/kvB`.
    


    fanquake commented at 11:59 AM on November 6, 2026:

    nit

    If enabled feerates on the RPC result will be represented in `sat/vB` instead of `BTC/kvB`. (#33741)
    

    polespinasa commented at 12:02 PM on November 6, 2026:

    Taken, should I add the PR num at the end of the text always? I'm afraid I've been writing release notes the wrong way... 😅


    fanquake commented at 12:03 PM on November 6, 2026:

    Maybe not, this is changing, see #36769 & #36773.

  108. polespinasa referenced this in commit b17e252987 on Nov 6, 2026
  109. polespinasa force-pushed on Nov 6, 2026
  110. DrahtBot added the label CI failed on Nov 6, 2026
  111. polespinasa referenced this in commit 1e31cf6982 on Nov 6, 2026
  112. polespinasa force-pushed on Nov 6, 2026
  113. willcl-ark approved
  114. willcl-ark commented at 1:40 PM on November 6, 2026: member

    reACK 1e31cf69821fc08887c4591caaf2b104e2ea53e3

    Checked git range-diff ca1ba0f...1e31cf69821fc08887c4591caaf2b104e2ea53e3 since my previous ACK.

    The FeeRateFormat suggestion was taken, and the unsupported getwalletinfo mention was removed from the release note.

  115. DrahtBot requested review from musaHaruna on Nov 6, 2026
  116. DrahtBot removed the label CI failed on Nov 6, 2026
  117. w0xlt commented at 7:09 PM on November 10, 2026: contributor

    reACK 1e31cf69821fc08887c4591caaf2b104e2ea53e3

  118. musaHaruna commented at 5:41 AM on November 11, 2026: contributor

    re-ACK 1e31cf6

  119. in src/core_io.h:46 in c94da571ce outdated
      42 | @@ -41,6 +43,7 @@ bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
      43 |  [[nodiscard]] util::Result<int> SighashFromStr(const std::string& sighash);
      44 |  
      45 |  UniValue ValueFromAmount(CAmount amount);
      46 | +UniValue ValueFromFeeRate(const CFeeRate& feerate, FeeRateFormat unit);
    


    maflcko commented at 10:18 AM on November 11, 2026:

    nit in the first commit: I think it would be good to add a short comment about the

    • precision (sat per kvB), and
    • that this is rounding down,

    because callers would presumably care about the rounding behavior, and maybe even want to modify it?

    Maybe: /// Stringify with an accuracy of sat/kvB. (Rounds down)

    Also, the unit tests from the second commit would be better to squash into this commit, otherwise, it is harder to review.

    Also, the impl can be shorter (instead of 20 lines, it can be ~10 lines):

    {
        const auto format_feerate = [sat_per_kvb = GetFeePerK()]<CAmount divisor, int decimals>() {
            const char* sign{sat_per_kvb < 0 ? "-" : ""};
            const CAmount quotient{std::abs(sat_per_kvb / divisor)};
            const CAmount remainder{std::abs(sat_per_kvb % divisor)};
            return UniValue{VNum, strprintf("%s%d.%0*d", sign, quotient, decimals, remainder)};
        };
        switch (fee_rate_format) {
        case FeeRateFormat::BTC_KVB: return format_feerate.operator()</*divisor=*/COIN, /*decimals=*/8>();
        case FeeRateFormat::SAT_VB: return format_feerate.operator()</*divisor=*/1000, /*decimals=*/3>();
        } // no default case, so the compiler can warn about missing cases
        assert(false);
    }
    

    (Feel free to use normal arg passing instead of the lambda template arg passing)


    polespinasa commented at 8:51 AM on November 13, 2026:

    good catch, taken

  120. in src/test/rpc_tests.cpp:342 in 58c05378c4
     337 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(1, 1), FeeRateFormat::SAT_VB).write(), "1.000");
     338 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(10, 1), FeeRateFormat::SAT_VB).write(), "10.000");
     339 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(1000, 1), FeeRateFormat::SAT_VB).write(), "1000.000");
     340 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(-1, 1), FeeRateFormat::SAT_VB).write(), "-1.000");
     341 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(-10, 1), FeeRateFormat::SAT_VB).write(), "-10.000");
     342 | +    BOOST_CHECK_EQUAL(ValueFromFeeRate(CFeeRate(-1000, 1), FeeRateFormat::SAT_VB).write(), "-1000.000");
    


    maflcko commented at 10:33 AM on November 11, 2026:

    nit in the second commit: This is just testing the CFeeRate(10, 1) ctor? I think it would be better to test the ValueFromFeeRate function wrt to the edge cases. Suggested test case:

    const auto write_as_btc_kvb = [](const CFeeRate& rate) {
            return ValueFromFeeRate(rate, FeeRateFormat::BTC_KVB).write();
        };
        const auto write_as_sat_vb = [](const CFeeRate& rate) {
            return ValueFromFeeRate(rate, FeeRateFormat::SAT_VB).write();
        };
    
        // 1 sat/kvB
        BOOST_CHECK_EQUAL(write_as_btc_kvb(CFeeRate{1}), "0.00000001");
        BOOST_CHECK_EQUAL(write_as_sat_vb(CFeeRate{1}), "0.001");
    
        // (COIN + 1) sat/kvB
        BOOST_CHECK_EQUAL(write_as_btc_kvb(CFeeRate{COIN + 1}), "1.00000001");
        BOOST_CHECK_EQUAL(write_as_sat_vb(CFeeRate{COIN + 1}), "100000.001");
    
        // MAX_MONEY / 1 vB
        BOOST_CHECK_EQUAL(write_as_btc_kvb(CFeeRate{MAX_MONEY, 1}), "21000000000.00000000");
        BOOST_CHECK_EQUAL(write_as_sat_vb(CFeeRate{MAX_MONEY, 1}), "2100000000000000.000");
    
        // Rounding down
        BOOST_CHECK_EQUAL(write_as_btc_kvb(CFeeRate{1, 1001}), "0.00000000");
        BOOST_CHECK_EQUAL(write_as_sat_vb(CFeeRate{1, 1001}), "0.000");
        BOOST_CHECK_EQUAL(write_as_btc_kvb(CFeeRate{2, 1001}), "0.00000001");
        BOOST_CHECK_EQUAL(write_as_sat_vb(CFeeRate{2, 1001}), "0.001");
    
    

    polespinasa commented at 9:25 AM on November 13, 2026:

    taken with negative cases added

  121. in src/rpc/mempool.cpp:1135 in bea7e5dd3b
    1131 | @@ -1132,9 +1132,16 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool, const FeeRateFormat feerate_u
    1132 |  
    1133 |  static RPCMethod getmempoolinfo()
    1134 |  {
    1135 | +    static constexpr bool DEFAULT_SAT_VB{false};
    


    maflcko commented at 10:37 AM on November 11, 2026:

    nit in the 4th commit: not sure about adding a per-rpc default for this. If this is ever changed in the future, it should be done globally and atomically for all rpcs, no?

    So my preference would be to put this into a global header:

    diff --git a/src/rpc/util.h b/src/rpc/util.h
    index f3d9ecc870..63900f2ea3 100644
    --- a/src/rpc/util.h
    +++ b/src/rpc/util.h
    @@ -63,2 +63,5 @@ extern const std::string EXAMPLE_ADDRESS[2];
     
    +/// Default for RPCs that accept the "sat_vb" boolean option.
    +inline constexpr bool DEFAULT_SAT_VB{false};
    +
     struct Sections;
    

    Also, the 3rd and 4th commit can be squashed, otherwise it is harder to review by jumping back and forth between the commits.


    polespinasa commented at 9:56 AM on November 13, 2026:

    Yeah, good point, taken thanks :)

  122. maflcko commented at 10:41 AM on November 11, 2026: member

    left some nits in the first 4 commits

  123. polespinasa referenced this in commit c8d652b7a5 on Nov 13, 2026
  124. polespinasa force-pushed on Nov 13, 2026
  125. polespinasa commented at 9:56 AM on November 13, 2026: member

    Addressed maflcko nits

  126. DrahtBot added the label CI failed on Nov 13, 2026
  127. DrahtBot commented at 10:57 AM on November 13, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/43405195985/job/131817708929</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU added a missing <cstdlib> include to src/core_io.cpp, leaving a diff that the lint check rejects.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still 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.

    </details>

  128. rpc: Add ValueFromFeeRate function to core_io
    Similar to ValueFromAmount this function returns a UniValue object with the feerate given a CFeeRate object.
    c95917e4f9
  129. rpc: allow getmempoolinfo to return feerates in sat/vb
    Also allow MempoolInfoToJSON to return feerates in sat/vb
    b97301190e
  130. rpc: allow getnetworkinfo to return feerates in sat/vb f72c452ef3
  131. rpc: allow named options in estimatesmartfee
    Accept fee_rate_estimator and verbosity as top-level named arguments while preserving the third-position options object and existing defaults.
    cbc7b19cba
  132. rpc: allow estimatesmartfee to return feerates in sat/vb 06ae2fe5c0
  133. rpc: allow estimaterawfee to return feerates in sat/vB
    Co-authored-by: w0xlt <woltx@protonmail.com>
    e5a2b38250
  134. doc: release notes for #33741 d6ed44b5da
  135. polespinasa force-pushed on Nov 13, 2026
  136. DrahtBot removed the label CI failed on Nov 13, 2026

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: 2026-11-21 11:51 UTC

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