From 0d523dd49dd0f74ffadf130a4c957ac5875a96db Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 13 Dec 2024 19:53:25 +0700 Subject: [PATCH] perf(history_by_block_hash): reuse provider instead of creaeting two --- crates/storage/provider/src/providers/database/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index 0241c432019d..ce7846ec4688 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -203,7 +203,7 @@ impl ProviderFactory { .block_number(block_hash)? .ok_or(ProviderError::BlockHashNotFound(block_hash))?; - let state_provider = self.provider()?.try_into_history_at_block(block_number)?; + let state_provider = provider.try_into_history_at_block(block_number)?; trace!(target: "providers::db", ?block_number, %block_hash, "Returning historical state provider for block hash"); Ok(state_provider) }