ryanofsky
commented at 10:40 pm on May 22, 2017:
contributor
This PR adds an -estlog option for saving live fee estimation data from a bitcoin node, and a fee_est command line tool for processing the data and testing fee estimation code.
The idea is to make it easier to test improvements to fee estimation like #10199 in a more systematic and reproducible way.
fanquake added the label
TX fees and policy
on May 23, 2017
ryanofsky force-pushed
on May 23, 2017
ryanofsky force-pushed
on Jun 2, 2017
ryanofsky force-pushed
on Jun 5, 2017
ryanofsky force-pushed
on Jun 7, 2017
paveljanik
commented at 8:46 pm on June 13, 2017:
contributor
This is interesting but still no comment.
Concept ACK
I’ll play around with this a bit.
0Wshadow statistics:
11 policy/fees_input.cpp:127:23: warning: declaration shadows a local variable [-Wshadow]
21 policy/fees_input.cpp:197:38: warning: declaration shadows a local variable [-Wshadow]
31 policy/fees_input.cpp:229:22: warning: declaration shadows a local variable [-Wshadow]
41 policy/fees_input.cpp:233:27: warning: declaration shadows a local variable [-Wshadow]
51 policy/fees_input.cpp:27:61: warning: declaration shadows a field of 'CBlockPolicyInput' [-Wshadow]
61 test/fee_est/fee_est.cpp:301:34: warning: declaration shadows a local variable [-Wshadow]
71 test/fee_est/fee_est.cpp:79:20: warning: declaration shadows a field of 'TxData' [-Wshadow]
81 test/fee_est/fee_est.cpp:79:29: warning: declaration shadows a field of 'TxData' [-Wshadow]
91 test/fee_est/fee_est.cpp:79:39: warning: declaration shadows a field of 'TxData' [-Wshadow]
paveljanik
commented at 7:21 am on June 14, 2017:
contributor
When estimate log doesn’t have enough data, fee_est is generating empty data in the HTML file. Emit some warning in such cases?
paveljanik
commented at 7:24 am on June 14, 2017:
contributor
For perfect output, there should be 3rd dimension - time or current block height when the tx was first seen :-)
jnewbery
commented at 12:05 pm on June 28, 2017:
contributor
Concept ACK. I think this could be a useful tool.
Could this be split into two PRs to aid reviewers? The first PR would cover the -estlog option and writing the fee estimation data to disk. The second PR would be for a tool to read and graph the logs.
Parsing and graphing json files seems like a problem that has probably been solved many times before. If I was approaching this, I’d look at implementing this as a script in /contrib or a separate repository. Was there a particular reason you chose to implement this as a new C++ program?
ryanofsky force-pushed
on Jul 18, 2017
ryanofsky force-pushed
on Jul 19, 2017
ryanofsky force-pushed
on Aug 25, 2017
ryanofsky force-pushed
on Nov 29, 2017
ryanofsky force-pushed
on Nov 29, 2017
ryanofsky force-pushed
on Dec 12, 2017
ryanofsky force-pushed
on Feb 9, 2018
ryanofsky force-pushed
on Mar 2, 2018
ryanofsky force-pushed
on Mar 30, 2018
ryanofsky force-pushed
on Apr 10, 2018
laanwj
commented at 6:20 pm on April 10, 2018:
member
Could this be split into two PRs to aid reviewers? The first PR would cover the -estlog option and writing the fee estimation data to disk. The second PR would be for a tool to read and graph the logs.
I think this is useful.
However I’m not sure the analysis tool belongs in this repository. As it’s specific to developers debugging the fee estimation code it’s not something we want to ship with the distribution, or install by default. One place it could be is e.g. https://github.com/bitcoin-core/bitcoin-maintainer-tools . You could still document or refer to it from here.
ryanofsky
commented at 6:53 pm on April 10, 2018:
contributor
Agree that fee_est tool shouldn’t be installed, since it’s a tool specifically for made for modifying and debugging fee estimation code.
But it would be awkward to use and maintain from a separate repository because it links and calls into the fee estimation code. (The tool works by piping historical data into the fee estimator so it’s possible to make experimental changes to fee estimation and see how those changes affect its output and internal state.)
As far as build / distribution is concerned I think it makes sense to think of it more like a unit test or benchmark than like a maintainer tool.
laanwj
commented at 2:18 pm on May 14, 2018:
member
But it would be awkward to use and maintain from a separate repository because it links and calls into the fee estimation code.
Yes, I agree, that’s unfortunately true. That part needs to stay in the repository with the rest of the code.
Parsing and graphing json files seems like a problem that has probably been solved many times before. If I was approaching this, I’d look at implementing this as a script in /contrib or a separate repository.
I agree - especially with the references to cloudflare CDN and such. It feels a bit ugly to have that in the C++ code. Better to spit out e.g. JSON or CSV or whatever is convenient, then use a separate script for pretty formatting. This would also keep open the option of using different (non-web) visualization tools.
ryanofsky force-pushed
on May 14, 2018
ryanofsky force-pushed
on Jun 4, 2018
DrahtBot
commented at 3:18 pm on July 29, 2018:
contributor
DrahtBot closed this
on Jul 29, 2018
DrahtBot reopened this
on Jul 29, 2018
DrahtBot added the label
Needs rebase
on Jul 30, 2018
ryanofsky force-pushed
on Aug 6, 2018
DrahtBot removed the label
Needs rebase
on Aug 6, 2018
ryanofsky force-pushed
on Aug 7, 2018
ryanofsky force-pushed
on Aug 7, 2018
ryanofsky force-pushed
on Aug 7, 2018
DrahtBot added the label
Needs rebase
on Sep 5, 2018
ryanofsky force-pushed
on Sep 5, 2018
ryanofsky force-pushed
on Sep 5, 2018
DrahtBot removed the label
Needs rebase
on Sep 5, 2018
in
src/test/fee_est/README.md:8
in
8cd1bb684boutdated
0@@ -0,0 +1,37 @@
1+src/test/fee_est -- Fee estimation offline testing tool
2+=======================================================
3+
4+The `fee_est` tool is intended to help debug and test changes in bitcoin fee
5+estimation code using transaction data gathered from live bitcoin nodes.
6+
7+Transaction data can be collected by running bitcoind with `-estlog` parameter
8+which will produce newline-delimited json file (http://ndjson.org/,
practicalswift
commented at 2:52 pm on September 11, 2018:
02018-09-11 16:31:38 mdl(pr=10443): src/test/fee_est/README.md:8: MD034 Bare URL used
12018-09-11 16:31:38 mdl(pr=10443): src/test/fee_est/README.md:9: MD034 Bare URL used
in
src/test/fee_est/fee_est.cpp:181
in
8cd1bb684boutdated
172+ if (entry.second.actualBlocks > int(maxTarget)) {
173+ continue;
174+ } else if (sample.size() < SAMPLE_TXS) {
175+ sample.emplace_back(&entry);
176+ } else {
177+ int j = rand() % i;
practicalswift
commented at 7:58 am on September 15, 2018:
Mod by zero here.
practicalswift
commented at 8:40 am on September 21, 2018:
02018-09-20 04:48:56 clang-tidy(pr=10443): src/test/fee_est/fee_est.cpp:177:21: warning: rand() has limited randomness; use C++11 random library instead [cert-msc30-c]
in
src/policy/fees.h:199
in
8cd1bb684boutdated
196- std::vector<const CTxMemPoolEntry*>& entries);
197+ const std::function<void(Block&)> process_txs);
198199 /** Process a transaction accepted to the mempool*/
200- void processTransaction(const CTxMemPoolEntry& entry, bool validFeeEstimate);
201+ void processTx(const uint256& hash, unsigned int height, CAmount fee, size_t size, Block* block, bool valid);
practicalswift
commented at 8:37 am on September 21, 2018:
practicalswift
commented at 8:39 am on September 21, 2018:
02018-09-2004:48:56 clang-tidy(pr=10443): src/test/fee_est/fee_est.cpp:163:28: warning: passing result of std::move() as a const reference argument; no move will actually happen [hicpp-move-const-arg]
in
src/test/fee_est/fee_est.cpp:189
in
8cd1bb684boutdated
practicalswift
commented at 8:40 am on September 21, 2018:
02018-09-20 04:48:56 clang-tidy(pr=10443): src/test/fee_est/fee_est.cpp:185:9: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
in
src/test/fee_est/fee_est.cpp:233
in
8cd1bb684boutdated
practicalswift
commented at 8:42 am on September 21, 2018:
02018-09-2004:48:56 clang-tidy(pr=10443): src/policy/fees_input.cpp:143:87: warning: the parameter 'filter' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
in
src/policy/fees_input.cpp:198
in
8cd1bb684boutdated
193+ }
194+
195+ const UniValue& read = value["read"];
196+ if (read.isStr()) {
197+ std::vector<unsigned char> data = ParseHex(read.get_str());
198+ unsigned short randv = 0;
practicalswift
commented at 8:43 am on September 21, 2018:
practicalswift
commented at 8:43 am on September 21, 2018:
02018-09-2005:13:44 cppcheck(pr=10443): [src/policy/fees_input.h:23]: (style) Class 'FeeEstInput' has a constructor with 1 argument that is not explicit.
practicalswift
commented at 8:27 am on September 23, 2018:
02018-09-2222:51:38 cpplint(pr=10443): src/policy/fees_input.h:23: Single-parameter constructors should be marked explicit. [runtime/explicit] [5]
DrahtBot
commented at 1:33 pm on September 21, 2018:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#27861 (kernel: Add interrupt class by TheCharlatan)
#27859 (Mempool: persist mempoolminfee accross restarts by ismaelsadeeq)
#27622 (Fee estimation: avoid serving stale fee estimate by ismaelsadeeq)
#25572 (refactor: Introduce EvictionManager and use it for the inbound eviction logic by dergoegge)
#25268 (refactor: Introduce EvictionManager by dergoegge)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
DrahtBot added the label
Needs rebase
on Sep 24, 2018
ryanofsky force-pushed
on Sep 25, 2018
DrahtBot removed the label
Needs rebase
on Sep 25, 2018
ryanofsky force-pushed
on Sep 26, 2018
ryanofsky force-pushed
on Sep 26, 2018
in
src/policy/fees_input.h:27
in
56446378f5outdated
22+public:
23+ explicit FeeEstInput(CBlockPolicyEstimator& estimator);
24+
25+ /** Process all the transactions that have been included in a block */
26+ struct Block;
27+ void processBlock(int height, const std::function<void(Block&)>& process_txs);
practicalswift
commented at 5:32 am on October 11, 2018:
Isn’t height guaranteed to be non-negative? Should be unsigned int?
in
src/policy/fees_input.cpp:109
in
56446378f5outdated
practicalswift
commented at 12:46 pm on November 13, 2018:
move not needed?
DrahtBot added the label
Needs rebase
on Dec 24, 2018
ryanofsky force-pushed
on Jan 4, 2019
ryanofsky force-pushed
on Jan 4, 2019
DrahtBot removed the label
Needs rebase
on Jan 5, 2019
ryanofsky
commented at 5:13 pm on January 7, 2019:
contributor
Rebased 51163cee78f32fb6311bf620266c42fd115ba98f -> 8b9c3da3cf077051d6b1112ba4adbadd60096d57 (pr/fee.16 -> pr/fee.17) due to conflict with #13341
Rebased 8b9c3da3cf077051d6b1112ba4adbadd60096d57 -> 4bcecdb666d1dbc90201dccbfee27a234f88c960 (pr/fee.17 -> pr/fee.18) due to conflict with #13786
Updated 4bcecdb666d1dbc90201dccbfee27a234f88c960 -> aaa4b687c5fdeb2c75246e23077c984a0f133e81 (pr/fee.18 -> pr/fee.19) fixing travis size_t univalue errors
Rebased aaa4b687c5fdeb2c75246e23077c984a0f133e81 -> a5faeb1cedd52b2886a1d5c320802874436fe2f6 (pr/fee.19 -> pr/fee.20) to fix broken lint error caused by #13705
Updated a5faeb1cedd52b2886a1d5c320802874436fe2f6 -> 61ab4c17eebf9b73267c992fb664d603620f9e81 (pr/fee.20 -> pr/fee.21) adding missing lock annotation.
Rebased 61ab4c17eebf9b73267c992fb664d603620f9e81 -> a9eb5cc5ceace3e567a0f7ba44c6350b2746436f (pr/fee.21 -> pr/fee.22) due to conflict with #14100
Updated a9eb5cc5ceace3e567a0f7ba44c6350b2746436f -> 8cd1bb684bfec22fc54e091dc96c782a26847393 (pr/fee.22 -> pr/fee.23) to fix G_TRANSLATION_FUN link error after #13961
Rebased 8cd1bb684bfec22fc54e091dc96c782a26847393 -> a60d26ac2bceea2c67ef34c8641705b16f656d07 (pr/fee.23 -> pr/fee.24) due to conflict with #13311
Updated a60d26ac2bceea2c67ef34c8641705b16f656d07 -> 1e7ec287c927437b5a183bc807c49eba4a16d18a (pr/fee.24 -> pr/fee.25) with suggested lint fixes
Updated 1e7ec287c927437b5a183bc807c49eba4a16d18a -> 56446378f5d0c2bdeb7a45fa7382ccd58c9b994c (pr/fee.25 -> pr/fee.26) with more lint fixes
Updated 56446378f5d0c2bdeb7a45fa7382ccd58c9b994c -> 8d99281859540689b55285bd0acdf8c1529c4b37 (pr/fee.26 -> pr/fee.27) with more lint fixes
Updated 8d99281859540689b55285bd0acdf8c1529c4b37 -> 68944a5120c651772fd7f3c028c446e38f9a3f57 (pr/fee.27 -> pr/fee.28) with more lint fixes
Rebased 68944a5120c651772fd7f3c028c446e38f9a3f57 -> 50cd9b1cb7d03a81140d8a59698eba8d06b89612 (pr/fee.28 -> pr/fee.29) due to conflict with #14555
Rebased 50cd9b1cb7d03a81140d8a59698eba8d06b89612 -> a0148157c57e91b299e6b450c7ee758f606488e6 (pr/fee.29 -> pr/fee.30) due to conflict with #13128
Updated a0148157c57e91b299e6b450c7ee758f606488e6 -> 6f9c07f0a72ff0d95bfee9f37e4ae3dc9ed9c0e4 (pr/fee.30 -> pr/fee.31) restructuring to work around clang lock annotation errors from #13128
Rebased 6f9c07f0a72ff0d95bfee9f37e4ae3dc9ed9c0e4 -> ca993015e0e115540f0ef2710a8f2a81f5fbf0c1 (pr/fee.31 -> pr/fee.32) due to conflict with #14963
Rebased ca993015e0e115540f0ef2710a8f2a81f5fbf0c1 -> b197b85a6a1c682070c445c0314d6a645936ba0f (pr/fee.32 -> pr/fee.33) due to conflict with #15043
Rebased b197b85a6a1c682070c445c0314d6a645936ba0f -> b5df05ab46d25052c95344e91fc0631b29635f1d (pr/fee.33 -> pr/fee.34) due to conflict with #15295
Updated b5df05ab46d25052c95344e91fc0631b29635f1d -> 9588e9e81d29227213babe45d37e9bfcd10ab05c (pr/fee.34 -> pr/fee.35, compare) to fix travis link error with #15295
Rebased 9588e9e81d29227213babe45d37e9bfcd10ab05c -> e2330472f0ed7466e951d99f1c707d1852289cd1 (pr/fee.35 -> pr/fee.36) due to conflict with #15534
Rebased e2330472f0ed7466e951d99f1c707d1852289cd1 -> 28ab62aaaeac6d8f7ce5f3297504b549ca4cea5a (pr/fee.36 -> pr/fee.37) due to conflict with #15638
Rebased 28ab62aaaeac6d8f7ce5f3297504b549ca4cea5a -> ccc44e115237b5337869ddb738ecb1af04c52f61 (pr/fee.37 -> pr/fee.38) due to conflict with #15323
DrahtBot added the label
Needs rebase
on Jan 15, 2019
ryanofsky force-pushed
on Jan 15, 2019
DrahtBot removed the label
Needs rebase
on Jan 15, 2019
DrahtBot added the label
Needs rebase
on Jan 30, 2019
ryanofsky force-pushed
on Jan 30, 2019
DrahtBot removed the label
Needs rebase
on Jan 31, 2019
DrahtBot added the label
Needs rebase
on Feb 14, 2019
ryanofsky force-pushed
on Feb 22, 2019
DrahtBot removed the label
Needs rebase
on Feb 22, 2019
ryanofsky force-pushed
on Feb 22, 2019
DrahtBot added the label
Needs rebase
on Mar 5, 2019
ryanofsky force-pushed
on Mar 5, 2019
DrahtBot removed the label
Needs rebase
on Mar 5, 2019
Concept ACK, but it seems the HTML code (or even the conversion to HTML) could live outside the repo?
DrahtBot added the label
Needs rebase
on Jun 6, 2019
ryanofsky force-pushed
on Jun 7, 2019
DrahtBot removed the label
Needs rebase
on Jun 7, 2019
ryanofsky
commented at 12:48 pm on June 8, 2019:
contributor
This PR has some overlap with @kallewoof’s mff utility. One difference is that this creates logs in json-lines format and only logs mempool data needed to run fee estimation code reproducibly, while mff uses a custom format and logs additional information.
Rebased ccc44e115237b5337869ddb738ecb1af04c52f61 -> 6251342fc77cb49e9913aeeb89bf6f3e3234f617 (pr/fee.38 -> pr/fee.39 due to various conflicts
Rebased 6251342fc77cb49e9913aeeb89bf6f3e3234f617 -> 23a1edcfaa469022c9e8296559fb0d00417225ec (pr/fee.39 -> pr/fee.40) due to conflict with #16171
Rebased 6251342fc77cb49e9913aeeb89bf6f3e3234f617 -> 1b322b073e0ce93f55b9f5678bf50ee1af069c58 (pr/fee.39 -> pr/fee.40) due to conflict with #16171
Rebased 1b322b073e0ce93f55b9f5678bf50ee1af069c58 -> 207cf9f8356ab4ceb72b1fd0bbbb66f6e726006b (pr/fee.40 -> pr/fee.41) due to conflicts with #14193 and #16291
Rebased 207cf9f8356ab4ceb72b1fd0bbbb66f6e726006b -> a1c3573115b25a6b702a1b56e5813a80281f9d7d (pr/fee.41 -> pr/fee.42) due to conflict with #16362
Rebased a1c3573115b25a6b702a1b56e5813a80281f9d7d -> 73b1eaca4edecae3dcde6fcf57b3832fb84a8d10 (pr/fee.42 -> pr/fee.43)
Rebased 73b1eaca4edecae3dcde6fcf57b3832fb84a8d10 -> aa41b10397895687dcdafad40fd9ac1934796425 (pr/fee.43 -> pr/fee.44) due to conflict with #15921
Rebased aa41b10397895687dcdafad40fd9ac1934796425 -> f00110e8b6836ef384c0dbbd3ec693d5b97c21bb (pr/fee.44 -> pr/fee.45) due to minor conflict with #17050
Rebased f00110e8b6836ef384c0dbbd3ec693d5b97c21bb -> 03bcb1190e4e6673414a3ae9dfca1112ab14b305 (pr/fee.45 -> pr/fee.46) due to conflicts with #17851 and #16688
Rebased 03bcb1190e4e6673414a3ae9dfca1112ab14b305 -> 35af64c93097ca65e5d0e8ef76b0326fdc1561cf (pr/fee.46 -> pr/fee.47) due to conflict with #17891
Rebased 35af64c93097ca65e5d0e8ef76b0326fdc1561cf -> 6597699b2215d5aef8633c973b0e4f4fddcf230b (pr/fee.47 -> pr/fee.48) due to conflict with #17261
Rebased 6597699b2215d5aef8633c973b0e4f4fddcf230b -> 8392f77f047c1bc11e0475ef5fbf624f7f3f9488 (pr/fee.48 -> pr/fee.49) due to conflict with #17925
Rebased 8392f77f047c1bc11e0475ef5fbf624f7f3f9488 -> b5adc1b2819d88f5e2ed67dd98c9f5c091e99101 (pr/fee.49 -> pr/fee.50, compare) due to conflict with #18126
Rebased b5adc1b2819d88f5e2ed67dd98c9f5c091e99101 -> b698b5dbaa87cba45f867141a97b010813d86160 (pr/fee.50 -> pr/fee.51, compare) due to conflict with #18134
Rebased b698b5dbaa87cba45f867141a97b010813d86160 -> 47164d0ef2d2625c3c47e49659e6f1833c472700 (pr/fee.51 -> pr/fee.52, compare) due to conflict with #18673
Rebased 47164d0ef2d2625c3c47e49659e6f1833c472700 -> 5123ff1f22b38162e42529b2f1484bb980c7834c (pr/fee.52 -> pr/fee.53, compare) to due conflicts with #18698 and #18922
Updated 5123ff1f22b38162e42529b2f1484bb980c7834c -> 854a21ddb8007cdea471befd25cb401f7f4f96e4 (pr/fee.53 -> pr/fee.54, compare) fixing travis fuzzer build
Updated 854a21ddb8007cdea471befd25cb401f7f4f96e4 -> e635c970bd0a6b8bfe7f923e96fd17186d623843 (pr/fee.54 -> pr/fee.55, compare) fixing travis fuzzer assert https://travis-ci.org/github/bitcoin/bitcoin/jobs/691844334#L3561
Updated e635c970bd0a6b8bfe7f923e96fd17186d623843 -> 009c76da19c271a552ec88ba17009a30e1a3141b (pr/fee.55 -> pr/fee.56, compare) fixing travis fuzzer assert https://travis-ci.org/github/bitcoin/bitcoin/jobs/694860650#L3536
Rebased 009c76da19c271a552ec88ba17009a30e1a3141b -> 3f92adfecc9dc3b11e620b421ea4084ff9fcd280 (pr/fee.56 -> pr/fee.57, compare) to work around travis arm timeouts “sudo: unable to resolve host travis-job-bitcoin-bitcoin-694879056” https://travis-ci.org/github/bitcoin/bitcoin/jobs/694879056
Rebased 3f92adfecc9dc3b11e620b421ea4084ff9fcd280 -> 110245a8dbd11d31d9e52c7c17dc8795743617f8 (pr/fee.57 -> pr/fee.58, compare) due to conflict with #19561
Rebased 110245a8dbd11d31d9e52c7c17dc8795743617f8 -> 00d514a60820d7c3be4fa0e5433aefabd594d237 (pr/fee.58 -> pr/fee.59, compare) due to conflict with #19556
Rebased 00d514a60820d7c3be4fa0e5433aefabd594d237 -> 2c512ff0729f89aa47019009534d3958ec18f42b (pr/fee.59 -> pr/fee.60, compare) due to conflict with #20003
DrahtBot added the label
Needs rebase
on Jun 18, 2019
ryanofsky force-pushed
on Jun 20, 2019
DrahtBot removed the label
Needs rebase
on Jun 20, 2019
DrahtBot added the label
Needs rebase
on Jul 3, 2019
ryanofsky force-pushed
on Jul 10, 2019
DrahtBot removed the label
Needs rebase
on Jul 10, 2019
DrahtBot added the label
Needs rebase
on Jul 24, 2019
ryanofsky force-pushed
on Aug 1, 2019
DrahtBot removed the label
Needs rebase
on Aug 1, 2019
DrahtBot added the label
Needs rebase
on Aug 2, 2019
ryanofsky force-pushed
on Aug 3, 2019
DrahtBot removed the label
Needs rebase
on Aug 3, 2019
laanwj added the label
Feature
on Sep 30, 2019
DrahtBot added the label
Needs rebase
on Oct 30, 2019
ryanofsky force-pushed
on Nov 25, 2019
DrahtBot removed the label
Needs rebase
on Nov 25, 2019
DrahtBot added the label
Needs rebase
on Dec 11, 2019
ryanofsky force-pushed
on Dec 12, 2019
DrahtBot removed the label
Needs rebase
on Dec 12, 2019
DrahtBot added the label
Needs rebase
on Jan 3, 2020
ryanofsky force-pushed
on Jan 9, 2020
DrahtBot removed the label
Needs rebase
on Jan 9, 2020
DrahtBot added the label
Needs rebase
on Jan 15, 2020
ryanofsky force-pushed
on Jan 16, 2020
DrahtBot removed the label
Needs rebase
on Jan 16, 2020
DrahtBot added the label
Needs rebase
on Jan 30, 2020
ryanofsky force-pushed
on Jan 31, 2020
DrahtBot removed the label
Needs rebase
on Jan 31, 2020
DrahtBot added the label
Needs rebase
on Feb 3, 2020
ryanofsky force-pushed
on Feb 10, 2020
DrahtBot removed the label
Needs rebase
on Feb 10, 2020
ryanofsky force-pushed
on Mar 6, 2020
DrahtBot added the label
Needs rebase
on Mar 25, 2020
ryanofsky force-pushed
on Apr 15, 2020
DrahtBot removed the label
Needs rebase
on Apr 15, 2020
DrahtBot added the label
Needs rebase
on Apr 17, 2020
ryanofsky force-pushed
on Apr 23, 2020
DrahtBot removed the label
Needs rebase
on Apr 23, 2020
DrahtBot added the label
Needs rebase
on May 23, 2020
ryanofsky force-pushed
on May 27, 2020
DrahtBot removed the label
Needs rebase
on May 27, 2020
ryanofsky force-pushed
on May 27, 2020
ryanofsky force-pushed
on Jun 5, 2020
ryanofsky force-pushed
on Jun 5, 2020
ryanofsky force-pushed
on Jul 10, 2020
DrahtBot added the label
Needs rebase
on Jul 30, 2020
ryanofsky force-pushed
on Jul 30, 2020
DrahtBot removed the label
Needs rebase
on Jul 30, 2020
DrahtBot added the label
Needs rebase
on Sep 7, 2020
ryanofsky force-pushed
on Sep 13, 2020
DrahtBot removed the label
Needs rebase
on Sep 13, 2020
DrahtBot added the label
Needs rebase
on Sep 29, 2020
ryanofsky force-pushed
on Oct 2, 2020
DrahtBot removed the label
Needs rebase
on Oct 2, 2020
DrahtBot added the label
Needs rebase
on Dec 1, 2020
jonatack
commented at 10:41 am on December 2, 2020:
member
Discovered this PR thanks to DrahtBot’s “needs rebase” notifications.
Concept ACK, interesting idea for dev tooling in the tests or contrib.
in
src/policy/fees_input.cpp:130
in
2c512ff072outdated
DrahtBot added the label
Needs rebase
on Oct 19, 2022
ryanofsky force-pushed
on Jan 20, 2023
DrahtBot removed the label
Needs rebase
on Jan 20, 2023
DrahtBot added the label
Needs rebase
on Feb 1, 2023
ryanofsky force-pushed
on Feb 10, 2023
DrahtBot removed the label
Needs rebase
on Feb 10, 2023
DrahtBot added the label
Needs rebase
on Apr 21, 2023
achow101 requested review from glozow
on Apr 25, 2023
achow101 requested review from josibake
on Apr 25, 2023
josibake
commented at 1:03 pm on May 1, 2023:
member
Haven’t dug into the code, but I’m leaning toward Concept ACK, Approach NACK
As someone who is planning to do fee estimation research in the near future, I don’t think I’d use something like this the way it’s currently written. I would much prefer something that logs Bitcoin Core’s live fee rate estimations, or some option that would allow me to tell Bitcoin Core it’s at a certain chain height, feed it some mempool data, and then ask it for fee estimations.
I also agree that the tool for analyzing the data shouldn’t be in this repo. Much better if we can figure out what data is missing for people who want to do fee estimation analysis and provide an option for logging that data.
Perhaps a good next step would be to talk to people who are currently doing fee estimation work and see what data would help with their projects/PRs? @ClaraShk@darosior@Xekyo ?
ryanofsky
commented at 3:23 pm on May 1, 2023:
contributor
@josibake thanks for looking at this. I don’t think I understand what the idea behind an approach NACK would be based on what you are saying, though.
It sounds more like you’re asking for an additional feature which would be easy to implement on top of the first commit, not pointing to a drawback of the approach. If you want to gather live fee estimates, the first commit outputs a structured jsonl log of fee estimation events, so it would be easy to add the actual fee estimates to this log, or add internal metrics used to produce the fee estimates, or add any other data points that might be interesting. It is also possible to take the existing log files this PR already generates, and feed them to the fee estimation algorithm by modifying the tool in the second commit to produce live fee estimates or a history of estimates over time.
If you just think I should drop the second commit, or trim it down, I think that would be reasonable. The point of the second commit is mainly to provide example code that demonstrates how to read the JSONL log file and how to call the fee estimator API. The idea is to avoid needing reinvent the wheel each time you want to monitor fee estimation behavior, or reproduce a bug, or determine the effects of a change.
I would much prefer […] some option that would allow me to tell Bitcoin Core it’s at a certain chain height, feed it some mempool data, and then ask it for fee estimations.
This is actually what the second commit provides. The .jsonl log contains chain and mempool data. You can feed it to the test program in the second commit, and it calls fee estimation code to produce fee estimates. It can produce a graph of the fee estimates, and calculate how accurate they were by looking at all the transactions that got confirmed and outputting the mean squared error of how many blocks it actually took the transactions to be confirmed vs how many blocks the fee estimation algorithm predicted it would take to get them confirmed based on their feerate.
This PR is a few years old, so I would probably implement the second commit a little differently today. Instead of adding a standalone c++ executable that calls fee estimator code and produces graphs and metrics, I might want to just add a python module that exposes the CBlockPolicyEstimator class, and generate the graphs and metrics from a python notebook.
Add -estlog option for saving live fee estimation data651e37591e
Add fee_est tool for debugging fee estimation code26240e1a5f
ryanofsky force-pushed
on May 2, 2023
DrahtBot removed the label
Needs rebase
on May 2, 2023
DrahtBot added the label
CI failed
on May 2, 2023
ryanofsky force-pushed
on May 2, 2023
DrahtBot removed the label
CI failed
on May 2, 2023
josibake
commented at 9:53 am on May 3, 2023:
member
Thanks for the thorough response @ryanofsky. I realize I didn’t explain myself very well in my initial comment.
It sounds more like you’re asking for an additional feature which would be easy to implement on top of the first commit, not pointing to a drawback of the approach
Since we already record mempool events in the debug log file (this is what @jamesob and I are using to log mempool events in bmon), it feels a bit strange to have special code for logging transactions again here for fee estimation. It’s possible I’m not understanding something here, though: is there some special information in the log you are writing that we can’t get from the debug log file?
This is actually what the second commit provides. The .jsonl log contains chain and mempool data. You can feed it to the test program in the second commit, and it calls fee estimation code to produce fee estimates
I think what I was envisioning was even simpler: have a flag to make Bitcoin Core log fee_rate estimates per block and then have some way to walk the node back to some point in the past, have it log fee_rate estimates (perhaps with a code change) and then leave it up to the individual on how to analyze the diff between those logs. Perhaps this is easier said than done since the fee estimation code in Bitcoin Core today seems to work on a per transaction basis?
ryanofsky
commented at 2:55 pm on May 3, 2023:
contributor
is there some special information in the log you are writing that we can’t get from the debug log file?
I think so. The json log captures all inputs to fee estimator to used update its internal state. It includes not just mempool events but also information about which transactions are included in blocks, flush events, and contents of fee_estimates.dat blobs that are loaded. It makes fee estimation code reproducible, so if you make a change to the fee estimation code or parameters, you can evaluate the effects of the change with real world inputs offline. 1
I think what I was envisioning was even simpler: have a flag to make Bitcoin Core log fee_rate estimates per block and then have some way to walk the node back to some point in the past, have it log fee_rate estimates (perhaps with a code change) and then leave it up to the individual on how to analyze the diff between those logs. Perhaps this is easier said than done since the fee estimation code in Bitcoin Core today seems to work on a per transaction basis?
I think I don’t actually understand the proposal or don’t understand the intended use-case. Use-cases for PR this are to:
Be able to make changes to the fee estimation algorithm and be able to see how the changes affect fee estimates in a quick feedback loop
Be able to evaluate quality of fee estimates. The example program compares how quickly fee estimator expects transactions get to get confirmed (based on feerate) vs how quickly they actually get confirmed. This could be one metric for comparing quality of different fee estimation algorithms, or seeing if one algorithm starts to perform better or worse over time. It should also be possible to implement other metrics besides this one and do similar things.
Is your proposal basically to save a fee_estimates.dat file each time a block is connected and then use those files for something? I’m guess I’m not sure how you would use those files to improve fee estimates. This PR does capture a superset of that information, too. For example, it would be possible to generate those files offline from the json log file produced in this PR by adding a few lines to the filter callback:
Another advantage of this change is that it decouples CBlockPolicyEstimator from the mempool, so it’s possible to call it offline. The external API changes from:
There are probably lots of changes that could be made to this PR to improve it, or trim it down if it is doing too much, but in general I think takes a good first step of pulling things out of CBlockPolicyEstimator that don’t belong there (mempool access, filesystem access), and then builds some useful features on top of that.
I also think in practice parsing a json log file is cleaner and more straightforward than parsing a debug.log file. Compare
readLog vs logparse. But I recognize there could be other advantages to using debug.log files, especially since debug.log files are omnipresent and already exist. ↩︎
DrahtBot added the label
CI failed
on May 14, 2023
DrahtBot added the label
Needs rebase
on Jun 20, 2023
DrahtBot
commented at 5:24 pm on June 20, 2023:
contributor
🐙 This pull request conflicts with the target branch and needs rebase.
DrahtBot
commented at 0:13 am on September 18, 2023:
contributor
There hasn’t been much activity lately and the patch still needs rebase. What is the status here?
Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
Is it no longer relevant? ➡️ Please close.
Did the author lose interest or time to work on this? ➡️ Please close it and mark it ‘Up for grabs’ with the label, so that it can be picked up in the future.
ryanofsky
commented at 11:38 am on September 19, 2023:
contributor
Going to close this because I think @josibake is working on a different approach which will try replace current fee estimator, instead of just instrumenting it like this PR.
There’s also another PR #28368 which decouples the fee estimator from the mempool, and might make it easier to replay fee estimation events like the changes in this PR, even though it only provides an API, not a CLI tool.
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: 2024-11-23 09:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me