The background is I’m trying to measure the performance of connecting real blocks when the needed inputs are not in memory. My first idea is to get some blk*****.dat files with -stopatheight and then use -stopafterblockimport and -loadblock to load these blk files (ConnectBlock() will run when doing this) to see the performance. But I found the blk*****.dat files can not be recognized by the code.
Though I now found an alternative way VerifyDB() can be leveraged to achieve my goal. I’d like still to put the above issue here.
The bitcoin core code I use is at HEAD 6ca6f3b37b Merge bitcoin/bitcoin#33241: Update libmultiprocess subtree to fix build issues
Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
- I first run bitcoind -prune=1024 -stopatheight=840000 -datadir=empty_dir, then there is some block files in empty_dir/blocks.
- Then I copy empty_dir to empty_dir2, run bitcoind -prune=1024 -stopatheight=840050 -datadir=empty_dir2 Compare two blocks dir, I now have some blk.dat files relects height 840000 to 840050.
- At last I copy empty_dir to empty_dir3, and run bitcoind -datadir=empty_dir3 -assumevalid=0 -prune=10240 -stopafterblockimport -networkactive=0 -noconnect -listen=0 -dnsseed=0 -dns=0 -loadblock=blk04241.dat …… -loadblock=blk04252.dat, the result shows it finds 0 blocks from those files, and I did some test, I found the reason is those files don’t have the main Magic bytes f9beb4d9
Anything wrong?
Expected behaviour
the blocks from height 840001 to 840050 are loaded from those blk files and connected to the chain.
Steps to reproduce
see above
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
master
Operating system and version
ubuntu22.04 LTS
Machine specifications
No response