This is a slightly different approach to -fastprune and others, which are set in ApplyArgsManOptions().
So I wonder what is the criterion for an arg to be set in ApplyArgsManOptions(), as opposed to being initialized directly?
Initializing in the list is done for option members that don’t have sane default or empty values. This also has precedent in the ChainstateManager::Options
.
And, closely connected, isn’t the current approach of not calling ApplyArgsManOptions() in some spots (setup_common, some unit tests) a bit brittle?
Yes, the current situation does not seem to be ideal. Sometimes these extra_args
that the user can supply are currently parsed into the Options in the particular tests, and sometimes, like for the ChainstateManager
, they are ignored. This is down to the mixed usage of both the m_args
, which creates a fresh, default ArgsManager
for each test, and the m_node.args
, which parses all the passed in arguments.
This was brought up previously in this PR in #27125 (review), where based on the related discussion in #25055 and #21244 (review) I decided to keep the current behavior. If I understand the current problem correctly, it is not ideal that the m_node.args
points to the global mutable gArgs
instead of re-creating the arguments cleanly on each test run, while m_args
is recreated on each run, but does not read the extra arguments.
Based on this, I am not sure how to proceed with this on this PR, since I do think that the current approach is broken. I could add a commit making the argument handling consistent for all the Options
, at least that would make it probably less broken than it is now. What do you think?