git.delta.rocks / unique-network / refs/commits / 0ee16a462778

difftreelog

feat add PoV estimate

Daniel Shiposha2022-11-21parent: #83762c9.patch.diff
in: master

19 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5362,6 +5362,7 @@
  "substrate-wasm-builder",
  "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
  "up-sponsorship",
  "xcm",
@@ -5806,6 +5807,7 @@
  "sp-runtime",
  "sp-std",
  "up-data-structs",
+ "up-pov-estimate-rpc",
 ]
 
 [[package]]
@@ -8917,6 +8919,7 @@
  "substrate-wasm-builder",
  "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
  "up-sponsorship",
  "xcm",
@@ -12824,18 +12827,31 @@
 dependencies = [
  "anyhow",
  "app-promotion-rpc",
+ "frame-benchmarking",
  "jsonrpsee",
+ "opal-runtime",
  "pallet-common",
  "pallet-evm",
  "parity-scale-codec 3.2.1",
+ "quartz-runtime",
  "rmrk-rpc",
+ "sc-client-api",
+ "sc-executor",
+ "sc-rpc-api",
+ "sc-service",
  "sp-api",
  "sp-blockchain",
  "sp-core",
+ "sp-externalities",
  "sp-rpc",
  "sp-runtime",
+ "sp-state-machine",
+ "unique-runtime",
+ "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
+ "zstd",
 ]
 
 [[package]]
@@ -12978,10 +12994,12 @@
  "substrate-prometheus-endpoint",
  "tokio",
  "try-runtime-cli",
+ "uc-rpc",
  "unique-rpc",
  "unique-runtime",
  "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
 ]
 
@@ -13032,6 +13050,7 @@
  "uc-rpc",
  "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
 ]
 
@@ -13125,6 +13144,7 @@
  "substrate-wasm-builder",
  "up-common",
  "up-data-structs",
+ "up-pov-estimate-rpc",
  "up-rpc",
  "up-sponsorship",
  "xcm",
@@ -13194,6 +13214,19 @@
 ]
 
 [[package]]
+name = "up-pov-estimate-rpc"
+version = "0.1.0"
+dependencies = [
+ "parity-scale-codec 3.2.1",
+ "scale-info",
+ "serde",
+ "sp-api",
+ "sp-core",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
 name = "up-rpc"
 version = "0.1.3"
 dependencies = [
modifiedclient/rpc/Cargo.tomldiffbeforeafterboth
--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -7,16 +7,40 @@
 [dependencies]
 pallet-common = { default-features = false, path = '../../pallets/common' }
 up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
+up-common = { default-features = false, path = '../../primitives/common' }
 up-rpc = { path = "../../primitives/rpc" }
 app-promotion-rpc = { path = "../../primitives/app_promotion_rpc" }
 rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", optional = true }
 codec = { package = "parity-scale-codec", version = "3.1.2" }
 jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
 anyhow = "1.0.57"
+zstd = { version = "0.11.2", default-features = false }
 
+sc-rpc-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+
+frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+
+sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+
+unique-runtime = { path = '../../runtime/unique', optional = true }
+quartz-runtime = { path = '../../runtime/quartz', optional = true }
+opal-runtime = { path = '../../runtime/opal' }
+
+[features]
+pov-estimate = [
+    'up-pov-estimate-rpc',
+    'unique-runtime?/pov-estimate',
+    'quartz-runtime?/pov-estimate',
+    'opal-runtime/pov-estimate',
+]
modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -42,6 +42,9 @@
 pub use app_promotion_unique_rpc::AppPromotionApiServer;
 pub use rmrk_unique_rpc::RmrkApiServer;
 
+#[cfg(feature = "pov-estimate")]
+pub mod pov_estimate;
+
 #[rpc(server)]
 #[async_trait]
 pub trait UniqueApi<BlockHash, CrossAccountId, AccountId> {
@@ -420,17 +423,18 @@
 	}
 }
 
+#[macro_export]
 macro_rules! define_struct_for_server_api {
-	($name:ident) => {
-		pub struct $name<C, P> {
-			client: Arc<C>,
-			_marker: std::marker::PhantomData<P>,
+	($name:ident { $($arg:ident: $arg_ty:ty),+ $(,)? }) => {
+		pub struct $name<Client, Block: BlockT> {
+			$($arg: $arg_ty),+,
+			_marker: std::marker::PhantomData<Block>,
 		}
 
-		impl<C, P> $name<C, P> {
-			pub fn new(client: Arc<C>) -> Self {
+		impl<Client, Block: BlockT> $name<Client, Block> {
+			pub fn new($($arg: $arg_ty),+) -> Self {
 				Self {
-					client,
+					$($arg),+,
 					_marker: Default::default(),
 				}
 			}
@@ -438,9 +442,23 @@
 	};
 }
 
-define_struct_for_server_api!(Unique);
-define_struct_for_server_api!(AppPromotion);
-define_struct_for_server_api!(Rmrk);
+define_struct_for_server_api! {
+	Unique {
+		client: Arc<Client>
+	}
+}
+
+define_struct_for_server_api! {
+	AppPromotion {
+		client: Arc<Client>
+	}
+}
+
+define_struct_for_server_api! {
+	Rmrk {
+		client: Arc<Client>
+	}
+}
 
 macro_rules! pass_method {
 	(
addedclient/rpc/src/pov_estimate.rsdiffbeforeafterboth
--- /dev/null
+++ b/client/rpc/src/pov_estimate.rs
@@ -0,0 +1,205 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use std::sync::Arc;
+
+use codec::Encode;
+
+use up_pov_estimate_rpc::{PovEstimateApi as PovEstimateRuntimeApi};
+use up_common::types::opaque::RuntimeId;
+
+use sc_service::{NativeExecutionDispatch, config::ExecutionStrategy};
+use sp_state_machine::{StateMachine, TrieBackendBuilder};
+
+use jsonrpsee::{
+	core::RpcResult as Result,
+	proc_macros::rpc,
+};
+use anyhow::anyhow;
+
+use sc_client_api::backend::Backend;
+use sp_blockchain::HeaderBackend;
+use sp_api::{AsTrieBackend, BlockId, BlockT, ProvideRuntimeApi};
+
+use sc_executor::NativeElseWasmExecutor;
+use sc_rpc_api::DenyUnsafe;
+
+use sp_runtime::traits::Header;
+
+use up_pov_estimate_rpc::PovInfo;
+
+use crate::define_struct_for_server_api;
+
+type HasherOf<Block> = <<Block as BlockT>::Header as Header>::Hashing;
+type StateOf<Block> = <sc_service::TFullBackend<Block> as Backend<Block>>::State;
+
+pub struct ExecutorParams {
+	pub wasm_method: sc_service::config::WasmExecutionMethod,
+	pub default_heap_pages: Option<u64>,
+	pub max_runtime_instances: usize,
+	pub runtime_cache_size: u8,
+}
+
+#[cfg(feature = "unique-runtime")]
+pub struct UniqueRuntimeExecutor;
+
+#[cfg(feature = "quartz-runtime")]
+pub struct QuartzRuntimeExecutor;
+
+pub struct OpalRuntimeExecutor;
+
+#[cfg(feature = "unique-runtime")]
+impl NativeExecutionDispatch for UniqueRuntimeExecutor {
+	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
+
+	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
+		unique_runtime::api::dispatch(method, data)
+	}
+
+	fn native_version() -> sc_executor::NativeVersion {
+		unique_runtime::native_version()
+	}
+}
+
+#[cfg(feature = "quartz-runtime")]
+impl NativeExecutionDispatch for QuartzRuntimeExecutor {
+	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
+
+	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
+		quartz_runtime::api::dispatch(method, data)
+	}
+
+	fn native_version() -> sc_executor::NativeVersion {
+		quartz_runtime::native_version()
+	}
+}
+
+impl NativeExecutionDispatch for OpalRuntimeExecutor {
+	type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
+
+	fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
+		opal_runtime::api::dispatch(method, data)
+	}
+
+	fn native_version() -> sc_executor::NativeVersion {
+		opal_runtime::native_version()
+	}
+}
+
+#[cfg(feature = "pov-estimate")]
+define_struct_for_server_api! {
+	PovEstimate {
+		client: Arc<Client>,
+		backend: Arc<sc_service::TFullBackend<Block>>,
+		deny_unsafe: DenyUnsafe,
+		exec_params: ExecutorParams,
+		runtime_id: RuntimeId,
+	}
+}
+
+#[rpc(server)]
+#[async_trait]
+pub trait PovEstimateApi<BlockHash> {
+    #[method(name = "unique_povEstimate")]
+    fn pov_estimate(&self, encoded_xt: Vec<u8>, at: Option<BlockHash>) -> Result<PovInfo>;
+}
+
+#[allow(deprecated)]
+#[cfg(feature = "pov-estimate")]
+impl<C, Block>
+	PovEstimateApiServer<<Block as BlockT>::Hash> for PovEstimate<C, Block>
+where
+	Block: BlockT,
+	C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
+	C::Api: PovEstimateRuntimeApi<Block>,
+{
+	fn pov_estimate(&self, encoded_xt: Vec<u8>, at: Option<<Block as BlockT>::Hash>,) -> Result<PovInfo> {
+        self.deny_unsafe.check_if_safe()?;
+
+		let at = BlockId::<Block>::hash(at.unwrap_or_else(|| self.client.info().best_hash));
+		let state = self.backend.state_at(at).map_err(|_| anyhow!("unable to fetch the state at {at:?}"))?;
+        match &self.runtime_id {
+            #[cfg(feature = "unique-runtime")]
+            RuntimeId::Unique => execute_extrinsic_in_sandbox::<Block, UniqueRuntimeExecutor>(state, &self.exec_params, encoded_xt),
+
+            #[cfg(feature = "quartz-runtime")]
+            RuntimeId::Quartz => execute_extrinsic_in_sandbox::<Block, QuartzRuntimeExecutor>(state, &self.exec_params, encoded_xt),
+
+            RuntimeId::Opal => execute_extrinsic_in_sandbox::<Block, OpalRuntimeExecutor>(state, &self.exec_params, encoded_xt),
+
+            runtime_id => Err(anyhow!("unknown runtime id {:?}", runtime_id).into()),
+        }
+	}
+}
+
+fn execute_extrinsic_in_sandbox<Block, D>(state: StateOf<Block>, exec_params: &ExecutorParams, encoded_xt: Vec<u8>) -> Result<PovInfo>
+where
+    Block: BlockT,
+    D: NativeExecutionDispatch + 'static,
+{
+    let backend = state.as_trie_backend().clone();
+    let mut changes = Default::default();
+    let runtime_code_backend = sp_state_machine::backend::BackendRuntimeCode::new(backend);
+
+    let proving_backend =
+        TrieBackendBuilder::wrap(&backend).with_recorder(Default::default()).build();
+
+    let runtime_code = runtime_code_backend.runtime_code()
+        .map_err(|_| anyhow!("runtime code backend creation failed"))?;
+
+    let pre_root = *backend.root();
+
+    let executor = NativeElseWasmExecutor::<D>::new(
+        exec_params.wasm_method,
+        exec_params.default_heap_pages,
+        exec_params.max_runtime_instances,
+        exec_params.runtime_cache_size,
+    );
+    let execution = ExecutionStrategy::NativeElseWasm;
+
+    StateMachine::new(
+        &proving_backend,
+        &mut changes,
+        &executor,
+        "PovEstimateApi_pov_estimate",
+        encoded_xt.as_slice(),
+        sp_externalities::Extensions::default(),
+        &runtime_code,
+        sp_core::testing::TaskExecutor::new(),
+    )
+    .execute(execution.into())
+    .map_err(|e| anyhow!("failed to execute the extrinsic {:?}", e))?;
+
+    let proof = proving_backend
+        .extract_proof()
+        .expect("A recorder was set and thus, a storage proof can be extracted; qed");
+    let proof_size = proof.encoded_size();
+    let compact_proof = proof
+        .clone()
+        .into_compact_proof::<HasherOf<Block>>(pre_root)
+        .map_err(|e| anyhow!("failed to generate compact proof {:?}", e))?;
+    let compact_proof_size = compact_proof.encoded_size();
+
+    let compressed_proof = zstd::stream::encode_all(&compact_proof.encode()[..], 0)
+            .map_err(|e| anyhow!("failed to generate compact proof {:?}", e))?;
+    let compressed_proof_size = compressed_proof.len();
+
+    Ok(PovInfo {
+        proof_size: proof_size as u64,
+        compact_proof_size: compact_proof_size as u64,
+        compressed_proof_size: compressed_proof_size as u64,
+    })
+}
modifiednode/cli/Cargo.tomldiffbeforeafterboth
--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -319,8 +319,10 @@
 pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
 
 unique-rpc = { default-features = false, path = "../rpc" }
+uc-rpc = { default-features = false, path = "../../client/rpc" }
 app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
 rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
 
 [features]
 default = ["opal-runtime"]
@@ -339,3 +341,10 @@
     'try-runtime-cli/try-runtime',
 ]
 sapphire-runtime = ['opal-runtime', 'opal-runtime/become-sapphire']
+pov-estimate = [
+    'unique-runtime?/pov-estimate',
+    'quartz-runtime?/pov-estimate',
+    'opal-runtime/pov-estimate',
+    'uc-rpc/pov-estimate',
+    'unique-rpc/pov-estimate',
+]
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -54,17 +54,6 @@
 #[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))]
 pub type DefaultChainSpec = OpalChainSpec;
 
-pub enum RuntimeId {
-	#[cfg(feature = "unique-runtime")]
-	Unique,
-
-	#[cfg(feature = "quartz-runtime")]
-	Quartz,
-
-	Opal,
-	Unknown(String),
-}
-
 #[cfg(not(feature = "unique-runtime"))]
 /// PARA_ID for Opal/Sapphire/Quartz
 const PARA_ID: u32 = 2095;
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -33,7 +33,7 @@
 // limitations under the License.
 
 use crate::{
-	chain_spec::{self, RuntimeId, RuntimeIdentification, ServiceId, ServiceIdentification},
+	chain_spec::{self, RuntimeIdentification, ServiceId, ServiceIdentification},
 	cli::{Cli, RelayChainCli, Subcommand},
 	service::{new_partial, start_node, start_dev_node},
 };
@@ -66,13 +66,13 @@
 use sp_runtime::traits::{AccountIdConversion, Block as BlockT};
 use std::{net::SocketAddr, time::Duration};
 
-use up_common::types::opaque::Block;
+use up_common::types::opaque::{Block, RuntimeId};
 
 macro_rules! no_runtime_err {
-	($chain_name:expr) => {
+	($runtime_id:expr) => {
 		format!(
-			"No runtime valid runtime was found for chain {}",
-			$chain_name
+			"No runtime valid runtime was found for chain {:#?}",
+			$runtime_id
 		)
 	};
 }
@@ -94,7 +94,7 @@
 				RuntimeId::Quartz => Box::new(chain_spec::QuartzChainSpec::from_json_file(path)?),
 
 				RuntimeId::Opal => chain_spec,
-				RuntimeId::Unknown(chain) => return Err(no_runtime_err!(chain)),
+				runtime_id => return Err(no_runtime_err!(runtime_id)),
 			}
 		}
 	})
@@ -147,7 +147,7 @@
 			RuntimeId::Quartz => &quartz_runtime::VERSION,
 
 			RuntimeId::Opal => &opal_runtime::VERSION,
-			RuntimeId::Unknown(chain) => panic!("{}", no_runtime_err!(chain)),
+			runtime_id => panic!("{}", no_runtime_err!(runtime_id)),
 		}
 	}
 }
@@ -235,7 +235,7 @@
 				runner, $components, $cli, $cmd, $config, $( $code )*
 			),
 
-			RuntimeId::Unknown(chain) => Err(no_runtime_err!(chain).into())
+			runtime_id => Err(no_runtime_err!(runtime_id).into())
 		}
 	}}
 }
@@ -274,7 +274,7 @@
 				runner, $components, $cli, $cmd, $config, $( $code )*
 			),
 
-			RuntimeId::Unknown(chain) => Err(no_runtime_err!(chain).into())
+			runtime_id => Err(no_runtime_err!(runtime_id).into())
 		}
 	}}
 }
@@ -302,7 +302,7 @@
 				OpalRuntimeExecutor,
 			>($config $(, $($args),+)?) $($code)*,
 
-			RuntimeId::Unknown(chain) => Err(no_runtime_err!(chain).into()),
+			runtime_id => Err(no_runtime_err!(runtime_id).into()),
 		}
 	};
 }
@@ -445,7 +445,7 @@
 							sp_io::SubstrateHostFunctions,
 							<OpalRuntimeExecutor as NativeExecutionDispatch>::ExtendHostFunctions,
 						>>()),
-						RuntimeId::Unknown(chain) => return Err(no_runtime_err!(chain).into()),
+						runtime_id => return Err(no_runtime_err!(runtime_id).into()),
 					},
 					task_manager,
 				))
modifiednode/cli/src/service.rsdiffbeforeafterboth
--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -66,9 +66,8 @@
 use fc_rpc_core::types::FilterPool;
 use fc_mapping_sync::{MappingSyncWorker, SyncStrategy};
 
-use up_common::types::opaque::{
-	AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber,
-};
+use up_common::types::opaque::*;
+use crate::chain_spec::RuntimeIdentification;
 
 // RMRK
 use up_data_structs::{
@@ -412,7 +411,8 @@
 			RmrkBaseInfo<AccountId>,
 			RmrkPartType,
 			RmrkTheme,
-		> + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+		> + up_pov_estimate_rpc::PovEstimateApi<Block>
+		+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
 		+ sp_api::Metadata<Block>
 		+ sp_offchain::OffchainWorkerApi<Block>
 		+ cumulus_primitives_core::CollectCollationInfo<Block>,
@@ -517,9 +517,25 @@
 		.for_each(|()| futures::future::ready(())),
 	);
 
+	let rpc_backend = backend.clone();
+	let runtime_id = parachain_config.chain_spec.runtime_id();
 	let rpc_builder = Box::new(move |deny_unsafe, subscription_task_executor| {
 		let full_deps = unique_rpc::FullDeps {
-			backend: rpc_frontier_backend.clone(),
+			#[cfg(feature = "pov-estimate")]
+			runtime_id: runtime_id.clone(),
+
+			#[cfg(feature = "pov-estimate")]
+			exec_params: uc_rpc::pov_estimate::ExecutorParams {
+				wasm_method: parachain_config.wasm_method,
+				default_heap_pages: parachain_config.default_heap_pages,
+				max_runtime_instances: parachain_config.max_runtime_instances,
+				runtime_cache_size: parachain_config.runtime_cache_size,
+			},
+
+			#[cfg(feature = "pov-estimate")]
+			backend: rpc_backend.clone(),
+
+			eth_backend: rpc_frontier_backend.clone(),
 			deny_unsafe,
 			client: rpc_client.clone(),
 			pool: rpc_pool.clone(),
@@ -720,7 +736,8 @@
 			RmrkBaseInfo<AccountId>,
 			RmrkPartType,
 			RmrkTheme,
-		> + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+		> + up_pov_estimate_rpc::PovEstimateApi<Block>
+		+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
 		+ sp_api::Metadata<Block>
 		+ sp_offchain::OffchainWorkerApi<Block>
 		+ cumulus_primitives_core::CollectCollationInfo<Block>
@@ -869,7 +886,8 @@
 			RmrkBaseInfo<AccountId>,
 			RmrkPartType,
 			RmrkTheme,
-		> + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+		> + up_pov_estimate_rpc::PovEstimateApi<Block>
+		+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
 		+ sp_api::Metadata<Block>
 		+ sp_offchain::OffchainWorkerApi<Block>
 		+ cumulus_primitives_core::CollectCollationInfo<Block>
@@ -1040,9 +1058,24 @@
 	let rpc_pool = transaction_pool.clone();
 	let rpc_network = network.clone();
 	let rpc_frontier_backend = frontier_backend.clone();
+	let rpc_backend = backend.clone();
+	let runtime_id = config.chain_spec.runtime_id();
 	let rpc_builder = Box::new(move |deny_unsafe, subscription_executor| {
 		let full_deps = unique_rpc::FullDeps {
-			backend: rpc_frontier_backend.clone(),
+			#[cfg(feature = "pov-estimate")]
+			runtime_id: runtime_id.clone(),
+
+			#[cfg(feature = "pov-estimate")]
+			exec_params: uc_rpc::pov_estimate::ExecutorParams {
+				wasm_method: config.wasm_method,
+				default_heap_pages: config.default_heap_pages,
+				max_runtime_instances: config.max_runtime_instances,
+				runtime_cache_size: config.runtime_cache_size,
+			},
+
+			#[cfg(feature = "pov-estimate")]
+			backend: rpc_backend.clone(),
+			eth_backend: rpc_frontier_backend.clone(),
 			deny_unsafe,
 			client: rpc_client.clone(),
 			pool: rpc_pool.clone(),
modifiednode/rpc/Cargo.tomldiffbeforeafterboth
--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -55,6 +55,7 @@
 up-rpc = { path = "../../primitives/rpc" }
 app-promotion-rpc = { path = "../../primitives/app_promotion_rpc" }
 rmrk-rpc = { path = "../../primitives/rmrk-rpc" }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc" }
 up-data-structs = { default-features = false, path = "../../primitives/data-structs" }
 
 [dependencies.serde]
@@ -65,3 +66,4 @@
 default = []
 std = []
 unique-runtime = []
+pov-estimate = ['uc-rpc/pov-estimate']
modifiednode/rpc/src/lib.rsdiffbeforeafterboth
--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -40,7 +40,7 @@
 use sc_service::TransactionPool;
 use std::{collections::BTreeMap, sync::Arc};
 
-use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance};
+use up_common::types::opaque::*;
 
 // RMRK
 use up_data_structs::{
@@ -48,6 +48,8 @@
 	RmrkPartType, RmrkTheme,
 };
 
+type FullBackend = sc_service::TFullBackend<Block>;
+
 /// Extra dependencies for GRANDPA
 pub struct GrandpaDeps<B> {
 	/// Voting round info.
@@ -82,8 +84,18 @@
 	pub deny_unsafe: DenyUnsafe,
 	/// EthFilterApi pool.
 	pub filter_pool: Option<FilterPool>,
-	/// Backend.
-	pub backend: Arc<fc_db::Backend<Block>>,
+	
+	#[cfg(feature = "pov-estimate")]
+	pub runtime_id: RuntimeId,
+	/// Executor params for PoV estimating
+	#[cfg(feature = "pov-estimate")]
+	pub exec_params: uc_rpc::pov_estimate::ExecutorParams,
+	/// Substrate Backend.
+	#[cfg(feature = "pov-estimate")]
+	pub backend: Arc<FullBackend>,
+
+	/// Ethereum Backend.
+	pub eth_backend: Arc<fc_db::Backend<Block>>,
 	/// Maximum number of logs in a query.
 	pub max_past_logs: u32,
 	/// Maximum fee history cache size.
@@ -162,6 +174,7 @@
 		RmrkPartType,
 		RmrkTheme,
 	>,
+	C::Api: up_pov_estimate_rpc::PovEstimateApi<Block>,
 	B: sc_client_api::Backend<Block> + Send + Sync + 'static,
 	B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
 	P: TransactionPool<Block = Block> + 'static,
@@ -182,6 +195,9 @@
 	#[cfg(not(feature = "unique-runtime"))]
 	use uc_rpc::{RmrkApiServer, Rmrk};
 
+	#[cfg(feature = "pov-estimate")]
+	use uc_rpc::pov_estimate::{PovEstimateApiServer, PovEstimate};
+
 	// use pallet_contracts_rpc::{Contracts, ContractsApi};
 	use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
 	use substrate_frame_rpc_system::{System, SystemApiServer};
@@ -200,7 +216,17 @@
 		network,
 		deny_unsafe,
 		filter_pool,
+
+		#[cfg(feature = "pov-estimate")]
+		runtime_id,
+
+		#[cfg(feature = "pov-estimate")]
+		exec_params,
+
+		#[cfg(feature = "pov-estimate")]
 		backend,
+
+		eth_backend,
 		max_past_logs,
 	} = deps;
 
@@ -226,7 +252,7 @@
 			network.clone(),
 			signers,
 			overrides.clone(),
-			backend.clone(),
+			eth_backend.clone(),
 			is_authority,
 			block_data_cache.clone(),
 			fee_history_cache,
@@ -244,11 +270,14 @@
 	#[cfg(not(feature = "unique-runtime"))]
 	io.merge(Rmrk::new(client.clone()).into_rpc())?;
 
+	#[cfg(feature = "pov-estimate")]
+	io.merge(PovEstimate::new(client.clone(), backend, deny_unsafe, exec_params, runtime_id).into_rpc())?;
+
 	if let Some(filter_pool) = filter_pool {
 		io.merge(
 			EthFilter::new(
 				client.clone(),
-				backend,
+				eth_backend,
 				filter_pool,
 				500_usize, // max stored filters
 				max_past_logs,
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -23,6 +23,7 @@
 evm-coder = { default-features = false, path = '../../crates/evm-coder' }
 ethereum = { version = "0.14.0", default-features = false }
 pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
+up-pov-estimate-rpc = { default-features = false, path = "../../primitives/pov-estimate-rpc" }
 
 serde = { version = "1.0.130", default-features = false }
 scale-info = { version = "2.0.1", default-features = false, features = [
@@ -39,6 +40,7 @@
     "fp-evm-mapping/std",
     "up-data-structs/std",
     "pallet-evm/std",
+    "up-pov-estimate-rpc/std",
 ]
 runtime-benchmarks = [
     "frame-benchmarking/runtime-benchmarks",
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -115,6 +115,7 @@
 	RmrkNftChild,
 	CollectionPermissions,
 };
+use up_pov_estimate_rpc::PovInfo;
 
 pub use pallet::*;
 use sp_core::H160;
@@ -881,6 +882,8 @@
 				RmrkPartType,
 				RmrkBoundedTheme,
 				RmrkNftChild,
+				// PoV Estimate Info
+				PovInfo,
 			)>,
 		),
 		QueryKind = OptionQuery,
modifiedprimitives/common/src/types.rsdiffbeforeafterboth
--- a/primitives/common/src/types.rs
+++ b/primitives/common/src/types.rs
@@ -29,6 +29,14 @@
 
 	pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId};
 
+	#[derive(Debug, Clone)]
+	pub enum RuntimeId {
+		Unique,
+		Quartz,
+		Opal,
+		Unknown(sp_std::vec::Vec<u8>),
+	}
+
 	/// Opaque block header type.
 	pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
 
addedprimitives/pov-estimate-rpc/Cargo.tomldiffbeforeafterboth
--- /dev/null
+++ b/primitives/pov-estimate-rpc/Cargo.toml
@@ -0,0 +1,28 @@
+[package]
+name = "up-pov-estimate-rpc"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies]
+codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [
+	"derive",
+] }
+serde = { version = "1.0.130", features = ["derive"], default-features = false, optional = true }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
+
+[features]
+default = ["std"]
+std = [
+	"codec/std",
+	"serde/std",
+	"scale-info/std",
+	"sp-core/std",
+	"sp-std/std",
+	"sp-api/std",
+	"sp-runtime/std",
+]
addedprimitives/pov-estimate-rpc/src/lib.rsdiffbeforeafterboth
--- /dev/null
+++ b/primitives/pov-estimate-rpc/src/lib.rs
@@ -0,0 +1,39 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use codec::{Decode, Encode, MaxEncodedLen};
+use scale_info::TypeInfo;
+
+#[cfg(feature = "std")]
+use serde::Serialize;
+
+use sp_runtime::ApplyExtrinsicResult;
+
+#[cfg_attr(feature = "std", derive(Serialize))]
+#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)]
+pub struct PovInfo {
+    pub proof_size: u64,
+    pub compact_proof_size: u64,
+    pub compressed_proof_size: u64,
+}
+
+sp_api::decl_runtime_apis! {
+    pub trait PovEstimateApi {
+        fn pov_estimate(uxt: Block::Extrinsic) -> ApplyExtrinsicResult;
+    }
+}
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -39,7 +39,7 @@
         use sp_runtime::{
             Permill,
             traits::Block as BlockT,
-            transaction_validity::{TransactionSource, TransactionValidity},
+            transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError, InvalidTransaction},
             ApplyExtrinsicResult, DispatchError,
         };
         use fp_rpc::TransactionStatus;
@@ -778,6 +778,17 @@
                 }
             }
 
+            impl up_pov_estimate_rpc::PovEstimateApi<Block> for Runtime {
+                #[allow(unused_variables)]
+                fn pov_estimate(uxt: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
+                    #[cfg(feature = "pov-estimate")]
+                    return Executive::apply_extrinsic(uxt);
+
+                    #[cfg(not(feature = "pov-estimate"))]
+                    return Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
+                }
+            }
+
             #[cfg(feature = "try-runtime")]
             impl frame_try_runtime::TryRuntime<Block> for Runtime {
                 fn on_runtime_upgrade(checks: bool) -> (frame_support::pallet_prelude::Weight, frame_support::pallet_prelude::Weight) {
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -127,6 +127,7 @@
     'pallet-base-fee/std',
     'fp-rpc/std',
     'up-rpc/std',
+    'up-pov-estimate-rpc/std',
     'app-promotion-rpc/std',
     'fp-evm-mapping/std',
     'fp-self-contained/std',
@@ -184,6 +185,7 @@
     'pallet-test-utils',
 ]
 become-sapphire = []
+pov-estimate = []
 
 refungible = []
 scheduler = []
@@ -468,6 +470,7 @@
 derivative = "2.2.0"
 pallet-unique = { path = '../../pallets/unique', default-features = false }
 up-rpc = { path = "../../primitives/rpc", default-features = false }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
 app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
 rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }
 fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -122,6 +122,7 @@
     'pallet-base-fee/std',
     'fp-rpc/std',
     'up-rpc/std',
+    'up-pov-estimate-rpc/std',
     'app-promotion-rpc/std',
     'fp-evm-mapping/std',
     'fp-self-contained/std',
@@ -169,6 +170,7 @@
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 quartz-runtime = ['refungible', 'app-promotion', 'foreign-assets']
+pov-estimate = []
 
 refungible = []
 scheduler = []
@@ -461,6 +463,7 @@
 derivative = "2.2.0"
 pallet-unique = { path = '../../pallets/unique', default-features = false }
 up-rpc = { path = "../../primitives/rpc", default-features = false }
+up-pov-estimate-rpc = { path = "../../primitives/pov-estimate-rpc", default-features = false }
 app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }
 fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
 fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
before · runtime/unique/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std', 'unique-runtime']20runtime-benchmarks = [21    'hex-literal',22    'frame-benchmarking',23    'frame-support/runtime-benchmarks',24    'frame-system-benchmarking',25    'frame-system/runtime-benchmarks',26    'pallet-ethereum/runtime-benchmarks',27    'pallet-evm-migration/runtime-benchmarks',28    'pallet-evm-coder-substrate/runtime-benchmarks',29    'pallet-balances/runtime-benchmarks',30    'pallet-timestamp/runtime-benchmarks',31    'pallet-common/runtime-benchmarks',32    'pallet-structure/runtime-benchmarks',33    'pallet-fungible/runtime-benchmarks',34    'pallet-refungible/runtime-benchmarks',35    'pallet-nonfungible/runtime-benchmarks',36    'pallet-proxy-rmrk-core/runtime-benchmarks',37    'pallet-proxy-rmrk-equip/runtime-benchmarks',38    'pallet-unique/runtime-benchmarks',39    'pallet-foreign-assets/runtime-benchmarks',40    'pallet-inflation/runtime-benchmarks',41    'pallet-app-promotion/runtime-benchmarks',42    'pallet-xcm/runtime-benchmarks',43    'sp-runtime/runtime-benchmarks',44    'xcm-builder/runtime-benchmarks',45    'up-data-structs/runtime-benchmarks',46    'pallet-maintenance/runtime-benchmarks',47]48try-runtime = [49    'frame-try-runtime',50    'frame-executive/try-runtime',51    'frame-support/try-runtime',52    'frame-system/try-runtime',53    'cumulus-pallet-parachain-system/try-runtime',54    'parachain-info/try-runtime',55    'pallet-aura/try-runtime',56    'cumulus-pallet-aura-ext/try-runtime',57    'pallet-balances/try-runtime',58    'pallet-randomness-collective-flip/try-runtime',59    'pallet-timestamp/try-runtime',60    'pallet-transaction-payment/try-runtime',61    'pallet-treasury/try-runtime',62    'pallet-sudo/try-runtime',63    'orml-vesting/try-runtime',64    'orml-xtokens/try-runtime',65    'orml-tokens/try-runtime',66    'cumulus-pallet-xcmp-queue/try-runtime',67    'pallet-xcm/try-runtime',68    'cumulus-pallet-xcm/try-runtime',69    'cumulus-pallet-dmp-queue/try-runtime',70    'pallet-inflation/try-runtime',71    'pallet-unique/try-runtime',72    'pallet-configuration/try-runtime',73    'pallet-charge-transaction/try-runtime',74    'pallet-common/try-runtime',75    'pallet-fungible/try-runtime',76    'pallet-refungible/try-runtime',77    'pallet-nonfungible/try-runtime',78    'pallet-structure/try-runtime',79    'pallet-proxy-rmrk-core/try-runtime',80    'pallet-proxy-rmrk-equip/try-runtime',81    'pallet-app-promotion/try-runtime',82    'pallet-foreign-assets/try-runtime',83    'pallet-ethereum/try-runtime',84    'pallet-evm/try-runtime',85    'pallet-evm-coder-substrate/try-runtime',86    'pallet-evm-contract-helpers/try-runtime',87    'pallet-evm-transaction-payment/try-runtime',88    'pallet-evm-migration/try-runtime',89    'pallet-maintenance/try-runtime',90    'fp-self-contained/try-runtime',91]92std = [93    'codec/std',94    'cumulus-pallet-aura-ext/std',95    'cumulus-pallet-parachain-system/std',96    'cumulus-pallet-xcm/std',97    'cumulus-pallet-xcmp-queue/std',98    'cumulus-primitives-core/std',99    'cumulus-primitives-utility/std',100    'frame-try-runtime/std',101    'frame-executive/std',102    'frame-support/std',103    'frame-system/std',104    'frame-system-rpc-runtime-api/std',105    'pallet-aura/std',106    'pallet-balances/std',107    # 'pallet-contracts/std',108    # 'pallet-contracts-primitives/std',109    # 'pallet-contracts-rpc-runtime-api/std',110    # 'pallet-contract-helpers/std',111    'pallet-randomness-collective-flip/std',112    'pallet-sudo/std',113    'pallet-timestamp/std',114    'pallet-transaction-payment/std',115    'pallet-transaction-payment-rpc-runtime-api/std',116    'pallet-treasury/std',117    'pallet-evm/std',118    'pallet-evm-migration/std',119    'pallet-evm-contract-helpers/std',120    'pallet-evm-transaction-payment/std',121    'pallet-evm-coder-substrate/std',122    'pallet-ethereum/std',123    'pallet-base-fee/std',124    'fp-rpc/std',125    'up-rpc/std',126    'app-promotion-rpc/std',127    'fp-evm-mapping/std',128    'fp-self-contained/std',129    'parachain-info/std',130    'serde',131    'pallet-inflation/std',132    'pallet-configuration/std',133    'pallet-app-promotion/std',134    'pallet-common/std',135    'pallet-structure/std',136    'pallet-fungible/std',137    'pallet-refungible/std',138    'pallet-nonfungible/std',139    'pallet-proxy-rmrk-core/std',140    'pallet-proxy-rmrk-equip/std',141    'pallet-unique/std',142    'pallet-charge-transaction/std',143    'up-data-structs/std',144    'sp-api/std',145    'sp-block-builder/std',146    "sp-consensus-aura/std",147    'sp-core/std',148    'sp-inherents/std',149    'sp-io/std',150    'sp-offchain/std',151    'sp-runtime/std',152    'sp-session/std',153    'sp-std/std',154    'sp-transaction-pool/std',155    'sp-version/std',156    'xcm/std',157    'xcm-builder/std',158    'xcm-executor/std',159    'up-common/std',160    'rmrk-rpc/std',161    'evm-coder/std',162    'up-sponsorship/std',163164    "orml-vesting/std",165    "orml-tokens/std",166    "orml-xtokens/std",167    "orml-traits/std",168    "pallet-foreign-assets/std",169    "pallet-maintenance/std",170]171limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']172unique-runtime = ['foreign-assets']173stubgen = ["evm-coder/stubgen"]174175refungible = []176scheduler = []177rmrk = []178foreign-assets = []179180################################################################################181# Substrate Dependencies182183[dependencies.codec]184default-features = false185features = ['derive']186package = 'parity-scale-codec'187version = '3.1.2'188189[dependencies.frame-benchmarking]190default-features = false191git = "https://github.com/paritytech/substrate"192optional = true193branch = "polkadot-v0.9.36"194195[dependencies.frame-try-runtime]196default-features = false197git = "https://github.com/paritytech/substrate"198optional = true199branch = "polkadot-v0.9.36"200201[dependencies.frame-executive]202default-features = false203git = "https://github.com/paritytech/substrate"204branch = "polkadot-v0.9.36"205206[dependencies.frame-support]207default-features = false208git = "https://github.com/paritytech/substrate"209branch = "polkadot-v0.9.36"210211[dependencies.frame-system]212default-features = false213git = "https://github.com/paritytech/substrate"214branch = "polkadot-v0.9.36"215216[dependencies.frame-system-benchmarking]217default-features = false218git = "https://github.com/paritytech/substrate"219optional = true220branch = "polkadot-v0.9.36"221222[dependencies.frame-system-rpc-runtime-api]223default-features = false224git = "https://github.com/paritytech/substrate"225branch = "polkadot-v0.9.36"226227[dependencies.hex-literal]228optional = true229version = '0.3.3'230231[dependencies.serde]232default-features = false233features = ['derive']234optional = true235version = '1.0.130'236237[dependencies.pallet-aura]238default-features = false239git = "https://github.com/paritytech/substrate"240branch = "polkadot-v0.9.36"241242[dependencies.pallet-balances]243default-features = false244git = "https://github.com/paritytech/substrate"245branch = "polkadot-v0.9.36"246247# Contracts specific packages248# [dependencies.pallet-contracts]249# git = 'https://github.com/paritytech/substrate'250# default-features = false251# branch = 'master'252# version = '4.0.0-dev'253254# [dependencies.pallet-contracts-primitives]255# git = 'https://github.com/paritytech/substrate'256# default-features = false257# branch = 'master'258# version = '4.0.0-dev'259260# [dependencies.pallet-contracts-rpc-runtime-api]261# git = 'https://github.com/paritytech/substrate'262# default-features = false263# branch = 'master'264# version = '4.0.0-dev'265266[dependencies.pallet-randomness-collective-flip]267default-features = false268git = "https://github.com/paritytech/substrate"269branch = "polkadot-v0.9.36"270271[dependencies.pallet-sudo]272default-features = false273git = "https://github.com/paritytech/substrate"274branch = "polkadot-v0.9.36"275276[dependencies.pallet-timestamp]277default-features = false278git = "https://github.com/paritytech/substrate"279branch = "polkadot-v0.9.36"280281[dependencies.pallet-transaction-payment]282default-features = false283git = "https://github.com/paritytech/substrate"284branch = "polkadot-v0.9.36"285286[dependencies.pallet-transaction-payment-rpc-runtime-api]287default-features = false288git = "https://github.com/paritytech/substrate"289branch = "polkadot-v0.9.36"290291[dependencies.pallet-treasury]292default-features = false293git = "https://github.com/paritytech/substrate"294branch = "polkadot-v0.9.36"295296[dependencies.sp-arithmetic]297default-features = false298git = "https://github.com/paritytech/substrate"299branch = "polkadot-v0.9.36"300301[dependencies.sp-api]302default-features = false303git = "https://github.com/paritytech/substrate"304branch = "polkadot-v0.9.36"305306[dependencies.sp-block-builder]307default-features = false308git = "https://github.com/paritytech/substrate"309branch = "polkadot-v0.9.36"310311[dependencies.sp-core]312default-features = false313git = "https://github.com/paritytech/substrate"314branch = "polkadot-v0.9.36"315316[dependencies.sp-consensus-aura]317default-features = false318git = "https://github.com/paritytech/substrate"319branch = "polkadot-v0.9.36"320321[dependencies.sp-inherents]322default-features = false323git = "https://github.com/paritytech/substrate"324branch = "polkadot-v0.9.36"325326[dependencies.sp-io]327default-features = false328git = "https://github.com/paritytech/substrate"329branch = "polkadot-v0.9.36"330331[dependencies.sp-offchain]332default-features = false333git = "https://github.com/paritytech/substrate"334branch = "polkadot-v0.9.36"335336[dependencies.sp-runtime]337default-features = false338git = "https://github.com/paritytech/substrate"339branch = "polkadot-v0.9.36"340341[dependencies.sp-session]342default-features = false343git = "https://github.com/paritytech/substrate"344branch = "polkadot-v0.9.36"345346[dependencies.sp-std]347default-features = false348git = "https://github.com/paritytech/substrate"349branch = "polkadot-v0.9.36"350351[dependencies.sp-transaction-pool]352default-features = false353git = "https://github.com/paritytech/substrate"354branch = "polkadot-v0.9.36"355356[dependencies.sp-version]357default-features = false358git = "https://github.com/paritytech/substrate"359branch = "polkadot-v0.9.36"360361[dependencies.smallvec]362version = '1.6.1'363364################################################################################365# Cumulus dependencies366367[dependencies.parachain-info]368default-features = false369git = "https://github.com/paritytech/cumulus"370branch = "polkadot-v0.9.36"371372[dependencies.cumulus-pallet-aura-ext]373git = "https://github.com/paritytech/cumulus"374branch = "polkadot-v0.9.36"375default-features = false376377[dependencies.cumulus-pallet-parachain-system]378git = "https://github.com/paritytech/cumulus"379branch = "polkadot-v0.9.36"380default-features = false381382[dependencies.cumulus-primitives-core]383git = "https://github.com/paritytech/cumulus"384branch = "polkadot-v0.9.36"385default-features = false386387[dependencies.cumulus-pallet-xcm]388git = "https://github.com/paritytech/cumulus"389branch = "polkadot-v0.9.36"390default-features = false391392[dependencies.cumulus-pallet-dmp-queue]393git = "https://github.com/paritytech/cumulus"394branch = "polkadot-v0.9.36"395default-features = false396397[dependencies.cumulus-pallet-xcmp-queue]398git = "https://github.com/paritytech/cumulus"399branch = "polkadot-v0.9.36"400default-features = false401402[dependencies.cumulus-primitives-utility]403git = "https://github.com/paritytech/cumulus"404branch = "polkadot-v0.9.36"405default-features = false406407[dependencies.cumulus-primitives-timestamp]408git = "https://github.com/paritytech/cumulus"409branch = "polkadot-v0.9.36"410default-features = false411412################################################################################413# Polkadot dependencies414415[dependencies.polkadot-parachain]416git = "https://github.com/paritytech/polkadot"417branch = "release-v0.9.36"418default-features = false419420[dependencies.xcm]421git = "https://github.com/paritytech/polkadot"422branch = "release-v0.9.36"423default-features = false424425[dependencies.xcm-builder]426git = "https://github.com/paritytech/polkadot"427branch = "release-v0.9.36"428default-features = false429430[dependencies.xcm-executor]431git = "https://github.com/paritytech/polkadot"432branch = "release-v0.9.36"433default-features = false434435[dependencies.pallet-xcm]436git = "https://github.com/paritytech/polkadot"437branch = "release-v0.9.36"438default-features = false439440################################################################################441# local dependencies442443[dependencies]444orml-vesting.workspace = true445orml-xtokens.workspace = true446orml-tokens.workspace = true447orml-traits.workspace = true448449log = { version = "0.4.16", default-features = false }450up-common = { path = "../../primitives/common", default-features = false }451scale-info = { version = "2.0.1", default-features = false, features = [452    "derive",453] }454derivative = "2.2.0"455pallet-unique = { path = '../../pallets/unique', default-features = false }456up-rpc = { path = "../../primitives/rpc", default-features = false }457app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }458rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false }459pallet-inflation = { path = '../../pallets/inflation', default-features = false }460pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }461up-data-structs = { path = '../../primitives/data-structs', default-features = false }462pallet-configuration = { default-features = false, path = "../../pallets/configuration" }463pallet-common = { default-features = false, path = "../../pallets/common" }464pallet-structure = { default-features = false, path = "../../pallets/structure" }465pallet-fungible = { default-features = false, path = "../../pallets/fungible" }466pallet-refungible = { default-features = false, path = "../../pallets/refungible" }467pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }468pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }469pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }470# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }471pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.36", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }472pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }473pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }474pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }475pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }476pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }477pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }478pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }479fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }480fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }481fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }482fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }483pallet-evm-precompile-simple = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.36" }484evm-coder = { default-features = false, path = '../../crates/evm-coder' }485up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.36' }486pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }487pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" }488precompile-utils-macro = { path = "../common/ethereum/precompiles/utils/macro" }489num_enum = { version = "0.5.3", default-features = false }490491################################################################################492# Other Dependencies493494impl-trait-for-tuples = "0.2.2"495496################################################################################497# Dev Dependencies498499[dev-dependencies.logtest]500version = "2.0.0"501502################################################################################503# Build Dependencies504505[build-dependencies.substrate-wasm-builder]506git = "https://github.com/paritytech/substrate"507branch = "polkadot-v0.9.36"