Skip to content

bug: GetMempoolInfo model FeeRate conversion broken #482

Closed

Description

@0xB10C

The following integration test patch shows the bug:

diff --git a/integration_test/tests/blockchain.rs b/integration_test/tests/blockchain.rs
index baaf80c..c1ee274 100644
--- a/integration_test/tests/blockchain.rs
+++ b/integration_test/tests/blockchain.rs
@@ -346,6 +346,10 @@ fn blockchain__get_mempool_info__modelled() {

     // Sanity check.
     assert_eq!(info.size, 1);
+
+    println!("json: {}", json.mempool_min_fee);
+    println!("model: {}", info.mempool_min_fee.unwrap());
+    assert!(info.mempool_min_fee.unwrap() > bitcoin::FeeRate::ZERO);
 }

 #[test]

Running it against a v30.x Bitcoin Core node outputs:

$  cargo test --features 30_2 blockchain__get_mempool_info__modelled
running 1 test
test blockchain__get_mempool_info__modelled ... FAILED

failures:

---- blockchain__get_mempool_info__modelled stdout ----
json: 0.000001
model: 0

thread 'blockchain__get_mempool_info__modelled' (1042316) panicked at tests/blockchain.rs:352:5:
assertion failed: info.mempool_min_fee.unwrap() > bitcoin::FeeRate::ZERO
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    blockchain__get_mempool_info__modelled

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 37 filtered out; finished in 1.21s

There are a few other FeeRate fields in the GetMempoolInfo model that are probably broken too.

Activity

  1. tcharding commented on Jan 27, 2026

    @tcharding
    Member

    There are a few other FeeRate fields in the GetMempoolInfo model that are probably broken too.

    The bug is in btc_per_kb() which is called 39 times. Also we call it in code for Core v30 all the way back to v17. I highly doubt this is the only fee rate related bug we have. Ref: #60

  2. tcharding commented on Jan 27, 2026

    @tcharding
    Member

    Thanks for the raising the issue @0xB10C, you are a legend.

  3. 0xB10C commented on Jan 28, 2026

    @0xB10C
    ContributorAuthor

    Dang, that was fast. Thanks for looking into it @tcharding!

  4. tcharding commented on Jan 28, 2026

    @tcharding
    Member

    Like a boss.

  5. added a commit that references this issue on May 27, 2026
    d31fc06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions