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:
#29538 (refactor: Improve naming of CBlock::GetHash() -> GetHeaderHash() by fjahr)
#29158 (PoC: fuzz chainstate and block managers by darosior)
#28955 (index: block filters sync, reduce disk read operations by caching last header by furszy)
#28945 (sync: improve CCoinsViewCache ReallocateCache by martinus)
#27006 (reduce cs_main scope, guard block index ’nFile’ under a local mutex by furszy)
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
Utils/log/libs
on Jan 11, 2024
jamesob
commented at 8:05 pm on January 11, 2024:
contributor
Big Concept ACK. error() confuses me basically every time I run into it.
DrahtBot added the label
CI failed
on Jan 11, 2024
maflcko force-pushed
on Jan 12, 2024
DrahtBot removed the label
CI failed
on Jan 12, 2024
DrahtBot added the label
CI failed
on Jan 15, 2024
maflcko force-pushed
on Jan 15, 2024
DrahtBot removed the label
CI failed
on Jan 15, 2024
in
src/addrdb.cpp:68
in
fa7658b8d1outdated
60@@ -60,7 +61,8 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
61 if (fileout.IsNull()) {
62 fileout.fclose();
63 remove(pathTmp);
64- return error("%s: Failed to open file %s", __func__, fs::PathToString(pathTmp));
65+ LogError("%s: Failed to open file %s\n", __func__, fs::PathToString(pathTmp));
stickies-v
commented at 1:13 pm on January 16, 2024:
nit: it seems the return value from SerializeFileDB is never used to actually shut down the node. In the case of failing to open file, I think LogError is appropriate because that probably should lead to a shutdown. In the case of “Failed to flush file”, I think a LogWarning could be more appropriate.
I think it’s best to leave the PR as is to make progress, bikeshedding over warning vs error categories doesn’t have a huge amount of benefit here. Just leaving this comment for visibility.
maflcko
commented at 2:43 pm on February 13, 2024:
Yeah, but “error” is still applicable within the addrdb functions, as they can not continue and must return. So I think, ideally they’d return Result<void>, and the caller could downgrade the error to a warning and log it? Happy to review such a change, if someone creates it.
stickies-v
commented at 1:14 pm on January 16, 2024:
contributor
epiccurious
commented at 4:07 pm on February 11, 2024:
nit - Noticed this when reviewing the changes. Since we’re already changing the file - should Line 357/358 be a LogError not a LogPrintf?
maflcko
commented at 2:55 pm on February 13, 2024:
If there are changes to other log lines, I’d say it would be best to do them in a separate pull request. The goal here is to be as close to a refactor as possible.
in
src/netbase.cpp:422
in
fa1d4f07c3outdated
419+ LogError("Proxy failed to accept request\n");
420+ return false;
421 }
422 if (pchRet2[1] != SOCKS5Reply::SUCCEEDED) {
423 // Failures to connect to a peer that are not proxy errors
424 LogPrintf("Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
epiccurious
commented at 4:22 pm on February 11, 2024:
nit - Also noticed this when reviewing the changes. Since we’re already changing the file - should Line 413/422 be a LogError not a LogPrintf?
maflcko
commented at 2:45 pm on February 13, 2024:
Why? This line is a failure to connect to a peer and the above are proxy errors. So keeping this as-is makes most sense. In any case, if there is a reason to change something unrelated in other lines, a separate pull request would be ideal.
epiccurious approved
epiccurious
commented at 4:23 pm on February 11, 2024:
contributor
utACKfa1d4f07c36dda3c72fb328918bddd7de062ef96.
DrahtBot requested review from stickies-v
on Feb 11, 2024
DrahtBot requested review from jamesob
on Feb 11, 2024
epiccurious
commented at 10:16 pm on February 11, 2024:
contributor
0Options used to compile and link:
1 external signer = yes
2 multiprocess = no
3 with libs = yes
4 with wallet = yes
5 with sqlite = yes
6 with bdb = yes
7 with gui / qt = yes
8 with qr = yes
9 with zmq = yes
10 with test = yes
11 with fuzz binary = yes
12 with bench = yes
13 with upnp = no
14 with natpmp = no
15 use asm = yes
16 USDT tracing = no
17 sanitizers =
18 debug enabled = no
19 gprof enabled = yes
20 werror = yes
Passed test/functional/test_runner.py --extended. Please let me know if any of these skipped tests are relevant.
0feature_bind_port_discover.py | ○ Skipped | 0 s
1feature_bind_port_externalip.py | ○ Skipped | 1 s
2feature_unsupported_utxo_db.py | ○ Skipped | 0 s
3interface_usdt_coinselection.py | ○ Skipped | 0 s
4interface_usdt_mempool.py | ○ Skipped | 0 s
5interface_usdt_net.py | ○ Skipped | 1 s
6interface_usdt_utxocache.py | ○ Skipped | 0 s
7interface_usdt_validation.py | ○ Skipped | 1 s
8mempool_compatibility.py | ○ Skipped | 0 s
9wallet_backwards_compatibility.py --descriptors | ○ Skipped | 1 s
10wallet_backwards_compatibility.py --legacy-wallet | ○ Skipped | 0 s
11wallet_inactive_hdchains.py --legacy-wallet | ○ Skipped | 0 s
12wallet_upgradewallet.py --legacy-wallet | ○ Skipped | 0 s
1314ALL | ✓ Passed | 6598 s (accumulated)
stickies-v approved
stickies-v
commented at 7:25 am on February 15, 2024:
contributor
ACKfa1d4f07c36dda3c72fb328918bddd7de062ef96
ryanofsky approved
ryanofsky
commented at 3:17 pm on February 15, 2024:
contributor
This is a nice improvement, and it actually doesn’t change many lines of code, so I don’t think we should be worried about conflicts if we want to make more improvements later, like changing log levels, or adding categories, or switching to util::Result.
One thing I think we probably should revisit after this is the interaction with -logsourcelocations, since it seems like a lot (maybe most?) of the new LogError calls are manually adding “%s: “, __func__ prefixes to the log, which shows the function name in a different format than -logsourcelocations, and also includes the function name twice if -logsourcelocations is enabled. A way to improve this might be to add an option to LogError to make it log the source location even if -logsourcelocations is not turned on. Or maybe it would be better if the error messages were more descriptive and didn’t rely on the function names to provide context.
fjahr
commented at 5:48 pm on February 18, 2024:
contributor
This is needed for the next commit.
-BEGIN VERIFY SCRIPT-
# Separate sed invocations to replace one-line, and two-line error(...) calls
sed -i --regexp-extended 's!( +)return (error\(.*\);)!\1\2\n\1return false;!g' $( git grep -l 'return error(' )
sed -i --null-data --regexp-extended 's!( +)return (error\([^\n]*\n[^\n]*\);)!\1\2\n\1return false;!g' $( git grep -l 'return error(' )
-END VERIFY SCRIPT-
fa1d624348
refactor: Make error() return type void
This is needed for the next commit to compile.
fa808fb749
scripted-diff: Replace error() with LogError()
This fixes the log output when -logsourcelocations is used.
Also, instead of 'ERROR:', the log will now say '[error]', like other
errors logged with LogError.
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended 's! error\("([^"]+)"! LogError("\1\\n"!g' $( git grep -l ' error(' ./src/ )
-END VERIFY SCRIPT-
fad0335517
refactor: Remove unused error()fa39151394
maflcko force-pushed
on Mar 11, 2024
maflcko
commented at 1:14 pm on March 11, 2024:
member
rebased.
Should be trivial to re-ACK, as no lines touched by this are affected (only one tangent line)
fjahr
commented at 1:35 pm on March 11, 2024:
contributor
re-utACKfa391513949b7a3b56321436e2015c7e9e6dac2b
Based on git range-diff master fa1d4f07c36dda3c72fb328918bddd7de062ef96 fa391513949b7a3b56321436e2015c7e9e6dac2b.
DrahtBot requested review from epiccurious
on Mar 11, 2024
DrahtBot requested review from Empact
on Mar 11, 2024
DrahtBot requested review from stickies-v
on Mar 11, 2024
DrahtBot requested review from ryanofsky
on Mar 11, 2024
stickies-v
commented at 1:47 pm on March 11, 2024:
contributor
re-ACKfa391513949b7a3b56321436e2015c7e9e6dac2b, no changes since 4a903741b0
DrahtBot removed review request from stickies-v
on Mar 11, 2024
DrahtBot removed review request from epiccurious
on Mar 11, 2024
DrahtBot requested review from epiccurious
on Mar 11, 2024
DrahtBot removed the label
Needs rebase
on Mar 11, 2024
ryanofsky
commented at 3:38 pm on March 11, 2024:
contributor
Code review ACKfa391513949b7a3b56321436e2015c7e9e6dac2b. Just rebase since last review
fanquake merged this
on Mar 12, 2024
fanquake closed this
on Mar 12, 2024
maflcko deleted the branch
on Mar 12, 2024
fanquake referenced this in commit
1105aa46dd
on Mar 12, 2024
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: 2025-05-06 21:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me