StorageLocation::Database is a default for insert_block and only writes transactions to database, used by legacy engine and components which need to operate on database without ever commiting anything (like debugging CLI commands)
StorageLocation::Both writes to both database and staticfiles, used by new engine right now.
StorageLocation::StaticFiles only writes transactions to staticfiles, used by BodyStage. Should be used by new engine as well eventually.
Same can be done with headers and receipts as well
This required a drive-by change of making SealedBlockWithSenders generic over header and body like SealedBlock
Updates
UnifiedStorageWriter
to reuse code paths fromBodyStage
for blocks writing. This is done by extendingBlockWriter
methods with an additionalwrite_transactions_to
parameter: https://github.com/paradigmxyz/reth/blob/b8980e5982e1d16adadee00230c090f39d8076be/crates/storage/provider/src/traits/block.rs#L67-L71 https://github.com/paradigmxyz/reth/blob/b8980e5982e1d16adadee00230c090f39d8076be/crates/storage/provider/src/traits/block.rs#L10-L19StorageLocation::Database
is a default forinsert_block
and only writes transactions to database, used by legacy engine and components which need to operate on database without ever commiting anything (like debugging CLI commands)StorageLocation::Both
writes to both database and staticfiles, used by new engine right now.StorageLocation::StaticFiles
only writes transactions to staticfiles, used byBodyStage
. Should be used by new engine as well eventually.Same can be done with headers and receipts as well
This required a drive-by change of making
SealedBlockWithSenders
generic over header and body likeSealedBlock