Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: settings, do not load auto-generated warning msg #29301

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

furszy
Copy link
Member

@furszy furszy commented Jan 24, 2024

Fixes #29144 (comment).

The settings warning message is meant to be used only to discourage users from
modifying the file manually. Therefore, there is no need to keep it in memory.

The settings warning message is meant to be used only to discourage
users from modifying the file manually. Therefore, there is no need
to keep it in memory.
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 24, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK achow101, ryanofsky

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@achow101
Copy link
Member

ACK 987a1b5

@DrahtBot DrahtBot removed the request for review from achow101 January 24, 2024 17:52
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK 987a1b5. Seems like a clean, simple fix

@@ -31,6 +31,9 @@ enum class Source {
CONFIG_FILE_DEFAULT_SECTION
};

// Json object key for the auto-generated warning comment
const std::string SETTINGS_WARN_MSG_KEY{"_warning_"};
Copy link
Contributor

Choose a reason for hiding this comment

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

In commit "init: settings, do not load auto-generated warning msg" (987a1b5)

Not sure, but maybe this can be changed to std::string_view to avoid the need to allocate memory before main() runs.

Copy link
Member Author

Choose a reason for hiding this comment

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

In commit "init: settings, do not load auto-generated warning msg" (987a1b5)

Not sure, but maybe this can be changed to std::string_view to avoid the need to allocate memory before main() runs.

As the settings map take strings for keys, wouldn't this change mean that we would need to static cast string_view to string to not create a copy during the push/erase methods call?

Copy link
Contributor

Choose a reason for hiding this comment

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

re: #29301 (comment)

As the settings map take strings for keys, wouldn't this change mean that we would need to static cast string_view to string to not create a copy during the push/erase methods call?

The idea is that just that it is noticeable when programs are slow to start, so you usually want to reduce the amount of code that needs to run before main(), even if it means code that runs later but is less sensitive might be slower. In this case there is not even a need for a tradeoff, though since univalue could take string_view arguments. Just explaining the suggestion though, this is not important

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, sounds good @ryanofsky. Thanks for coming back to this!

@glozow glozow requested a review from fanquake January 29, 2024 13:47
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

Seems fine. Gets rid of the pointless 2024-01-31T10:25:34Z Ignoring unknown rw_settings value _warning_ and
2024-01-31T10:25:34Z Setting file arg: _warning_ = "This file is automatically generated and updated by Bitcoin Core. Please do not edit this file while the node is running, as any changes might be ignored or overwritten." output.

@fanquake fanquake added this to the 27.0 milestone Jan 31, 2024
@achow101 achow101 merged commit 6f7395b into bitcoin:master Jan 31, 2024
16 checks passed
@furszy furszy deleted the 2024_settings_dont_load_warning_msg branch January 31, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants