mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:29:40 +00:00
scripted-diff: [wallet] Remove trailing newlines from one-line log messages #36397
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36397
Loading…
Reference in a new issue
No description provided.
Delete branch "2610-log-format-string-trailing-newline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a low-prio style cleanup for years, but:
So I wonder if a simple scripted-diff can cover the bulk of the changes now, with hopefully little conflicts with reviewed pull requests.
(Removing the trailing newlines from the remaining log messages is trivial and can be done in a later pull)
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
src/wallet/wallet.cpp:Wallet passphrase changed to an nDeriveIterations of %i→Wallet passphrase changed; nDeriveIterations = %i[the current wording incorrectly suggests the passphrase was changed to an iteration count]src/wallet/wallet.cpp:Encrypting Wallet with an nDeriveIterations of %i→Encrypting wallet with nDeriveIterations = %i[the current wording is grammatically broken]2026-10-19 08:38:50
Base:
6301d464f72d2752867c974e747f7a78b4f8322fHead:
fa0c552cc5abdd0a7e7f2c9cfc1491240494f352No verified findings are available from this review.
Review coverage was incomplete. adversarial_glm: Stage budget exhausted before the review completed.
Full review report
39 conflicts right now. Not sure what number is acceptable, but the focus should probably be to not invalidate any current acks
I've wondered this before, but am again wondering if there's a way to have this drahtbot comment also display how many current (full) ACKs are on each of these? IIRC previously I thought it may be a bit tricky/probably not worth it, but with LLMs maybe it might be possible to show?
I think 39 conflicts is probably a strong enough signal on it's own here, but when there's 5 or 6 it can be useful (but tedious) to click each one and actually see the state of it...
Concept ACK - could a linter check that we don't add new ones?
If we do these big messy refactors, they should be done at the beginning of the release cycle (i.e. soon), and maybe we could ping the people affected, and whoever reviews this could help re-ACK the invalidated ones.
+1 for adding valid ACK count to drahtbot.
🐙 This pull request conflicts with the target branch and needs rebase.
It should be checked at compile time, but this can be done later.
I'd say no, because the beginning of the cycle is best used for features (gives them more time to sit). Also, backports are easier if refactors are done later.
🚧 At least one of the CI tasks failed.
Task
Alpine (musl): https://github.com/bitcoin/bitcoin/actions/runs/37332770376/job/111839778318LLM reason (✨ experimental): The build failed because
wallet.cpppasses a format string ending in a newline toWalletLogPrintf, which the compile-time format check rejects.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
There are no reviewed wallet conflicts, so I limited the change to wallet for now. Also, enforced it at compile time.
ACK
fa3da29147I think ralphs suggestion here is legit, but I don't think it's worth fixing.
Agree with l0rinc that a lint check could be nice for this after the remainder are fixed.
Heh, as Ralph says, there should be no production impact/change here, so this is still a refactor. In any case, avoiding a double-newline seems beneficial, so this is either irrelevant or this pull has it "fixed".
Not sure I understand this. This is already rejected at compile time, see https://github.com/bitcoin/bitcoin/pull/36397#issuecomment-5998210751. So not sure what a redundant linter could achieve here?
ACK
fa3da29147, with a few optional suggestions to simplify the validation and tests.nit: I think we can make the concept arg a callable, which would let us inline the strings:
Inline the format strings as callables
This seems a bit hacky to me. Adding a boolean on the general
ConstevalFormatStringleaks the newline check into tinyformat and index code. Please consider moving the validation intoutil::log::FormatStringinstead, where trailing newlines are already rejected.Keep the newline check in logging
nit: Ralph may be right (but even if not),
GetNewPrefixCursorcan probably reach the wallet log - if you push again, consider dropping the suffix from both cursor setup errors tooRemove the cursor error newlines
@maflcko do you want to take l0rinc's nits?
Rebased (for the scripted-diff), and pushed the nits, which seemed nice and hopefully make Ralph Review happy.
heh, nice code-golf. Pushed.
Yeah, I guess formatting itself shouldn't care about newlines and this is log specific. Pushed your diff and added you as co-author.
Hmm, if this is changed, it should be changed for all strings all at once. Pushed a commit to do this.
ACK
fa0c552cc5Reviewed the diff and re-reviewed the commits manually, verified the scripted diff, and ran the tests locally.
nit: based on other cases, this was probably meant to end with an ellipsis - if you touch this again:
ACK
fa0c552cc5This is low prio, but it does improve something that has been annoying me. Looks like there are fewer conflicts than before, and it only seems to invalidate single ack at the moment, so I'm putting this in now. I don't think there will be an ideal moment for this.
Same. To clarify why I never addressed this for years, but created this pull now: After #35833, there now also a bunch of logging bugs with embedded \x0a in the log lines, like this (from running
feature_filelock.pyon previous master)This is harmless, but looks a bit like corrupt logs, so it would be good to fix, which this pull did.
There are still a few follow-ups and I'll try to fan them out over time.
Post-merge reACK
fa0c552cc5