Ava Chow
daca51bf80
Merge bitcoin/bitcoin#32750 : refactor: CFeeRate encapsulates FeeFrac internally
...
d3b8a54a81 Refactor CFeeRate to use FeeFrac internally (Pol Espinasa)
Pull request description:
The `FeeFrac` type represents a fraction, intended to be used for `sats/vbyte` or `sats/WU`. It was added to improve accuracy when evaluating fee rates in cluster mempool. [1]
But it can also be used to fix the precision issues that the current `CFeeRate` class has now.
At the moment, `CFeeRate` handles the fee rate as satoshis per kilovirtualbyte: `CAmount / kvB` using an integer.
This PR fix `CFeeRate` precision issues by encapsulating `FeeFrac` internally keeping backwards compatibility.
This PR can also be used as a based to use multiple units on RPC calls as detailed in this issue [2].
Some previous discussions:
[1] https://github.com/bitcoin/bitcoin/pull/30535
[2] https://github.com/bitcoin/bitcoin/issues/32093
ACKs for top commit:
achow101:
ACK d3b8a54a81
murchandamus:
code review, lightly tested ACK d3b8a54a81
ismaelsadeeq:
re-ACK d3b8a54a81 📦
theStack:
Code-review ACK d3b8a54a81
Tree-SHA512: 5a8149d81e82ad4e60a0e76ff6a82a5b1c4e212cf5156c1cdd16bf9acbb351e7be458eac3f0a2ae89107f331062b299c1d9ca649d3b820ad0b68e6d1a14292e5
2025-08-08 18:11:05 -07:00
..
2025-08-07 14:53:26 +01:00
2025-07-30 13:55:01 -07:00
2025-05-08 16:49:58 +01:00
2025-06-03 19:56:55 +02:00
2025-08-07 09:27:25 +01:00
2025-06-03 19:56:55 +02:00
2025-07-11 15:18:22 +02:00
2025-07-25 09:50:50 +02:00
2025-07-11 13:47:19 -04:00
2025-06-19 16:29:55 +02:00
2025-07-28 10:37:42 +01:00
2025-05-30 16:51:49 +01:00
2025-02-21 10:43:01 +01:00
2025-05-13 18:07:47 +01:00
2025-08-04 16:47:54 +01:00
2025-08-08 18:11:05 -07:00
2025-07-11 13:47:19 -04:00
2025-08-08 16:40:22 +01:00
2025-08-06 11:16:32 +01:00
2025-07-31 16:51:39 -04:00
2025-07-22 09:35:01 +01:00
2025-05-23 10:09:39 +01:00
2025-08-08 18:11:05 -07:00
2025-07-23 13:29:07 -07:00
2025-08-06 15:46:18 -07:00
2025-08-08 18:11:05 -07:00
2025-06-13 19:19:44 +03:00
2025-06-03 15:13:54 +02:00
2025-07-10 11:24:40 +02:00
2024-07-30 14:06:58 -04:00
2025-03-23 21:58:39 +01:00
2024-09-20 12:55:22 -04:00
2024-11-11 12:47:53 -03:00
2024-11-11 12:47:53 -03:00
2025-01-09 10:11:46 -05:00
2025-04-07 10:45:13 -04:00
2025-07-25 09:50:50 +02:00
2025-05-19 16:40:33 +01:00
2025-06-03 15:13:54 +02:00
2025-03-12 19:46:54 +01:00
2025-06-03 15:13:57 +02:00
2025-06-03 15:13:57 +02:00
2025-06-03 19:56:55 +02:00
2025-03-12 19:46:54 +01:00
2025-05-24 13:49:32 +02:00
2025-06-10 15:14:24 +02:00
2025-08-04 15:33:25 -06:00
2025-06-10 15:14:24 +02:00
2025-06-10 15:14:24 +02:00
2025-05-17 09:36:25 +02:00
2025-06-10 15:14:24 +02:00
2025-01-15 12:15:40 +01:00
2025-06-10 15:14:24 +02:00
2025-05-09 15:07:04 +02:00
2025-07-03 17:03:00 -04:00
2025-06-10 15:14:24 +02:00
2025-01-16 21:06:21 +00:00
2025-06-10 10:07:56 -04:00
2025-06-10 10:07:56 -04:00
2024-05-16 10:16:08 -05:00
2025-06-12 14:40:59 -04:00
2025-07-25 09:50:50 +02:00
2025-06-03 15:13:57 +02:00
2024-11-14 13:41:02 -05:00
2025-03-06 15:39:58 -06:00
2025-05-19 22:06:48 +00:00
2025-05-20 09:30:41 +01:00
2025-05-29 11:18:36 +01:00
2025-07-14 09:41:17 -04:00
2025-08-07 14:53:26 +01:00
2024-12-04 14:09:05 -05:00
2025-06-03 15:13:57 +02:00
2025-03-12 19:46:54 +01:00
2024-11-26 20:47:08 -05:00
2025-04-22 13:16:54 +01:00
2025-01-22 17:31:22 -05:00
2025-05-19 16:40:33 +01:00
2025-08-06 15:46:18 -07:00
2025-07-22 10:26:15 -07:00
2025-04-30 14:51:21 +02:00
2025-04-30 14:51:21 +02:00
2025-02-21 10:41:27 +01:00
2025-01-21 00:38:03 +10:00
2025-07-25 09:50:50 +02:00
2024-08-13 07:44:31 +02:00
2025-06-16 15:33:19 +02:00
2024-07-24 09:39:35 +02:00
2025-03-12 19:46:54 +01:00
2025-03-12 19:46:54 +01:00
2025-03-04 14:23:18 -05:00
2025-05-19 16:40:33 +01:00
2025-07-03 06:26:23 -04:00
2025-07-25 09:50:50 +02:00
2024-11-04 17:08:21 +01:00
2025-04-22 13:16:54 +01:00
2024-06-12 16:19:50 -03:00
2025-08-04 14:04:21 -04:00
2025-01-16 21:06:21 +00:00
2025-06-03 15:13:57 +02:00
2025-03-12 19:46:54 +01:00
2025-03-12 19:46:54 +01:00
2025-07-09 09:13:00 -04:00
2025-07-09 09:13:00 -04:00
2024-11-04 14:19:40 -05:00
2025-07-17 12:43:04 -04:00
2024-11-04 18:46:40 +01:00
2024-07-08 11:12:01 +02:00
2025-06-11 11:11:48 -07:00
2025-08-01 12:07:26 +01:00
2024-05-16 10:16:08 -05:00
2025-02-21 10:41:27 +01:00
2025-08-04 16:47:54 +01:00
2025-08-01 11:52:32 -04:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2025-07-22 14:29:36 +02:00
2025-07-22 14:29:37 +02:00
2025-06-03 08:09:21 +01:00
2025-03-12 19:46:54 +01:00
2025-06-30 13:28:17 -04:00
2025-06-03 19:56:55 +02:00
2025-07-25 09:50:50 +02:00
2025-07-25 09:50:50 +02:00
2025-06-18 18:11:28 -03:00
2025-06-18 18:11:28 -03:00
2025-04-22 17:11:24 +10:00
2025-06-03 15:13:57 +02:00
2025-07-25 16:23:37 -07:00
2025-07-08 20:00:51 +01:00
2025-07-08 20:00:51 +01:00
2025-05-14 14:00:43 -07:00
2025-05-14 14:00:43 -07:00
2025-05-21 10:44:26 -07:00
2025-05-21 10:44:26 -07:00
2025-07-25 09:50:50 +02:00
2025-07-16 13:19:18 -07:00
2025-05-08 16:49:58 +01:00
2025-07-06 11:20:18 +08:00
2025-06-16 18:09:14 +00:00
2025-05-10 03:31:30 +00:00
2025-07-29 16:25:47 -07:00
2025-03-12 19:46:54 +01:00
2025-03-12 19:46:54 +01:00
2025-07-16 14:33:07 -07:00
2025-07-16 14:33:07 -07:00
2025-02-21 10:43:01 +01:00
2025-07-07 15:51:37 +01:00
2025-05-08 20:13:46 +00:00
2025-01-15 12:16:08 +01:00
2025-05-13 12:09:40 +02:00
2025-05-13 12:09:40 +02:00
2025-04-07 15:59:41 +02:00
2025-01-15 15:44:55 +01:00
2025-07-14 10:28:54 -04:00
2025-07-14 10:28:54 -04:00
2025-07-30 14:20:03 -04:00
2025-07-30 14:20:03 -04:00
2025-07-23 15:01:18 +01:00
2025-07-23 15:01:18 +01:00
2025-04-09 15:59:59 +01:00
2025-04-09 15:59:59 +01:00
2025-08-08 18:11:05 -07:00
2025-07-18 14:02:59 +02:00
2025-06-16 18:09:14 +00:00
2025-07-07 18:14:52 +01:00
2025-01-21 00:38:03 +10:00
2025-04-30 14:51:21 +02:00
2025-04-30 14:51:21 +02:00
2024-07-08 11:12:01 +02:00