GetVersion()
, replace uses of CAutoFile
with AutoFile
.
GetVersion()
, replace uses of CAutoFile
with AutoFile
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | maflcko, TheCharlatan, stickies-v |
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.
29@@ -30,7 +30,6 @@
30 #include <vector>
31
32 class BlockValidationState;
33-class CAutoFile;
dbwrapper
having the include. iwyu used to be happy with a fwd decl, so maybe just keep it as-is?
I don’t think you’re missing anything; but I don’t really see the point of including a fwd declaration when that’s not enough to be able to use the function, especially when the full header’s already included indirectly? The tidy job says:
0+#include "flatfile.h"
1+#include "streams.h"
2+#include "uint256.h"
which seems reasonable to me? When I run iwyu locally, it also seems to suggest primitives/block.h (rather than class CBlock
), which is already included via chain.h anyway, so seems fine.
I’ve just pushed an update that gets closer to what iwyu suggests.
The tidy job says:
For reference, on master it doesn’t say that. See for example https://cirrus-ci.com/task/5754375344226304 (https://api.cirrus-ci.com/v1/task/5754375344226304/logs/ci.log):
0The full include-list for node/blockstorage.h:
1#include <attributes.h> // for LIFETIMEBOUND
2#include <chain.h> // for CBlockFileInfo, CBlockIndex
3#include <dbwrapper.h> // for CDBWrapper
4#include <kernel/blockmanager_opts.h> // for BlockManagerOpts
5#include <kernel/chainparams.h> // for CChainParams
6#include <kernel/cs_main.h> // for cs_main
7#include <kernel/messagestartchars.h> // for MessageStartChars
8#include <stddef.h> // for size_t
9#include <sync.h> // for EXCLUSIVE_LOCKS_REQUIRED, GUARDED_BY, RecursiveMutex
10#include <util/fs.h> // for path
11#include <util/hasher.h> // for BlockHasher
12#include <algorithm> // for max
13#include <array> // for array, tuple_size_v
14#include <atomic> // for atomic, atomic_bool
15#include <cstdint> // for uint64_t, uint8_t
16#include <functional> // for function
17#include <iosfwd> // for ostream
18#include <limits> // for numeric_limits
19#include <map> // for multimap
20#include <memory> // for unique_ptr
21#include <optional> // for optional, nullopt
22#include <set> // for set
23#include <string> // for string, hash
24#include <unordered_map> // for unordered_map
25#include <utility> // for move, pair
26#include <vector> // for vector
27#include "flatfile.h" // for FlatFilePos (ptr only), FlatFileSeq
28#include "uint256.h" // for uint256, operator==
29class BlockValidationState; // lines 32-32
30class CAutoFile; // lines 33-33
31class CBlock; // lines 34-34
32class CBlockHeader;
33class CBlockUndo; // lines 35-35
34class Chainstate; // lines 37-37
35class ChainstateManager; // lines 38-38
36namespace Consensus { struct Params; } // lines 42-42
37namespace util { class SignalInterrupt; } // lines 45-45
Anyway, it is just a style nit and anything that compiles should be fine here.
54@@ -55,7 +55,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench)
55 bench.run([&] {
56 // "rb" is "binary, O_RDONLY", positioned to the start of the file.
57 // The file will be closed by LoadExternalBlockFile().
58- CAutoFile file{fsbridge::fopen(blkfile, "rb"), CLIENT_VERSION};
59+ AutoFile file{fsbridge::fopen(blkfile, "rb")};
60 testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
Nice
ACK 6b70cf77b5beda5bd25246aefed2633410d4126f 🚾
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: ACK 6b70cf77b5beda5bd25246aefed2633410d4126f 🚾
39vtH9miHsZeyTpMvrJOhEJfjd/q6MlP9nJvViqeqkdhzvUvH5m1DR9I/+rVIopqsS4/EIsnuNZognM5WPJ0ODw==
Also bump includes per suggestions from iwyu.
re-ACK 4eb2a9ea4b6262bec0bc7c20cb3e684ea75caf42 🖼
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: re-ACK 4eb2a9ea4b6262bec0bc7c20cb3e684ea75caf42 🖼
3ANC6hAaguhTkX0Yz+0EjG+ghzH3/DQZEXpJT5Nr6Ld8sHHSeLVAxdgc2S+cEUYIPfS4uqwL1HOY2fFVWlwKUDw==
CAutoFile
-> AutoFile
. I did check that tests pass for all intermediate commits.
Looks like a nice cleanup, but I’m not familiar with the history of
CAutoFile
->AutoFile
.
serialization flags embedded in the version-integer and type-integer are gone, serialization now uses params-serialization, so the ser-version and ser-type code can be deleted.