feat(storage, blockchain-tree): disable backtrace on long read tx when it's safe (#6177)

This commit is contained in:
Alexey Shekhirin
2024-01-23 13:44:01 +00:00
committed by GitHub
parent a6f8e449f7
commit 1e4d125616
6 changed files with 38 additions and 3 deletions

View File

@ -1174,7 +1174,13 @@ impl<DB: Database, EF: ExecutorFactory> BlockchainTree<DB, EF> {
}
None => {
debug!(target: "blockchain_tree", blocks = ?block_hash_numbers, "Recomputing state root for insert");
let provider = self.externals.provider_factory.provider()?;
let provider = self
.externals
.provider_factory
.provider()?
// State root calculation can take a while, and we're sure no write transaction
// will be open in parallel. See https://github.com/paradigmxyz/reth/issues/6168.
.disable_backtrace_on_long_read_transaction();
let (state_root, trie_updates) = hashed_state
.state_root_with_updates(provider.tx_ref())
.map_err(Into::<DatabaseError>::into)?;