Skip to content

[client]: Add estimate_smart_fee_with_mode call#531

Merged
tcharding merged 1 commit intorust-bitcoin:masterfrom
m4ycon:feat/estimatesmartfee-mode
Mar 15, 2026
Merged

[client]: Add estimate_smart_fee_with_mode call#531
tcharding merged 1 commit intorust-bitcoin:masterfrom
m4ycon:feat/estimatesmartfee-mode

Conversation

@m4ycon
Copy link
Contributor

@m4ycon m4ycon commented Mar 12, 2026

While I was working on peer-observer/peer-observer#362, I realized that corepc estimatesmartfee call was missing an optional param which is the estimate_mode.

This PR creates a "secondary" method that also accepts an enum for estimate_mode, filling this gap for the method. I ran the integration test that I created with all versions of bitcoin core from v0.17 to v30.2, except v30.0 which I didn't find the binaries, but I suppose it still works. I tried to understand/follow the repo pattern, so let me know if anything is out of place.

This is my first PR to corepc, so any feedback is welcome ^^.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for Bitcoin Core’s optional estimate_mode parameter on the estimatesmartfee RPC by introducing a dedicated client method and exposing a typed enum across versioned clients.

Changes:

  • Add FeeEstimateMode enum and estimate_smart_fee_with_mode(blocks, mode) client method (v17 macro implementation).
  • Re-export FeeEstimateMode from v17 into later client versions (v18–v30) so downstream users can access it consistently.
  • Add an integration test covering estimate_smart_fee_with_mode for all supported modes.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
integration_test/tests/util.rs Adds integration coverage for estimate_smart_fee_with_mode across all modes.
client/src/client_sync/v17/util.rs Adds estimate_smart_fee_with_mode RPC wrapper method.
client/src/client_sync/v17/mod.rs Introduces FeeEstimateMode enum used by the new method.
client/src/client_sync/v18/mod.rs Re-exports FeeEstimateMode from v17 for v18 client users.
client/src/client_sync/v19/mod.rs Re-exports FeeEstimateMode from v17 for v19 client users.
client/src/client_sync/v20/mod.rs Re-exports FeeEstimateMode from v17 for v20 client users.
client/src/client_sync/v21/mod.rs Re-exports FeeEstimateMode from v17 for v21 client users.
client/src/client_sync/v22/mod.rs Re-exports FeeEstimateMode from v17 for v22 client users.
client/src/client_sync/v23/mod.rs Re-exports FeeEstimateMode from v17 for v23 client users.
client/src/client_sync/v24/mod.rs Re-exports FeeEstimateMode from v17 for v24 client users.
client/src/client_sync/v25/mod.rs Re-exports FeeEstimateMode from v17 for v25 client users.
client/src/client_sync/v26/mod.rs Re-exports FeeEstimateMode from v17 for v26 client users.
client/src/client_sync/v27/mod.rs Re-exports FeeEstimateMode from v17 for v27 client users.
client/src/client_sync/v28/mod.rs Re-exports FeeEstimateMode from v17 for v28 client users.
client/src/client_sync/v29/mod.rs Re-exports FeeEstimateMode from v17 for v29 client users.
client/src/client_sync/v30/mod.rs Re-exports FeeEstimateMode from v17 for v30 client users.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m4ycon m4ycon force-pushed the feat/estimatesmartfee-mode branch from 4392721 to 33015e6 Compare March 12, 2026 22:55
@m4ycon m4ycon force-pushed the feat/estimatesmartfee-mode branch from 33015e6 to 5ef6ba1 Compare March 13, 2026 15:12
@tcharding
Copy link
Member

Very nice! In an atypical repository you nailed, first go. Good effort bro, thanks for the contribution.

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 5ef6ba1

@tcharding tcharding merged commit 774a655 into rust-bitcoin:master Mar 15, 2026
31 checks passed
@tcharding
Copy link
Member

Hey @jamillambert did you set up the co-pilot review? If so I found it mildly useful in that I read it before reviewing myself and because it put all the high level changes in one spot it was easier to sanity check thePR. I'll probably need to see a few more before I totally make up my mind. And just now I stumbled upon this issue that might be interesting to you: rust-bitcoin/rust-bitcoin#3054

@m4ycon
Copy link
Contributor Author

m4ycon commented Mar 16, 2026

Hey jamillambert did you set up the co-pilot review?

@tcharding I'm almost sure that this is related to my account settings, but there's probably a way to set it up for the repo too.

If I may, from my experience with it, most of its comments are not useful, but a few make a good difference. And for the summary, when the PR is concise, it does a good job like this one, but when the PR changes many unrelated things it doesn't highlight the main points so well.

But yeah, I think it's a good accelerator for a first quick review, so that a human reviewer can then go deeper on it. In addition, I previously tried coderabbit, and it seems better than copilot for reviews, I just use copilot because I have Github Pro for free through my university hehe.

image

https://github.com/settings/copilot/features

image

@tcharding
Copy link
Member

Cool, thanks for the info man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants