docs: add pruning related documentation for db service (#9711)

This commit is contained in:
Dan Cline
2024-07-22 13:41:37 -04:00
committed by GitHub
parent 3ed132eee3
commit 5c30227d33
2 changed files with 25 additions and 1 deletions

View File

@@ -39,7 +39,10 @@ pub struct DatabaseService<DB> {
}
impl<DB: Database> DatabaseService<DB> {
/// Create a new database service
/// Create a new database service.
///
/// NOTE: The [`ProviderFactory`] and [`Pruner`] should be built using an identical
/// [`PruneModes`](reth_prune::PruneModes).
pub const fn new(
provider: ProviderFactory<DB>,
incoming: Receiver<DatabaseAction>,

View File

@@ -3142,6 +3142,27 @@ impl<DB: Database> BlockExecutionWriter for DatabaseProviderRW<DB> {
}
impl<DB: Database> BlockWriter for DatabaseProviderRW<DB> {
/// Inserts the block into the database, always modifying the following tables:
/// * [`CanonicalHeaders`](tables::CanonicalHeaders)
/// * [`Headers`](tables::Headers)
/// * [`HeaderNumbers`](tables::HeaderNumbers)
/// * [`HeaderTerminalDifficulties`](tables::HeaderTerminalDifficulties)
/// * [`BlockBodyIndices`](tables::BlockBodyIndices)
///
/// If there are transactions in the block, the following tables will be modified:
/// * [`Transactions`](tables::Transactions)
/// * [`TransactionBlocks`](tables::TransactionBlocks)
///
/// If ommers are not empty, this will modify [`BlockOmmers`](tables::BlockOmmers).
/// If withdrawals are not empty, this will modify
/// [`BlockWithdrawals`](tables::BlockWithdrawals).
/// If requests are not empty, this will modify [`BlockRequests`](tables::BlockRequests).
///
/// If the provider has __not__ configured full sender pruning, this will modify
/// [`TransactionSenders`](tables::TransactionSenders).
///
/// If the provider has __not__ configured full transaction lookup pruning, this will modify
/// [`TransactionHashNumbers`](tables::TransactionHashNumbers).
fn insert_block(
&self,
block: SealedBlockWithSenders,