mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
validate-block: Fix TrieCache implementation (#2214)
The trie cache implementation was ignoring the `storage_root` when setting up the value cache. The problem with this is that the value cache works using `storage_keys` and these keys are not unique across different tries. A block can actually have different tries (main trie and multiple child tries). This pull request fixes the issue by not ignoring the `storage_root` and returning an unique `value_cache` per `storage_root`. It also adds a test for the seen bug and improves documentation that this doesn't happen again.
This commit is contained in:
@@ -20,9 +20,11 @@
|
||||
use sc_client_api::{backend::Finalizer, client::BlockBackend};
|
||||
use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
|
||||
use sc_service::client::Client;
|
||||
use sp_consensus::{BlockOrigin, Error as ConsensusError};
|
||||
use sp_consensus::Error as ConsensusError;
|
||||
use sp_runtime::{traits::Block as BlockT, Justification, Justifications};
|
||||
|
||||
pub use sp_consensus::BlockOrigin;
|
||||
|
||||
/// Extension trait for a test client.
|
||||
pub trait ClientExt<Block: BlockT>: Sized {
|
||||
/// Finalize a block.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
pub mod client_ext;
|
||||
|
||||
pub use self::client_ext::{ClientBlockImportExt, ClientExt};
|
||||
pub use self::client_ext::{BlockOrigin, ClientBlockImportExt, ClientExt};
|
||||
pub use sc_client_api::{execution_extensions::ExecutionExtensions, BadBlocks, ForkBlocks};
|
||||
pub use sc_client_db::{self, Backend, BlocksPruning};
|
||||
pub use sc_executor::{self, NativeElseWasmExecutor, WasmExecutionMethod, WasmExecutor};
|
||||
|
||||
Reference in New Issue
Block a user