chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
+13 -9
View File
@@ -28,7 +28,6 @@ use crate::{
use futures::{select, FutureExt, StreamExt};
use jsonrpsee::RpcModule;
use log::{debug, error, info};
use prometheus_endpoint::Registry;
use pezsc_chain_spec::{get_extension, ChainSpec};
use pezsc_client_api::{
execution_extensions::ExecutionExtensions, proof_provider::ProofProvider, BadBlocks,
@@ -38,8 +37,8 @@ use pezsc_client_api::{
use pezsc_client_db::{Backend, BlocksPruning, DatabaseSettings, PruningMode};
use pezsc_consensus::import_queue::{ImportQueue, ImportQueueService};
use pezsc_executor::{
pezsp_wasm_interface::HostFunctions, HeapAllocStrategy, NativeExecutionDispatch, RuntimeVersionOf,
WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
pezsp_wasm_interface::HostFunctions, HeapAllocStrategy, NativeExecutionDispatch,
RuntimeVersionOf, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
};
use pezsc_keystore::LocalKeystore;
use pezsc_network::{
@@ -93,6 +92,7 @@ use pezsp_core::traits::{CodeExecutor, SpawnNamed};
use pezsp_keystore::KeystorePtr;
use pezsp_runtime::traits::{Block as BlockT, BlockIdTo, NumberFor, Zero};
use pezsp_storage::{ChildInfo, ChildType, PrefixedStorageKey};
use prometheus_endpoint::Registry;
use std::{
str::FromStr,
sync::Arc,
@@ -357,7 +357,9 @@ pub fn new_native_or_wasm_executor<D: NativeExecutionDispatch>(
config: &Configuration,
) -> pezsc_executor::NativeElseWasmExecutor<D> {
#[allow(deprecated)]
pezsc_executor::NativeElseWasmExecutor::new_with_wasm_executor(new_wasm_executor(&config.executor))
pezsc_executor::NativeElseWasmExecutor::new_with_wasm_executor(new_wasm_executor(
&config.executor,
))
}
/// Creates a [`WasmExecutor`] according to [`ExecutorConfiguration`].
@@ -501,10 +503,11 @@ where
+ CallApiAt<TBl>
+ Send
+ 'static,
<TCl as ProvideRuntimeApi<TBl>>::Api: pezsp_api::Metadata<TBl>
+ pezsp_transaction_pool::runtime_api::TaggedTransactionQueue<TBl>
+ pezsp_session::SessionKeys<TBl>
+ pezsp_api::ApiExt<TBl>,
<TCl as ProvideRuntimeApi<TBl>>::Api:
pezsp_api::Metadata<TBl>
+ pezsp_transaction_pool::runtime_api::TaggedTransactionQueue<TBl>
+ pezsp_session::SessionKeys<TBl>
+ pezsp_api::ApiExt<TBl>,
TBl: BlockT,
TBl::Hash: Unpin,
TBl::Header: Unpin,
@@ -823,7 +826,8 @@ where
+ Sync
+ 'static,
TBackend: pezsc_client_api::backend::Backend<TBl> + 'static,
<TCl as ProvideRuntimeApi<TBl>>::Api: pezsp_session::SessionKeys<TBl> + pezsp_api::Metadata<TBl>,
<TCl as ProvideRuntimeApi<TBl>>::Api:
pezsp_session::SessionKeys<TBl> + pezsp_api::Metadata<TBl>,
TExPool: MaintainedTransactionPool<Block = TBl, Hash = <TBl as BlockT>::Hash> + 'static,
TBl::Hash: Unpin,
TBl::Header: Unpin,
@@ -18,7 +18,9 @@
use crate::error::Error;
use pezsc_client_api::{StorageProvider, UsageProvider};
use pezsp_core::storage::{well_known_keys, ChildInfo, Storage, StorageChild, StorageKey, StorageMap};
use pezsp_core::storage::{
well_known_keys, ChildInfo, Storage, StorageChild, StorageKey, StorageMap,
};
use pezsp_runtime::traits::Block as BlockT;
use std::{
@@ -26,7 +26,6 @@ use pezsc_client_api::HeaderBackend;
use pezsc_consensus::import_queue::{
BlockImportError, BlockImportStatus, ImportQueue, IncomingBlock, Link,
};
use serde_json::{de::IoRead as JsonIoRead, Deserializer, StreamDeserializer};
use pezsp_consensus::BlockOrigin;
use pezsp_runtime::{
generic::SignedBlock,
@@ -34,6 +33,7 @@ use pezsp_runtime::{
Block as BlockT, CheckedDiv, Header, MaybeSerializeDeserialize, NumberFor, Saturating, Zero,
},
};
use serde_json::{de::IoRead as JsonIoRead, Deserializer, StreamDeserializer};
use std::{
io::Read,
pin::Pin,
@@ -105,8 +105,9 @@ where
let state = self.backend.state_at(at_hash, context.into())?;
let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state);
let runtime_code =
state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = state_runtime_code
.runtime_code()
.map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0;
@@ -146,8 +147,9 @@ where
// make sure we use the caching layers.
let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state);
let runtime_code =
state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = state_runtime_code
.runtime_code()
.map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0;
let mut extensions = extensions.borrow_mut();
@@ -194,8 +196,9 @@ where
let state = self.backend.state_at(at_hash, backend::TrieCacheContext::Untrusted)?;
let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state);
let runtime_code =
state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = state_runtime_code
.runtime_code()
.map_err(pezsp_blockchain::Error::RuntimeCode)?;
self.code_provider
.maybe_override_code(runtime_code, &state, at_hash)
.map(|(_, v)| v)
@@ -213,9 +216,11 @@ where
let trie_backend = state.as_trie_backend();
let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(trie_backend);
let runtime_code =
state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?;
let state_runtime_code =
pezsp_state_machine::backend::BackendRuntimeCode::new(trie_backend);
let runtime_code = state_runtime_code
.runtime_code()
.map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = self.code_provider.maybe_override_code(runtime_code, &state, at_hash)?.0;
pezsp_state_machine::prove_execution_on_trie_backend(
+26 -10
View File
@@ -25,8 +25,6 @@ use super::{
use crate::client::notification_pinning::NotificationPinningWorker;
use log::{debug, info, trace, warn};
use parking_lot::{Mutex, RwLock};
use prometheus_endpoint::Registry;
use rand::Rng;
use pezsc_chain_spec::{resolve_state_version_from_wasm, BuildGenesisBlock};
use pezsc_client_api::{
backend::{
@@ -57,6 +55,8 @@ use pezsp_blockchain::{
HeaderBackend as ChainHeaderBackend, HeaderMetadata, Info as BlockchainInfo,
};
use pezsp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError};
use prometheus_endpoint::Registry;
use rand::Rng;
use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender};
use pezsp_core::{
@@ -450,7 +450,10 @@ where
}
/// Get the RuntimeVersion at a given block.
pub fn runtime_version_at(&self, hash: Block::Hash) -> pezsp_blockchain::Result<RuntimeVersion> {
pub fn runtime_version_at(
&self,
hash: Block::Hash,
) -> pezsp_blockchain::Result<RuntimeVersion> {
CallExecutor::runtime_version(&self.executor, hash)
}
@@ -694,8 +697,11 @@ where
};
let tree_route = if is_new_best && info.best_hash != parent_hash && parent_exists {
let route_from_best =
pezsp_blockchain::tree_route(self.backend.blockchain(), info.best_hash, parent_hash)?;
let route_from_best = pezsp_blockchain::tree_route(
self.backend.blockchain(),
info.best_hash,
parent_hash,
)?;
Some(route_from_best)
} else {
None
@@ -1320,8 +1326,9 @@ where
total_size += size;
if current_child.is_none() &&
pezsp_core::storage::well_known_keys::is_child_storage_key(next_key.as_slice()) &&
!child_roots.contains(value.as_slice())
pezsp_core::storage::well_known_keys::is_child_storage_key(
next_key.as_slice(),
) && !child_roots.contains(value.as_slice())
{
child_roots.insert(value.clone());
switch_child_key = Some((next_key.clone(), value.clone()));
@@ -1955,11 +1962,17 @@ where
Client::block_status(self, hash)
}
fn justifications(&self, hash: Block::Hash) -> pezsp_blockchain::Result<Option<Justifications>> {
fn justifications(
&self,
hash: Block::Hash,
) -> pezsp_blockchain::Result<Option<Justifications>> {
self.backend.blockchain().justifications(hash)
}
fn block_hash(&self, number: NumberFor<Block>) -> pezsp_blockchain::Result<Option<Block::Hash>> {
fn block_hash(
&self,
number: NumberFor<Block>,
) -> pezsp_blockchain::Result<Option<Block::Hash>> {
self.backend.blockchain().hash(number)
}
@@ -1971,7 +1984,10 @@ where
self.backend.blockchain().has_indexed_transaction(hash)
}
fn block_indexed_body(&self, hash: Block::Hash) -> pezsp_blockchain::Result<Option<Vec<Vec<u8>>>> {
fn block_indexed_body(
&self,
hash: Block::Hash,
) -> pezsp_blockchain::Result<Option<Vec<Vec<u8>>>> {
self.backend.blockchain().block_indexed_body(hash)
}
@@ -78,12 +78,16 @@ where
/// Returns the `:code` for the given `block`.
///
/// This takes into account potential overrides/substitutes.
pub fn code_at_ignoring_overrides(&self, block: Block::Hash) -> pezsp_blockchain::Result<Vec<u8>> {
pub fn code_at_ignoring_overrides(
&self,
block: Block::Hash,
) -> pezsp_blockchain::Result<Vec<u8>> {
let state = self.backend.state_at(block, TrieCacheContext::Untrusted)?;
let state_runtime_code = pezsp_state_machine::backend::BackendRuntimeCode::new(&state);
let runtime_code =
state_runtime_code.runtime_code().map_err(pezsp_blockchain::Error::RuntimeCode)?;
let runtime_code = state_runtime_code
.runtime_code()
.map_err(pezsp_blockchain::Error::RuntimeCode)?;
self.maybe_override_code_internal(runtime_code, &state, block, true)
.and_then(|r| {
@@ -167,6 +171,7 @@ where
mod tests {
use super::*;
use backend::Backend;
use bizinikiwi_test_runtime_client::{runtime, GenesisInit};
use pezsc_client_api::{in_mem, HeaderBackend};
use pezsc_executor::WasmExecutor;
use pezsp_core::{
@@ -174,7 +179,6 @@ mod tests {
traits::{FetchRuntimeCode, WrappedRuntimeCode},
};
use std::collections::HashMap;
use bizinikiwi_test_runtime_client::{runtime, GenesisInit};
#[test]
fn no_override_no_substitutes_work() {
@@ -21,8 +21,8 @@
//! This file contains a worker that should be started when a new client instance is created.
//! The goal is to avoid pruning of blocks that have active notifications in the node. Every
//! recipient of notifications should receive the chance to act upon them. In addition, notification
//! listeners can hold onto a [`pezsc_client_api::UnpinHandle`] to keep a block pinned. Once the handle
//! is dropped, a message is sent and the worker unpins the respective block.
//! listeners can hold onto a [`pezsc_client_api::UnpinHandle`] to keep a block pinned. Once the
//! handle is dropped, a message is sent and the worker unpins the respective block.
use std::{
marker::PhantomData,
sync::{Arc, Weak},
@@ -32,8 +32,8 @@ use futures::StreamExt;
use pezsc_client_api::{Backend, UnpinWorkerMessage};
use pezsc_utils::mpsc::TracingUnboundedReceiver;
use schnellru::Limiter;
use pezsp_runtime::traits::Block as BlockT;
use schnellru::Limiter;
const LOG_TARGET: &str = "db::notification_pinning";
const NOTIFICATION_PINNING_LIMIT: usize = 1024;
+1 -1
View File
@@ -19,7 +19,6 @@
//! Service configuration.
pub use jsonrpsee::server::BatchRequestConfig as RpcBatchRequestConfig;
use prometheus_endpoint::Registry;
use pezsc_chain_spec::ChainSpec;
pub use pezsc_client_db::{BlocksPruning, Database, DatabaseSource, PruningMode};
pub use pezsc_executor::{WasmExecutionMethod, WasmtimeInstantiationStrategy};
@@ -39,6 +38,7 @@ pub use pezsc_rpc_server::{
pub use pezsc_telemetry::TelemetryEndpoints;
pub use pezsc_transaction_pool::TransactionPoolOptions;
use pezsp_core::crypto::SecretString;
use prometheus_endpoint::Registry;
use std::{
io, iter,
net::SocketAddr,
+7 -7
View File
@@ -85,7 +85,6 @@ pub use pezsc_chain_spec::{
};
use crate::config::RpcConfiguration;
use prometheus_endpoint::Registry;
pub use pezsc_consensus::ImportQueue;
pub use pezsc_executor::NativeExecutionDispatch;
pub use pezsc_network_sync::WarpSyncConfig;
@@ -95,6 +94,7 @@ pub use pezsc_rpc::{RandomIntegerSubscriptionId, RandomStringSubscriptionId};
pub use pezsc_tracing::TracingReceiver;
pub use pezsc_transaction_pool::TransactionPoolOptions;
pub use pezsc_transaction_pool_api::{error::IntoPoolError, InPoolTransaction, TransactionPool};
use prometheus_endpoint::Registry;
#[doc(hidden)]
pub use std::{ops::Deref, result::Result, sync::Arc};
pub use task_manager::{
@@ -335,9 +335,9 @@ pub async fn build_system_rpc_future<
network_service.remove_reserved_peer(peer_id);
sender.send(Ok(()))
},
Err(e) => sender.send(Err(pezsc_rpc::system::error::Error::MalformattedPeerArg(
e.to_string(),
))),
Err(e) => sender.send(Err(
pezsc_rpc::system::error::Error::MalformattedPeerArg(e.to_string()),
)),
};
},
pezsc_rpc::system::Request::NetworkReservedPeers(sender) => {
@@ -571,13 +571,13 @@ where
#[cfg(test)]
mod tests {
use super::*;
use futures::executor::block_on;
use pezsc_transaction_pool::BasicPool;
use pezsp_consensus::SelectChain;
use bizinikiwi_test_runtime_client::{
prelude::*,
runtime::{ExtrinsicBuilder, Transfer, TransferData},
};
use futures::executor::block_on;
use pezsc_transaction_pool::BasicPool;
use pezsp_consensus::SelectChain;
#[test]
fn should_not_propagate_transactions_that_are_marked_as_such() {
+1 -1
View File
@@ -17,7 +17,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use futures_timer::Delay;
use prometheus_endpoint::{register, Gauge, GaugeVec, Opts, PrometheusError, Registry, U64};
use pezsc_client_api::{ClientInfo, UsageProvider};
use pezsc_network::{config::Role, NetworkStatus, NetworkStatusProvider};
use pezsc_network_sync::{SyncStatus, SyncStatusProvider};
@@ -26,6 +25,7 @@ use pezsc_transaction_pool_api::{MaintainedTransactionPool, PoolStatus};
use pezsc_utils::metrics::register_globals;
use pezsp_api::ProvideRuntimeApi;
use pezsp_runtime::traits::{Block, NumberFor, SaturatedConversion, UniqueSaturatedInto};
use prometheus_endpoint::{register, Gauge, GaugeVec, Opts, PrometheusError, Registry, U64};
use std::{
sync::Arc,
time::{Duration, Instant, SystemTime},
@@ -25,11 +25,11 @@ use futures::{
Future, FutureExt, StreamExt,
};
use parking_lot::Mutex;
use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
use prometheus_endpoint::{
exponential_buckets, register, CounterVec, HistogramOpts, HistogramVec, Opts, PrometheusError,
Registry, U64,
};
use pezsc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
use std::{
collections::{hash_map::Entry, HashMap},
panic,
@@ -17,6 +17,16 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use async_channel::TryRecvError;
use bizinikiwi_test_runtime::TestAPI;
use bizinikiwi_test_runtime_client::{
runtime::{
currency::DOLLARS,
genesismap::{insert_genesis_block, GenesisStorageBuilder},
Block, BlockNumber, Digest, Hash, Header, RuntimeApi, Transfer,
},
BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, Sr25519Keyring,
TestClientBuilder, TestClientBuilderExt,
};
use codec::{Decode, Encode, Joiner};
use futures::executor::block_on;
use pezsc_block_builder::BlockBuilderBuilder;
@@ -41,16 +51,6 @@ use pezsp_runtime::{
use pezsp_state_machine::{backend::Backend as _, InMemoryBackend, OverlayedChanges, StateMachine};
use pezsp_storage::{ChildInfo, StorageKey};
use std::{collections::HashSet, sync::Arc};
use bizinikiwi_test_runtime::TestAPI;
use bizinikiwi_test_runtime_client::{
runtime::{
currency::DOLLARS,
genesismap::{insert_genesis_block, GenesisStorageBuilder},
Block, BlockNumber, Digest, Hash, Header, RuntimeApi, Transfer,
},
BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, Sr25519Keyring,
TestClientBuilder, TestClientBuilderExt,
};
mod db;
@@ -2257,11 +2257,12 @@ fn use_dalek_ext_works() {
let client = TestClientBuilder::new().build();
client.execution_extensions().set_extensions_factory(
pezsc_client_api::execution_extensions::ExtensionBeforeBlock::<Block, pezsp_io::UseDalekExt>::new(
1,
),
);
client
.execution_extensions()
.set_extensions_factory(pezsc_client_api::execution_extensions::ExtensionBeforeBlock::<
Block,
pezsp_io::UseDalekExt,
>::new(1));
let a1 = BlockBuilderBuilder::new(&client)
.on_parent_block(client.chain_info().genesis_hash)