[REST] add a rest endpoint for estimatesmartfee, docs, and test#11770
[REST] add a rest endpoint for estimatesmartfee, docs, and test#11770joemphilips wants to merge 1 commit intobitcoin:masterfrom
Conversation
180cb01 to
5ee1c95
Compare
There was a problem hiding this comment.
nit: Instead of moving them to a separate file, you could add convenience wrappers to the test_node class? Thus, it would not be required to pass in host and port all the time.
5ee1c95 to
e485e5f
Compare
promag
left a comment
There was a problem hiding this comment.
Light concept ACK. Maybe too much for REST?
At least the the URI could be improved. This looks weird:
- /rest/fee/economical/6.json
- /rest/fee/unset/3.json
src/rest.cpp
Outdated
There was a problem hiding this comment.
Unrelated change, please revert.
src/rest.cpp
Outdated
There was a problem hiding this comment.
Unrelated change, please revert.
There was a problem hiding this comment.
Thanks, done. I will make sure will not to include these kinds of changes from next time.
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
There was a problem hiding this comment.
Sounds weird to "redirect" to RPC handler (redo the mode parse etc). Maybe factor out what is needed from there?
Maybe just call ::feeEstimator.estimateSmartFee() here?
doc/REST-interface.md
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
doc/REST-interface.md
Outdated
There was a problem hiding this comment.
Returns proper fee estimated by bitcoind, this is bitcoind. 😄
|
Thanks for reviewing.
Rationale for this PR is that some light client(or other services) wants to use information about block or mempool for estimating fee. This is pretty close to the motivation of
You are right. Can I use Otherwise all I can think is enabling to omit |
|
My vote goes to |
src/rest.cpp
Outdated
There was a problem hiding this comment.
I think it's not worth passing through the RPC call estimatesmartfee.
Better directly use feeEstimator.estimateFee(nBlocks);.
There was a problem hiding this comment.
you mean feeEstimator::estimateSmartFee ?
|
Concept ACK. |
test/functional/smartfees.py
Outdated
There was a problem hiding this comment.
nit. why not:
"/rest/fee/unset/{}.json".format((i+1)//2)
Yep, agree. |
4737cc4 to
f865a63
Compare
joemphilips
left a comment
There was a problem hiding this comment.
updated according to review by @promag , @jb55 and @MarcoFalke . Ready for next review.
doc/REST-interface.md
Outdated
doc/REST-interface.md
Outdated
src/rest.cpp
Outdated
There was a problem hiding this comment.
Thanks, done. I will make sure will not to include these kinds of changes from next time.
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
There was a problem hiding this comment.
you mean feeEstimator::estimateSmartFee ?
|
Needs rebase. |
|
rebased. |
|
umm... sorry, does "Needs rebase" imply needs for squashing? or just rebasing onto master? |
|
@joemphilips You'll need to rebase onto master, as this currently has merge conflicts in At the same time, you can also squash your changes into a single commit. See Squashing Commits. Use a descriptive commit message i.e "rest: add an endpoint for estimatesmartfee". |
3976774 to
5c548c1
Compare
|
rebased (and squashed) |
There was a problem hiding this comment.
http.client is already imported above.
5c548c1 to
558e3bb
Compare
|
Still needs rebase. Could do something like this: git checkout rest_fee
git fetch bitcoin
git merge bitcoin/master
git reset --soft bitcoin/master
git commit -m '[REST] add a rest endpoint for estimatesmartfee, docs, and test'
git push origin rest_fee -f |
a47b155 to
5ed237a
Compare
|
rebased |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
src/rest.cpp
Outdated
There was a problem hiding this comment.
Remove e since unused :-)
src/rest.cpp
Outdated
There was a problem hiding this comment.
Nit: bool conservative = mode != FeeEstimateMode::ECONOMICAL; instead? :-)
src/rest.cpp
Outdated
src/rest.cpp
Outdated
src/rest.cpp
Outdated
5ed237a to
d074e0b
Compare
* write REST interface for getting estimated fee * update docs about REST interface for fee estimation * add test
|
This PR does not compile when rebased on |
I will close. sorry for leaving it here for so long. |
This could be useful if other clients want to use the core's fee estimation logic via REST.