Skip to content

Commit 7922edf

Browse files
authored
feat(storage): log storage settings on startup (#19931)
1 parent 93d81ed commit 7922edf

File tree

2 files changed

+25
-2
lines changed
  • crates
    • node/builder/src/launch
    • storage/provider/src/providers/database

2 files changed

+25
-2
lines changed

crates/node/builder/src/launch/engine.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ use reth_node_core::{
3131
use reth_node_events::node;
3232
use reth_provider::{
3333
providers::{BlockchainProvider, NodeTypesForProvider},
34-
BlockNumReader,
34+
BlockNumReader, MetadataProvider,
3535
};
3636
use reth_tasks::TaskExecutor;
3737
use reth_tokio_util::EventSender;
3838
use reth_tracing::tracing::{debug, error, info};
3939
use std::{future::Future, pin::Pin, sync::Arc};
4040
use tokio::sync::{mpsc::unbounded_channel, oneshot};
4141
use tokio_stream::wrappers::UnboundedReceiverStream;
42+
use tracing::warn;
4243

4344
/// The engine node launcher.
4445
#[derive(Debug)]
@@ -98,8 +99,24 @@ impl EngineNodeLauncher {
9899
.with_adjusted_configs()
99100
// Create the provider factory
100101
.with_provider_factory::<_, <CB::Components as NodeComponents<T>>::Evm>().await?
101-
.inspect(|_| {
102+
.inspect(|ctx| {
102103
info!(target: "reth::cli", "Database opened");
104+
match ctx.provider_factory().storage_settings() {
105+
Ok(settings) => {
106+
info!(
107+
target: "reth::cli",
108+
?settings,
109+
"Storage settings"
110+
);
111+
},
112+
Err(err) => {
113+
warn!(
114+
target: "reth::cli",
115+
?err,
116+
"Failed to get storage settings"
117+
);
118+
},
119+
}
103120
})
104121
.with_prometheus_server().await?
105122
.inspect(|this| {

crates/storage/provider/src/providers/database/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,12 @@ impl<N: ProviderNodeTypes> HashedPostStateProvider for ProviderFactory<N> {
584584
}
585585
}
586586

587+
impl<N: ProviderNodeTypes> MetadataProvider for ProviderFactory<N> {
588+
fn get_metadata(&self, key: &str) -> ProviderResult<Option<Vec<u8>>> {
589+
self.provider()?.get_metadata(key)
590+
}
591+
}
592+
587593
impl<N> fmt::Debug for ProviderFactory<N>
588594
where
589595
N: NodeTypesWithDB<DB: fmt::Debug, ChainSpec: fmt::Debug, Storage: fmt::Debug>,

0 commit comments

Comments
 (0)