diff --git a/Cargo.lock b/Cargo.lock index bf4f01ed..bb250e65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10315,6 +10315,7 @@ dependencies = [ "jsonrpsee", "pez-minimal-template-runtime", "pezkuwi-sdk", + "pezsp-runtime", ] [[package]] @@ -10567,6 +10568,7 @@ dependencies = [ "jsonrpsee", "pez-revive-dev-runtime", "pezkuwi-sdk", + "pezsp-runtime", ] [[package]] @@ -14004,6 +14006,7 @@ dependencies = [ "pezpallet-revive-proc-macro", "pezpallet-revive-uapi", "pezpallet-root-offences", + "pezpallet-root-testing", "pezpallet-safe-mode", "pezpallet-salary", "pezpallet-scheduler", @@ -14132,6 +14135,7 @@ dependencies = [ "pezsp-offchain", "pezsp-panic-handler", "pezsp-rpc", + "pezsp-runtime", "pezsp-runtime-interface", "pezsp-runtime-interface-proc-macro", "pezsp-session", @@ -21214,6 +21218,7 @@ dependencies = [ "pezkuwi-sdk", "pezsc-service-test", "pezsp-keyring", + "pezsp-runtime", "pezstaging-node-inspect", "pretty_assertions", "rand 0.8.5", @@ -25884,6 +25889,7 @@ dependencies = [ "log", "parity-scale-codec", "pezkuwi-sdk", + "pezsp-runtime", "serde", "teyrchain-template-runtime", ] @@ -25900,6 +25906,7 @@ dependencies = [ "pezcumulus-pezpallet-teyrchain-system", "pezkuwi-sdk", "pezpallet-teyrchain-template", + "pezsp-runtime", "scale-info", "serde_json", "smallvec", @@ -28615,6 +28622,7 @@ dependencies = [ "parity-scale-codec", "pezcumulus-pezpallet-teyrchain-system", "pezkuwi-sdk", + "pezsp-runtime", "scale-info", "serde_json", ] diff --git a/bizinikiwi/bin/node/cli/Cargo.toml b/bizinikiwi/bin/node/cli/Cargo.toml index 45e49169..9d3d17ab 100644 --- a/bizinikiwi/bin/node/cli/Cargo.toml +++ b/bizinikiwi/bin/node/cli/Cargo.toml @@ -123,14 +123,24 @@ pezkuwi-sdk = { features = [ "pezsc-transaction-pool", "pezsc-transaction-pool-api", "pezsc-utils", + "pezsp-api", "pezsp-blockchain", "pezsp-consensus", + "pezsp-core", "pezsp-core-hashing", "pezsp-core-hashing-proc-macro", "pezsp-database", + "pezsp-inherents", + "pezsp-io", + "pezsp-keystore", "pezsp-maybe-compressed-blob", + "pezsp-mmr-primitives", "pezsp-panic-handler", "pezsp-rpc", + "pezsp-statement-store", + "pezsp-timestamp", + "pezsp-tracing", + "pezsp-transaction-storage-proof", "pezstaging-chain-spec-builder", "pezstaging-node-inspect", "pezstaging-tracking-allocator", @@ -146,6 +156,9 @@ pezkuwi-sdk = { features = [ "pez-tracing-gum", ], workspace = true, default-features = true } +# Direct dependency needed (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + # Shared code between the staging node and kitchensink runtime: pez-kitchensink-runtime = { workspace = true } node-inspect = { optional = true, workspace = true, default-features = true } @@ -205,6 +218,7 @@ runtime-benchmarks = [ "pezkuwi-sdk/runtime-benchmarks", "pezsc-service-test/runtime-benchmarks", "pezsp-keyring/runtime-benchmarks", + "pezsp-runtime/runtime-benchmarks", "bizinikiwi-cli-test-utils/runtime-benchmarks", ] try-runtime = [ diff --git a/bizinikiwi/bin/node/cli/src/service.rs b/bizinikiwi/bin/node/cli/src/service.rs index d1455e5a..fa7a4d0e 100644 --- a/bizinikiwi/bin/node/cli/src/service.rs +++ b/bizinikiwi/bin/node/cli/src/service.rs @@ -46,21 +46,23 @@ use pezsc_statement_store::Store as StatementStore; use pezsc_telemetry::{Telemetry, TelemetryWorker}; use pezsc_transaction_pool::TransactionPoolHandle; use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; -use pezsp_api::ProvideRuntimeApi; -use pezsp_core::crypto::Pair; +use pezkuwi_sdk::pezsp_api::ProvideRuntimeApi; +use pezkuwi_sdk::pezsp_core::crypto::Pair; use pezsp_runtime::{generic, traits::Block as BlockT, SaturatedConversion}; use std::{path::Path, sync::Arc}; /// Host functions required for kitchensink runtime and Bizinikiwi node. #[cfg(not(feature = "runtime-benchmarks"))] -pub type HostFunctions = - (pezsp_io::BizinikiwiHostFunctions, pezsp_statement_store::runtime_api::HostFunctions); +pub type HostFunctions = ( + pezkuwi_sdk::pezsp_io::BizinikiwiHostFunctions, + pezkuwi_sdk::pezsp_statement_store::runtime_api::HostFunctions, +); /// Host functions required for kitchensink runtime and Bizinikiwi node. #[cfg(feature = "runtime-benchmarks")] pub type HostFunctions = ( - pezsp_io::BizinikiwiHostFunctions, - pezsp_statement_store::runtime_api::HostFunctions, + pezkuwi_sdk::pezsp_io::BizinikiwiHostFunctions, + pezkuwi_sdk::pezsp_statement_store::runtime_api::HostFunctions, pezframe_benchmarking::benchmarking::HostFunctions, ); @@ -273,9 +275,9 @@ pub fn new_partial( beefy_block_import, client.clone(), Arc::new(move |_, _| async move { - let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time(); let slot = - pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + pezkuwi_sdk::pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); @@ -621,16 +623,16 @@ pub fn new_full_base::Hash>>( create_inherent_data_providers: move |parent, ()| { let client_clone = client_clone.clone(); async move { - let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time(); let slot = - pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + pezkuwi_sdk::pezsp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); let storage_proof = - pezsp_transaction_storage_proof::registration::new_data_provider( + pezkuwi_sdk::pezsp_transaction_storage_proof::registration::new_data_provider( &*client_clone, &parent, )?; @@ -729,7 +731,7 @@ pub fn new_full_base::Hash>>( pezmmr_gadget::MmrGadget::start( client.clone(), backend.clone(), - pezsp_mmr_primitives::INDEXING_PREFIX.to_vec(), + pezkuwi_sdk::pezsp_mmr_primitives::INDEXING_PREFIX.to_vec(), ), ); } @@ -877,7 +879,17 @@ mod tests { Address, BalancesCall, RuntimeCall, TxExtension, }; use pez_node_primitives::{Block, DigestItem, Signature}; - use pezkuwi_sdk::{pezsc_transaction_pool_api::MaintainedTransactionPool, *}; + use pezkuwi_sdk::{ + pezsc_transaction_pool_api::MaintainedTransactionPool, + pezsp_consensus::{BlockOrigin, Environment, Proposer}, + pezsp_consensus_babe, + pezsp_core::crypto::Pair, + pezsp_inherents::InherentDataProvider, + pezsp_keystore::KeystorePtr, + pezsp_timestamp, + pezsp_tracing, + *, + }; use pezsc_client_api::BlockBackend; use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; use pezsc_consensus_babe::{BabeIntermediate, CompatibleDigestItem, INTERMEDIATE_KEY}; @@ -885,18 +897,13 @@ mod tests { use pezsc_keystore::LocalKeystore; use pezsc_service_test::TestNetNode; use pezsc_transaction_pool_api::ChainEvent; - use pezsp_consensus::{BlockOrigin, Environment, Proposer}; - use pezsp_core::crypto::Pair; - use pezsp_inherents::InherentDataProvider; use pezsp_keyring::Sr25519Keyring; - use pezsp_keystore::KeystorePtr; use pezsp_runtime::{ generic::{self, Digest, Era, SignedPayload}, key_types::BABE, traits::{Block as BlockT, Header as HeaderT, IdentifyAccount, Verify}, RuntimeAppPublic, }; - use pezsp_timestamp; use std::sync::Arc; type AccountPublic = ::Signer; diff --git a/bizinikiwi/bin/node/runtime/Cargo.toml b/bizinikiwi/bin/node/runtime/Cargo.toml index 65b4c0e8..d126229e 100644 --- a/bizinikiwi/bin/node/runtime/Cargo.toml +++ b/bizinikiwi/bin/node/runtime/Cargo.toml @@ -37,7 +37,7 @@ primitive-types = { features = [ ], workspace = true } pezkuwi-sdk = { features = ["runtime-full", "tuples-96"], workspace = true } -pezsp-runtime = { workspace = true } +pezsp-runtime = { path = "../../../primitives/runtime", default-features = false } # shared code between runtime and node pez-node-primitives = { workspace = true } diff --git a/bizinikiwi/bin/node/runtime/src/lib.rs b/bizinikiwi/bin/node/runtime/src/lib.rs index e8054fa3..a804225c 100644 --- a/bizinikiwi/bin/node/runtime/src/lib.rs +++ b/bizinikiwi/bin/node/runtime/src/lib.rs @@ -2332,7 +2332,7 @@ impl pezpallet_alliance::Config for Runtime { type RetirementPeriod = RetirementPeriod; } -impl pezframe_benchmarking_pallet_pov::Config for Runtime { +impl pezframe_benchmarking_pezpallet_pov::Config for Runtime { type RuntimeEvent = RuntimeEvent; } @@ -2806,7 +2806,7 @@ mod runtime { pub type MessageQueue = pezpallet_message_queue::Pezpallet; #[runtime::pezpallet_index(68)] - pub type Pov = pezframe_benchmarking_pallet_pov::Pezpallet; + pub type Pov = pezframe_benchmarking_pezpallet_pov::Pezpallet; #[runtime::pezpallet_index(69)] pub type TxPause = pezpallet_tx_pause::Pezpallet; @@ -2866,9 +2866,6 @@ mod runtime { pub type MultiAssetBounties = pezpallet_multi_asset_bounties::Pezpallet; } -// Re-export all pallet types from the runtime module -pub use runtime::*; - /// The address format for describing accounts. pub type Address = pezsp_runtime::MultiAddress; /// Block header type as expected by this runtime. @@ -3109,7 +3106,7 @@ impl mod benches { pezkuwi_sdk::pezframe_benchmarking::define_benchmarks!( [pezframe_benchmarking, BaselineBench::] - [pezframe_benchmarking_pallet_pov, Pov] + [pezframe_benchmarking_pezpallet_pov, Pov] [pezpallet_alliance, Alliance] [pezpallet_assets, Assets] [pezpallet_babe, Babe] diff --git a/bizinikiwi/pezframe/revive/dev-node/node/Cargo.toml b/bizinikiwi/pezframe/revive/dev-node/node/Cargo.toml index 6145fbe6..a8338246 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/Cargo.toml +++ b/bizinikiwi/pezframe/revive/dev-node/node/Cargo.toml @@ -24,7 +24,18 @@ futures = { features = ["thread-pool"], workspace = true } futures-timer = { workspace = true } jsonrpsee = { features = ["server"], workspace = true } -pezkuwi-sdk = { workspace = true, features = ["experimental", "node"] } +# Direct dependency needed (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + +pezkuwi-sdk = { workspace = true, features = [ + "experimental", + "node", + "pezsp-core", + "pezsp-io", + "pezsp-genesis-builder", + "pezsp-block-builder", + "pezsp-timestamp", +] } pez-revive-dev-runtime = { workspace = true } [build-dependencies] diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs index 35969643..93a4c97c 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/chain_spec.rs @@ -36,7 +36,7 @@ pub fn development_chain_spec() -> Result { .with_name("Development") .with_id("dev") .with_chain_type(ChainType::Development) - .with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET) + .with_genesis_config_preset_name(pezkuwi_sdk::pezsp_genesis_builder::DEV_RUNTIME_PRESET) .with_properties(props()) .build()) } diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs index a9f82d4a..7f7d5f30 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/rpc.rs @@ -81,11 +81,11 @@ where C: Send + Sync + 'static - + pezsp_api::ProvideRuntimeApi + + pezkuwi_sdk::pezsp_api::ProvideRuntimeApi + HeaderBackend + HeaderMetadata + 'static, - C::Api: pezsp_block_builder::BlockBuilder, + C::Api: pezkuwi_sdk::pezsp_block_builder::BlockBuilder, C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi, P: TransactionPool + 'static, { diff --git a/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs b/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs index 892c50b5..1ee2af97 100644 --- a/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs +++ b/bizinikiwi/pezframe/revive/dev-node/node/src/service.rs @@ -22,12 +22,12 @@ use pezkuwi_sdk::{ pezsc_executor::WasmExecutor, pezsc_service::{error::Error as ServiceError, Configuration, TaskManager}, pezsc_telemetry::{Telemetry, TelemetryWorker}, - pezsp_runtime::traits::Block as BlockT, *, }; +use pezsp_runtime::traits::Block as BlockT; use std::sync::Arc; -type HostFunctions = pezsp_io::BizinikiwiHostFunctions; +type HostFunctions = pezkuwi_sdk::pezsp_io::BizinikiwiHostFunctions; #[docify::export] pub(crate) type FullClient = @@ -190,10 +190,10 @@ pub fn new_full: move |parent, ()| { let client = client.clone(); async move { - let key = pezsp_core::storage::StorageKey( + let key = pezkuwi_sdk::pezsp_core::storage::StorageKey( pezkuwi_sdk::pezpallet_timestamp::Now::::hashed_key().to_vec(), ); - let current = pezsp_timestamp::Timestamp::current(); + let current = pezkuwi_sdk::pezsp_timestamp::Timestamp::current(); let next = client .storage(parent, &key) .ok() @@ -201,10 +201,10 @@ pub fn new_full: .and_then(|data| data.0.try_into().ok()) .map(|data| { let last = u64::from_le_bytes(data) / 1000; - pezsp_timestamp::Timestamp::new((last + 1) * 1000) + pezkuwi_sdk::pezsp_timestamp::Timestamp::new((last + 1) * 1000) }) .unwrap_or(current); - Ok(pezsp_timestamp::InherentDataProvider::new(current.max(next))) + Ok(pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::new(current.max(next))) } } }; diff --git a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-47b830cef6768ed5b119c74037482baef86a7c3d3469873a205805ef342ba031.json b/bizinikiwi/pezframe/revive/rpc/.sqlx/query-47b830cef6768ed5b119c74037482baef86a7c3d3469873a205805ef342ba031.json deleted file mode 100644 index cf65a4e6..00000000 --- a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-47b830cef6768ed5b119c74037482baef86a7c3d3469873a205805ef342ba031.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "SQLite", - "query": "\n\t\t\tSELECT bizinikiwi_block_hash\n\t\t\tFROM eth_to_bizinikiwi_blocks\n\t\t\tWHERE ethereum_block_hash = $1\n\t\t\t", - "describe": { - "columns": [ - { - "name": "bizinikiwi_block_hash", - "ordinal": 0, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false - ] - }, - "hash": "47b830cef6768ed5b119c74037482baef86a7c3d3469873a205805ef342ba031" -} diff --git a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-7e5be81ad6f5d96bc6dbf62098cbd61d257d1ffad222317634327e12be403ab2.json b/bizinikiwi/pezframe/revive/rpc/.sqlx/query-7e5be81ad6f5d96bc6dbf62098cbd61d257d1ffad222317634327e12be403ab2.json deleted file mode 100644 index 2ce9070a..00000000 --- a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-7e5be81ad6f5d96bc6dbf62098cbd61d257d1ffad222317634327e12be403ab2.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "SQLite", - "query": "\n\t\t\tSELECT ethereum_block_hash\n\t\t\tFROM eth_to_bizinikiwi_blocks\n\t\t\tWHERE bizinikiwi_block_hash = $1\n\t\t\t", - "describe": { - "columns": [ - { - "name": "ethereum_block_hash", - "ordinal": 0, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false - ] - }, - "hash": "7e5be81ad6f5d96bc6dbf62098cbd61d257d1ffad222317634327e12be403ab2" -} diff --git a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-cf515b47790a2ac4b3802c29e36a07ace0c67849e5b20c92532d7a77861ebf80.json b/bizinikiwi/pezframe/revive/rpc/.sqlx/query-cf515b47790a2ac4b3802c29e36a07ace0c67849e5b20c92532d7a77861ebf80.json deleted file mode 100644 index 2f476379..00000000 --- a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-cf515b47790a2ac4b3802c29e36a07ace0c67849e5b20c92532d7a77861ebf80.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "SQLite", - "query": "\n\t\t\tINSERT OR REPLACE INTO eth_to_bizinikiwi_blocks (ethereum_block_hash, bizinikiwi_block_hash)\n\t\t\tVALUES ($1, $2)\n\t\t\t", - "describe": { - "columns": [], - "parameters": { - "Right": 2 - }, - "nullable": [] - }, - "hash": "cf515b47790a2ac4b3802c29e36a07ace0c67849e5b20c92532d7a77861ebf80" -} diff --git a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-e712acbeb712c0a61fc2a47f966abae1ae43ffba0920a9d209d01dcfce44c5e0.json b/bizinikiwi/pezframe/revive/rpc/.sqlx/query-e712acbeb712c0a61fc2a47f966abae1ae43ffba0920a9d209d01dcfce44c5e0.json deleted file mode 100644 index b4701a19..00000000 --- a/bizinikiwi/pezframe/revive/rpc/.sqlx/query-e712acbeb712c0a61fc2a47f966abae1ae43ffba0920a9d209d01dcfce44c5e0.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "SQLite", - "query": "SELECT EXISTS(SELECT 1 FROM eth_to_bizinikiwi_blocks WHERE bizinikiwi_block_hash = $1) AS \"exists!:bool\"", - "describe": { - "columns": [ - { - "name": "exists!:bool", - "ordinal": 0, - "type_info": "Integer" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false - ] - }, - "hash": "e712acbeb712c0a61fc2a47f966abae1ae43ffba0920a9d209d01dcfce44c5e0" -} diff --git a/bizinikiwi/pezframe/revive/rpc/revive_chain.scale.bak b/bizinikiwi/pezframe/revive/rpc/revive_chain.scale.bak new file mode 100644 index 00000000..2fdbb8c8 Binary files /dev/null and b/bizinikiwi/pezframe/revive/rpc/revive_chain.scale.bak differ diff --git a/bizinikiwi/pezframe/revive/rpc/src/subxt_client.rs b/bizinikiwi/pezframe/revive/rpc/src/subxt_client.rs index ea567b09..2403c682 100644 --- a/bizinikiwi/pezframe/revive/rpc/src/subxt_client.rs +++ b/bizinikiwi/pezframe/revive/rpc/src/subxt_client.rs @@ -27,6 +27,32 @@ pub use subxt::config::PolkadotConfig as SrcChainConfig; with = "::subxt::utils::Static<::pezsp_core::U256>" ), + // The metadata is generated from our rebranded runtime, so paths already use pezsp_* names + substitute_type( + path = "pezsp_runtime::DispatchError", + with = "::subxt::utils::Static<::pezsp_runtime::DispatchError>" + ), + substitute_type( + path = "pezsp_runtime::ModuleError", + with = "::subxt::utils::Static<::pezsp_runtime::ModuleError>" + ), + substitute_type( + path = "pezsp_runtime::TokenError", + with = "::subxt::utils::Static<::pezsp_runtime::TokenError>" + ), + substitute_type( + path = "pezsp_arithmetic::ArithmeticError", + with = "::subxt::utils::Static<::pezsp_runtime::ArithmeticError>" + ), + substitute_type( + path = "pezsp_runtime::TransactionalError", + with = "::subxt::utils::Static<::pezsp_runtime::TransactionalError>" + ), + substitute_type( + path = "pezsp_runtime::MultiSignature", + with = "::subxt::utils::Static<::pezsp_runtime::MultiSignature>" + ), + substitute_type( path = "pezsp_runtime::generic::block::Block", with = "::subxt::utils::Static<::pezsp_runtime::generic::Block< diff --git a/bizinikiwi/pezframe/staking/reward-curve/src/lib.rs b/bizinikiwi/pezframe/staking/reward-curve/src/lib.rs index bb84f835..849f6d2c 100644 --- a/bizinikiwi/pezframe/staking/reward-curve/src/lib.rs +++ b/bizinikiwi/pezframe/staking/reward-curve/src/lib.rs @@ -88,13 +88,7 @@ pub fn build(input: TokenStream) -> TokenStream { let ident = syn::Ident::new(&pezsp_runtime, Span::call_site()); quote!( #[doc(hidden)] pub use #ident as _sp_runtime; ) }, - Err(e) => match crate_name("pezkuwi-sdk") { - Ok(FoundCrate::Name(pezkuwi_sdk)) => { - let ident = syn::Ident::new(&pezkuwi_sdk, Span::call_site()); - quote!( #[doc(hidden)] pub use #ident::pezsp_runtime as _sp_runtime; ) - }, - _ => syn::Error::new(Span::call_site(), e).to_compile_error(), - }, + Err(e) => syn::Error::new(Span::call_site(), e).to_compile_error(), }; let const_name = input.ident; diff --git a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/Cargo.toml b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/Cargo.toml index 866eefa9..f89ad53f 100644 --- a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/Cargo.toml +++ b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/Cargo.toml @@ -17,7 +17,27 @@ codec = { features = ["derive"], workspace = true } scale-info = { features = ["derive"], workspace = true } serde_json = { features = ["alloc"], workspace = true } +# Direct dependency needed for runtime (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + pezkuwi-sdk = { workspace = true, default-features = false, features = [ + # Primitives needed for runtime + "pezsp-core", + "pezsp-consensus-aura", + "pezsp-version", + "pezsp-genesis-builder", + "pezsp-keyring", + "pezsp-api", + "pezsp-block-builder", + "pezsp-inherents", + "pezsp-transaction-pool", + "pezsp-offchain", + "pezsp-session", + + "pezframe-support", + "pezframe-system", + "pezframe-executive", + "pezpallet-aura", "pezpallet-authorship", "pezpallet-balances", @@ -63,6 +83,7 @@ std = [ "codec/std", "pezcumulus-pezpallet-teyrchain-system/std", "pezkuwi-sdk/std", + "pezsp-runtime/std", "scale-info/std", "serde_json/std", "bizinikiwi-wasm-builder", @@ -70,6 +91,7 @@ std = [ runtime-benchmarks = [ "pezcumulus-pezpallet-teyrchain-system/runtime-benchmarks", "pezkuwi-sdk/runtime-benchmarks", + "pezsp-runtime/runtime-benchmarks", "bizinikiwi-wasm-builder?/runtime-benchmarks", ] diff --git a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/genesis_config_presets.rs b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/genesis_config_presets.rs index b7ece747..d080fbaf 100644 --- a/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/genesis_config_presets.rs +++ b/pezcumulus/teyrchains/runtimes/testing/yet-another-teyrchain/src/genesis_config_presets.rs @@ -67,7 +67,7 @@ pub fn get_preset(id: &PresetId) -> Option> { yap_teyrchain_genesis( Sr25519Keyring::Alice.to_account_id(), authorities, - Sr25519Keyring::well_known().map(|x| x.to_account_id()).collect(), + Sr25519Keyring::well_known().map(|x: Sr25519Keyring| x.to_account_id()).collect(), ENDOWMENT, DEFAULT_PARA_ID, ) diff --git a/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs b/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs index f7c020d0..7597b3f1 100644 --- a/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs +++ b/pezcumulus/zombienet/zombienet-sdk-helpers/src/lib.rs @@ -18,7 +18,7 @@ use tokio::{ use zombienet_sdk::subxt::{ self, blocks::Block, - config::{bizinikiwi::DigestItem, polkadot::PolkadotExtrinsicParamsBuilder}, + config::{polkadot::PolkadotExtrinsicParamsBuilder, substrate::DigestItem}, dynamic::Value, events::Events, ext::scale_value::value, @@ -70,7 +70,7 @@ fn find_event_and_decode_fields( let mut result = vec![]; for event in events.iter() { let event = event?; - if event.pezpallet_name() == pezpallet && event.variant_name() == variant { + if event.pallet_name() == pezpallet && event.variant_name() == variant { let field_bytes = event.field_bytes().to_vec(); result.push(T::decode(&mut &field_bytes[..])?); } @@ -84,7 +84,7 @@ async fn is_session_change( let events = block.events().await?; Ok(events.iter().any(|event| { event.as_ref().is_ok_and(|event| { - event.pezpallet_name() == "Session" && event.variant_name() == "NewSession" + event.pallet_name() == "Session" && event.variant_name() == "NewSession" }) })) } diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml index 748ce153..cb6ae130 100644 --- a/templates/minimal/node/Cargo.toml +++ b/templates/minimal/node/Cargo.toml @@ -24,8 +24,19 @@ futures = { features = ["thread-pool"], workspace = true } futures-timer = { workspace = true } jsonrpsee = { features = ["server"], workspace = true } +# Direct dependency needed (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + pez-minimal-template-runtime = { workspace = true } -pezkuwi-sdk = { workspace = true, features = ["experimental", "node"] } +pezkuwi-sdk = { workspace = true, features = [ + "experimental", + "node", + "pezsp-api", + "pezsp-block-builder", + "pezsp-genesis-builder", + "pezsp-io", + "pezsp-timestamp", +] } [build-dependencies] pezkuwi-sdk = { workspace = true, features = ["bizinikiwi-build-script-utils"] } diff --git a/templates/minimal/node/src/chain_spec.rs b/templates/minimal/node/src/chain_spec.rs index d3f06587..a2ced7b2 100644 --- a/templates/minimal/node/src/chain_spec.rs +++ b/templates/minimal/node/src/chain_spec.rs @@ -36,7 +36,7 @@ pub fn development_chain_spec() -> Result { .with_name("Development") .with_id("dev") .with_chain_type(ChainType::Development) - .with_genesis_config_preset_name(pezsp_genesis_builder::DEV_RUNTIME_PRESET) + .with_genesis_config_preset_name(pezkuwi_sdk::pezsp_genesis_builder::DEV_RUNTIME_PRESET) .with_properties(props()) .build()) } diff --git a/templates/minimal/node/src/rpc.rs b/templates/minimal/node/src/rpc.rs index 8207a2f5..759d8cf9 100644 --- a/templates/minimal/node/src/rpc.rs +++ b/templates/minimal/node/src/rpc.rs @@ -48,11 +48,11 @@ where C: Send + Sync + 'static - + pezsp_api::ProvideRuntimeApi + + pezkuwi_sdk::pezsp_api::ProvideRuntimeApi + HeaderBackend + HeaderMetadata + 'static, - C::Api: pezsp_block_builder::BlockBuilder, + C::Api: pezkuwi_sdk::pezsp_block_builder::BlockBuilder, C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi, P: TransactionPool + 'static, { diff --git a/templates/minimal/node/src/service.rs b/templates/minimal/node/src/service.rs index 7e20df48..07c19f1f 100644 --- a/templates/minimal/node/src/service.rs +++ b/templates/minimal/node/src/service.rs @@ -24,12 +24,12 @@ use pezkuwi_sdk::{ pezsc_service::{error::Error as ServiceError, Configuration, TaskManager}, pezsc_telemetry::{Telemetry, TelemetryWorker}, pezsc_transaction_pool_api::OffchainTransactionPoolFactory, - pezsp_runtime::traits::Block as BlockT, *, }; +use pezsp_runtime::traits::Block as BlockT; use std::sync::Arc; -type HostFunctions = pezsp_io::BizinikiwiHostFunctions; +type HostFunctions = pezkuwi_sdk::pezsp_io::BizinikiwiHostFunctions; #[docify::export] pub(crate) type FullClient = @@ -215,7 +215,7 @@ pub fn new_full: select_chain, consensus_data_provider: None, create_inherent_data_providers: move |_, ()| async move { - Ok(pezsp_timestamp::InherentDataProvider::from_system_time()) + Ok(pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time()) }, }; @@ -251,7 +251,7 @@ pub fn new_full: commands_stream: Box::pin(commands_stream), consensus_data_provider: None, create_inherent_data_providers: move |_, ()| async move { - Ok(pezsp_timestamp::InherentDataProvider::from_system_time()) + Ok(pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time()) }, }; let authorship_future = pezsc_consensus_manual_seal::run_manual_seal(params); diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index fee14aad..3820024d 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -16,6 +16,8 @@ workspace = true [dependencies] codec = { workspace = true } pezkuwi-sdk = { workspace = true, features = [ + "pezsp-api", + "pezsp-keyring", "pezpallet-balances", "pezpallet-sudo", "pezpallet-timestamp", diff --git a/templates/teyrchain/node/Cargo.toml b/templates/teyrchain/node/Cargo.toml index 47ee64b6..91fface9 100644 --- a/templates/teyrchain/node/Cargo.toml +++ b/templates/teyrchain/node/Cargo.toml @@ -24,7 +24,10 @@ jsonrpsee = { features = ["server"], workspace = true } log = { workspace = true, default-features = true } serde = { features = ["derive"], workspace = true, default-features = true } -pezkuwi-sdk = { workspace = true, features = ["node", "pezkuwi-primitives"] } +# Direct dependency needed (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + +pezkuwi-sdk = { workspace = true, features = ["node", "pezkuwi-primitives", "pezsp-keystore", "pezsp-timestamp"] } teyrchain-template-runtime = { workspace = true } @@ -36,7 +39,7 @@ pezkuwi-sdk = { workspace = true, features = ["bizinikiwi-build-script-utils"] } [features] default = ["std"] -std = ["log/std", "pezkuwi-sdk/std", "teyrchain-template-runtime/std"] +std = ["log/std", "pezkuwi-sdk/std", "pezsp-runtime/std", "teyrchain-template-runtime/std"] runtime-benchmarks = [ "pezkuwi-sdk/runtime-benchmarks", "teyrchain-template-runtime/runtime-benchmarks", diff --git a/templates/teyrchain/node/src/command.rs b/templates/teyrchain/node/src/command.rs index 6c80238d..73382908 100644 --- a/templates/teyrchain/node/src/command.rs +++ b/templates/teyrchain/node/src/command.rs @@ -1,6 +1,7 @@ use pezkuwi_sdk::*; use log::info; +use pezsp_runtime; use pezcumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use pezframe_benchmarking_cli::{BenchmarkCmd, BIZINIKIWI_REFERENCE_HARDWARE}; use pezsc_cli::{ diff --git a/templates/teyrchain/node/src/service.rs b/templates/teyrchain/node/src/service.rs index 1d8f23c8..b47e55b4 100644 --- a/templates/teyrchain/node/src/service.rs +++ b/templates/teyrchain/node/src/service.rs @@ -41,8 +41,8 @@ use pezsc_network::{NetworkBackend, NetworkBlock}; use pezsc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use pezsc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use pezsc_transaction_pool_api::OffchainTransactionPoolFactory; -use pezsp_api::ProvideRuntimeApi; -use pezsp_keystore::KeystorePtr; +use pezkuwi_sdk::pezsp_api::ProvideRuntimeApi; +use pezkuwi_sdk::pezsp_keystore::KeystorePtr; use prometheus_endpoint::Registry; #[docify::export(wasm_executor)] @@ -161,7 +161,7 @@ fn build_import_queue( client, block_import, move |_, _| async move { - let timestamp = pezsp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = pezkuwi_sdk::pezsp_timestamp::InherentDataProvider::from_system_time(); Ok(timestamp) }, &task_manager.spawn_essential_handle(), diff --git a/templates/teyrchain/runtime/Cargo.toml b/templates/teyrchain/runtime/Cargo.toml index de9527c3..9ab061f1 100644 --- a/templates/teyrchain/runtime/Cargo.toml +++ b/templates/teyrchain/runtime/Cargo.toml @@ -30,7 +30,26 @@ smallvec = { workspace = true, default-features = true } # Local pezpallet-teyrchain-template = { workspace = true } +# Direct dependency needed for runtime (not through umbrella due to macro visibility issues) +pezsp-runtime = { workspace = true } + pezkuwi-sdk = { workspace = true, default-features = false, features = [ + # Primitives needed for runtime + "pezsp-core", + "pezsp-consensus-aura", + "pezsp-version", + "pezsp-genesis-builder", + "pezsp-keyring", + "pezsp-api", + "pezsp-block-builder", + "pezsp-inherents", + "pezsp-transaction-pool", + "pezsp-offchain", + "pezsp-session", + "pezframe-support", + "pezframe-system", + "pezframe-executive", + "pezpallet-aura", "pezpallet-authorship", "pezpallet-balances", @@ -78,6 +97,7 @@ std = [ "log/std", "pezpallet-teyrchain-template/std", "pezkuwi-sdk/std", + "pezsp-runtime/std", "scale-info/std", "serde_json/std", "bizinikiwi-wasm-builder", @@ -87,6 +107,7 @@ runtime-benchmarks = [ "hex-literal", "pezpallet-teyrchain-template/runtime-benchmarks", "pezkuwi-sdk/runtime-benchmarks", + "pezsp-runtime/runtime-benchmarks", "bizinikiwi-wasm-builder?/runtime-benchmarks", ] try-runtime = [ diff --git a/templates/teyrchain/runtime/src/genesis_config_presets.rs b/templates/teyrchain/runtime/src/genesis_config_presets.rs index ed8e4cdd..3dc8af55 100644 --- a/templates/teyrchain/runtime/src/genesis_config_presets.rs +++ b/templates/teyrchain/runtime/src/genesis_config_presets.rs @@ -49,7 +49,7 @@ fn testnet_genesis( session: SessionConfig { keys: invulnerables .into_iter() - .map(|(acc, aura)| { + .map(|(acc, aura): (AccountId, AuraId)| { ( acc.clone(), // account id acc, // validator id @@ -70,7 +70,7 @@ fn local_testnet_genesis() -> Value { (Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into()), (Sr25519Keyring::Bob.to_account_id(), Sr25519Keyring::Bob.public().into()), ], - Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect(), + Sr25519Keyring::well_known().map(|k: Sr25519Keyring| k.to_account_id()).collect(), Sr25519Keyring::Alice.to_account_id(), TEYRCHAIN_ID.into(), ) @@ -83,7 +83,7 @@ fn development_config_genesis() -> Value { (Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into()), (Sr25519Keyring::Bob.to_account_id(), Sr25519Keyring::Bob.public().into()), ], - Sr25519Keyring::well_known().map(|k| k.to_account_id()).collect(), + Sr25519Keyring::well_known().map(|k: Sr25519Keyring| k.to_account_id()).collect(), Sr25519Keyring::Alice.to_account_id(), TEYRCHAIN_ID.into(), ) diff --git a/templates/teyrchain/runtime/src/lib.rs b/templates/teyrchain/runtime/src/lib.rs index a20b0e10..2144d63d 100644 --- a/templates/teyrchain/runtime/src/lib.rs +++ b/templates/teyrchain/runtime/src/lib.rs @@ -137,8 +137,8 @@ impl WeightToFeePolynomial for WeightToFee { /// to even the core data structures. pub mod opaque { use super::*; - pub use pezkuwi_sdk::pezsp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - use pezkuwi_sdk::pezsp_runtime::{ + pub use pezsp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + use pezsp_runtime::{ generic, traits::{BlakeTwo256, Hash as HashT}, }; diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 8fec8389..4170309c 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -139,6 +139,7 @@ std = [ "pezpallet-remark?/std", "pezpallet-revive?/std", "pezpallet-root-offences?/std", + "pezpallet-root-testing?/std", "pezpallet-safe-mode?/std", "pezpallet-salary?/std", "pezpallet-scheduler?/std", @@ -204,6 +205,7 @@ std = [ "pezsp-npos-elections?/std", "pezsp-offchain?/std", "pezsp-runtime-interface?/std", + "pezsp-runtime?/std", "pezsp-session?/std", "pezsp-staking?/std", "pezsp-state-machine?/std", @@ -430,6 +432,7 @@ runtime-benchmarks = [ "pezpallet-remark?/runtime-benchmarks", "pezpallet-revive?/runtime-benchmarks", "pezpallet-root-offences?/runtime-benchmarks", + "pezpallet-root-testing?/runtime-benchmarks", "pezpallet-safe-mode?/runtime-benchmarks", "pezpallet-salary?/runtime-benchmarks", "pezpallet-scheduler?/runtime-benchmarks", @@ -528,6 +531,7 @@ runtime-benchmarks = [ "pezsp-npos-elections?/runtime-benchmarks", "pezsp-offchain?/runtime-benchmarks", "pezsp-runtime-interface?/runtime-benchmarks", + "pezsp-runtime?/runtime-benchmarks", "pezsp-session?/runtime-benchmarks", "pezsp-staking?/runtime-benchmarks", "pezsp-state-machine?/runtime-benchmarks", @@ -649,6 +653,7 @@ try-runtime = [ "pezpallet-remark?/try-runtime", "pezpallet-revive?/try-runtime", "pezpallet-root-offences?/try-runtime", + "pezpallet-root-testing?/try-runtime", "pezpallet-safe-mode?/try-runtime", "pezpallet-salary?/try-runtime", "pezpallet-scheduler?/try-runtime", @@ -869,6 +874,7 @@ runtime-full = [ "pezpallet-revive-proc-macro", "pezpallet-revive-uapi", "pezpallet-root-offences", + "pezpallet-root-testing", "pezpallet-safe-mode", "pezpallet-salary", "pezpallet-scheduler", @@ -1833,6 +1839,11 @@ default-features = false optional = true path = "../bizinikiwi/pezframe/root-offences" +[dependencies.pezpallet-root-testing] +default-features = false +optional = true +path = "../bizinikiwi/pezframe/root-testing" + [dependencies.pezpallet-safe-mode] default-features = false optional = true @@ -2163,6 +2174,11 @@ default-features = false optional = true path = "../bizinikiwi/primitives/offchain" +[dependencies.pezsp-runtime] +default-features = false +optional = true +path = "../bizinikiwi/primitives/runtime" + [dependencies.pezsp-runtime-interface] default-features = false optional = true diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index f2722679..647a431a 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -903,6 +903,10 @@ pub use pezpallet_revive_uapi; #[cfg(feature = "pezpallet-root-offences")] pub use pezpallet_root_offences; +/// FRAME root testing pezpallet. +#[cfg(feature = "pezpallet-root-testing")] +pub use pezpallet_root_testing; + /// FRAME safe-mode pezpallet. #[cfg(feature = "pezpallet-safe-mode")] pub use pezpallet_safe_mode;