Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a database transaction per ProofBlindedProviderFactory #14203

Open
Tracked by #11169
shekhirin opened this issue Feb 4, 2025 · 0 comments
Open
Tracked by #11169

Create a database transaction per ProofBlindedProviderFactory #14203

shekhirin opened this issue Feb 4, 2025 · 0 comments
Labels
A-trie Related to Merkle Patricia Trie implementation C-bug An unexpected or incorrect behavior

Comments

@shekhirin
Copy link
Collaborator

shekhirin commented Feb 4, 2025

Problem

We're seeing a bunch of Transaction lock is already acquired, blocking... errors coming from the State Root Task, because we create only one ProofBlindedProviderFactory that's being re-used across the accounts sparse trie, as well as all storage spars tries

let blinded_provider_factory = ProofBlindedProviderFactory::new(
in_memory_trie_cursor.clone(),
HashedPostStateCursorFactory::new(
DatabaseHashedCursorFactory::new(provider_ro.tx_ref()),
&config.state_sorted,
),
config.prefix_sets.clone(),
);

Because we calculate storage trie roots in parallel, it's possible for two calls to the blinded provider factory use the same transaction, which causes that log and a bit of wait on the lock

storage_trie.root();

Solution

We should initialize a transaction per ProofBlindedProviderFactory, so that they're not re-used across different storage tries.

@shekhirin shekhirin added C-bug An unexpected or incorrect behavior A-trie Related to Merkle Patricia Trie implementation labels Feb 4, 2025
@shekhirin shekhirin changed the title Create a database transaction perProofBlindedProviderFactory Create a database transaction per ProofBlindedProviderFactory Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-bug An unexpected or incorrect behavior
Projects
Status: Todo
Development

No branches or pull requests

1 participant