This PR Follow up comments from #27622
It test that the new regtest-only option acceptstalefeeestimates is not supported on main, signet and test chains, removes an unnecessary comment, and update fee estimator MAXFILEAGE description comment.
acceptstalefeeestimates option is only supported on regtest chain
#28157
This PR Follow up comments from #27622
It test that the new regtest-only option acceptstalefeeestimates is not supported on main, signet and test chains, removes an unnecessary comment, and update fee estimator MAXFILEAGE description comment.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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.
Reviewers, this pull request conflicts with the following ones:
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.
Due to the multiple datadirs in the feature_config_args test, this assertion actually does fail in combine_logs.py:
I get the same error on master branch too, so I dunno if it’s really up to you and this PR to patch around it or not.
107@@ -108,6 +108,29 @@ def test_config_file_parser(self):
108 self.restart_node(0)
109 self.nodes[0].stop_node(expected_stderr=f'Warning: {inc_conf_file_path}:1 Section [testnot] is not recognized.{os.linesep}{inc_conf_file2_path}:1 Section [testnet] is not recognized.')
110
111+ with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
112+ conf.write('') # clear
I get the same error on master branch too, so I dunno if it’s really up to you and this PR to patch around it or not.
I think this should be fixed in follow-up PR.
122+ self.log.info("test acceptstalefeeestimates option is not supported on signet chain.")
123+ with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
124+ conf.write('signet=1\n')
125+ conf.write('acceptstalefeeestimates=1\n')
126+ self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={inc_conf_file_path}", "-allowignoredconf"], expected_msg='Error: acceptstalefeeestimates is not supported on signet chain.')
127+
Can be made quite a bit more DRY:
0 self.log.info(f"Test -acceptstalefeeestimates option is not supported on non-regtest chains")
1 for chain in ["main", "test", "signet"]:
2 with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
3 conf.write(f'chain={chain}\n')
4 conf.write('acceptstalefeeestimates=1\n')
5 self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={inc_conf_file_path}", "-allowignoredconf"], expected_msg=f'Error: acceptstalefeeestimates is not supported on {chain} chain.')
Also don’t think this belongs in test_config_file_parser, probably worth adding its own function for?
377@@ -378,7 +378,7 @@ def test_acceptstalefeeestimates_option(self):
378 os.utime(fee_dat, (last_modified_time, last_modified_time))
379
380 # Restart node with -acceptstalefeeestimates option to ensure fee_estimate.dat file is read
381- self.start_node(0,extra_args=["-acceptstalefeeestimates"])
382+ self.start_node(0, extra_args=["-acceptstalefeeestimates"])
555 }
556
557 std::chrono::hours file_age = GetFeeEstimatorFileAge();
558- // fee estimate file must not be too old to avoid wrong fee estimates.
559+ // Serving stale fee estimates can cause transactions to become stuck in the bottom of the mempool in the worst case.
560+ // Don't do that.
MAX_FILE_AGE.
376+ inc_conf_file_path = os.path.join(self.nodes[0].datadir, 'include.conf')
377+ for chain in ["main", "test", "signet"]:
378+ with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
379+ conf.write(f'chain={chain}\n')
380+ conf.write('acceptstalefeeestimates=1\n')
381+ self.nodes[0].assert_start_raises_init_error(extra_args=[f"-conf={inc_conf_file_path}", "-allowignoredconf"], expected_msg=f'Error: acceptstalefeeestimates is not supported on {chain} chain.')
I’m not sure why, and maybe it’s an issue with my local environment as the CI is green, but this test passes for me in the previous push 9bd96327232ac9fbb7f9cb0a0545a4410bdd4964 but not with the latest push ef19d52e25407df1a56a76038dd4c95e03e75250; only the signet case passes while the main and test cases raise the following:
0AssertionError: [node 0] Expected message "Error: acceptstalefeeestimates is not supported on test chain." does not fully match stderr:
1"Error: Unable to start HTTP server. See debug log for details."
Thanks for looking into it! Running the updated test with mainnet/testnet3/signet nodes running, the mainnet test passed. However, it still fails for the testnet3 and signet cases. (IDK about other people, but I usually have mainnet and one or both of signet and testnet3 running while working on this project and running tests.)
(nit in your last push, this diff was correct before the update, 2 spaces is the norm before a # comment)
0- conf.write('') # clear
1+ conf.write('') # clear
You can verify this using, say, the black python linter:
0$ black --code "conf.write('') # clear"
1conf.write("") # clear
Due to the multiple datadirs in the
feature_config_argstest, this assertion actually does fail incombine_logs.py:I get the same error on master branch too, so I dunno if it’s really up to you and this PR to patch around it or not. @pinheadmz The update on 530ea157ea1c25821711617e5f1da3e95cfdc66d is using the
node[0]’sbitcoin.confto set the options.
370@@ -371,6 +371,18 @@ def test_ignored_default_conf(self):
371 f'is being used instead.') + r"[\s\S]*", env=env, match=ErrorMatch.FULL_REGEX)
372 node.args = node_args
373
374+ def test_acceptstalefeeestimates_arg_support(self):
375+ self.log.info("Test -acceptstalefeeestimates option support")
376+
377+ conf_file = self.nodes[0].datadir_path / "bitcoin.conf"
378+ chains = {"main":"", "test":"testnet3", "signet":"signet"}
0 chains = {"main": "", "test": "testnet3", "signet": "signet"}
0$ pycodestyle test/functional/feature_config_args.py
1...
2test/functional/feature_config_args.py:378:25: E231 missing whitespace after ':'
3test/functional/feature_config_args.py:378:36: E231 missing whitespace after ':'
4test/functional/feature_config_args.py:378:57: E231 missing whitespace after ':'
or alternatively
0for chain, chain_name in {("main", ""), ("test", "testnet3"), ("signet", "signet")}:
380+ util.write_config(conf_file, n=0, chain=chain_name, extra_config='acceptstalefeeestimates=1\n')
381+ self.nodes[0].assert_start_raises_init_error(expected_msg=f'Error: acceptstalefeeestimates is not supported on {chain} chain.')
382+
383+ util.write_config(conf_file, n=0, chain="regtest") # Reset to regtest
384+
385+
Can drop extra newline
0$ pycodestyle test/functional/feature_config_args.py
1...
2test/functional/feature_config_args.py:386:5: E303 too many blank lines (2)
(optionally also drop the newlines at lines 376 and 382)
Tested ACK 8884d5c6059495253dc84e1b984315ddbc78ecd3
Some non-blocking comments, happy to re-ack if you update.