If blocks are stored in the node's data directory but no, or incomplete, archival databases are present, then the archival databases should be built from the block data. This is a check, or task, that could be performed on startup. Potentially only when a specific CLI flag is set.
We already have ArchivalState::blocks_from_file_without_record to parse blocks directly from raw block data (blk<n>.dat files) that we use when we import blocks from directory with the import_blocks_from_directory CLI argument.
Given that you have all block data (for example from a downloaded torrent), this would be a much faster way to build the state of the node since the current import_blocks_from_directory writes all blocks to disk even though they already exist on disk, in the source directory.
If blocks are stored in the node's data directory but no, or incomplete, archival databases are present, then the archival databases should be built from the block data. This is a check, or task, that could be performed on startup. Potentially only when a specific CLI flag is set.
We already have
ArchivalState::blocks_from_file_without_recordto parse blocks directly from raw block data (blk<n>.datfiles) that we use when we import blocks from directory with theimport_blocks_from_directoryCLI argument.Given that you have all block data (for example from a downloaded torrent), this would be a much faster way to build the state of the node since the current
import_blocks_from_directorywrites all blocks to disk even though they already exist on disk, in the source directory.