diff --git a/common/primitives/core/src/teebag/types.rs b/common/primitives/core/src/teebag/types.rs index 55190d981d..8dae4880cf 100644 --- a/common/primitives/core/src/teebag/types.rs +++ b/common/primitives/core/src/teebag/types.rs @@ -68,6 +68,7 @@ pub enum AttestationType { pub enum WorkerType { #[default] Identity, + BitAcross, OmniExecutor, } diff --git a/parachain/Cargo.lock b/parachain/Cargo.lock index 99ecbf01dc..570f9b7e5c 100644 --- a/parachain/Cargo.lock +++ b/parachain/Cargo.lock @@ -7460,6 +7460,22 @@ dependencies = [ "sp-state-machine", ] +[[package]] +name = "pallet-bitacross" +version = "0.1.0" +dependencies = [ + "core-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-bounties" version = "36.0.0" @@ -9250,6 +9266,7 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-bitacross", "pallet-bounties", "pallet-bridge-transfer", "pallet-chain-bridge", diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 5457d59786..1f7d120a9d 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -3,6 +3,7 @@ resolver = "2" members = [ 'node', 'pallets/account-fix', + 'pallets/bitacross', 'pallets/bridge/assets-handler', 'pallets/bridge/chain-bridge', 'pallets/bridge/bridge-transfer', @@ -167,11 +168,11 @@ sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "sta sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } # wasm @@ -273,6 +274,7 @@ paseo-parachain-runtime = { path = "runtime/paseo", default-features = false } pallet-account-fix = { path = "pallets/account-fix", default-features = false } pallet-asset-manager = { path = "pallets/xcm-asset-manager", default-features = false } pallet-assets-handler = { path = "pallets/bridge/assets-handler", default-features = false } +pallet-bitacross = { path = "pallets/bitacross", default-features = false } pallet-chain-bridge = { path = "pallets/bridge/chain-bridge", default-features = false } pallet-bridge-common = { path = "pallets/bridge/common", default-features = false } pallet-bridge-transfer = { path = "pallets/bridge/bridge-transfer", default-features = false } diff --git a/parachain/node/src/chain_specs/paseo.rs b/parachain/node/src/chain_specs/paseo.rs index 06346171e2..d72874568d 100644 --- a/parachain/node/src/chain_specs/paseo.rs +++ b/parachain/node/src/chain_specs/paseo.rs @@ -18,7 +18,7 @@ use super::*; use core_primitives::PASEO_PARA_ID; use cumulus_primitives_core::ParaId; use paseo_parachain_runtime::{ - AccountId, AuraId, Balance, BalancesConfig, CouncilMembershipConfig, + AccountId, AuraId, Balance, BalancesConfig, BitacrossConfig, CouncilMembershipConfig, DeveloperCommitteeMembershipConfig, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, RuntimeGenesisConfig, SessionConfig, SudoConfig, TechnicalCommitteeMembershipConfig, TeebagConfig, TeebagOperationalMode, VCManagementConfig, @@ -227,6 +227,7 @@ fn generate_genesis( admin: Some(root_key.clone()), mode: TeebagOperationalMode::Development, }, + bitacross: BitacrossConfig { admin: Some(root_key) }, score_staking: Default::default(), }; diff --git a/parachain/node/src/custom_txpool.rs b/parachain/node/src/custom_txpool.rs new file mode 100644 index 0000000000..40d51b0ac8 --- /dev/null +++ b/parachain/node/src/custom_txpool.rs @@ -0,0 +1,100 @@ +use futures::Future; +use sc_transaction_pool_api::{ + ImportNotificationStream, PoolFuture, PoolStatus, ReadyTransactions, TransactionFor, + TransactionPool, TransactionSource, TransactionStatusStreamFor, TxHash, +}; +use sp_runtime::traits::{Block as BlockT, NumberFor}; +use std::{collections::HashMap, pin::Pin, sync::Arc}; + +pub struct CustomPool { + inner_pool: Arc, +} + +impl CustomPool { + pub fn new(inner_pool: Arc) -> Self { + Self { inner_pool } + } +} + +impl TransactionPool for CustomPool +where + I: TransactionPool, +{ + type Block = I::Block; + type Hash = I::Hash; + type InPoolTransaction = I::InPoolTransaction; + type Error = I::Error; + + fn submit_at( + &self, + at: ::Hash, + source: TransactionSource, + xts: Vec>, + ) -> PoolFuture, Self::Error>>, Self::Error> { + self.inner_pool.submit_at(at, source, xts) + } + + fn submit_one( + &self, + at: ::Hash, + source: TransactionSource, + xt: TransactionFor, + ) -> PoolFuture, Self::Error> { + self.inner_pool.submit_one(at, source, xt) + } + + fn submit_and_watch( + &self, + at: ::Hash, + source: TransactionSource, + xt: TransactionFor, + ) -> PoolFuture>>, Self::Error> { + self.inner_pool.submit_and_watch(at, source, xt) + } + + fn remove_invalid(&self, _: &[TxHash]) -> Vec> { + // Don't do anything on purpose. + Vec::new() + } + + fn status(&self) -> PoolStatus { + self.inner_pool.status() + } + + fn import_notification_stream(&self) -> ImportNotificationStream> { + self.inner_pool.import_notification_stream() + } + + fn hash_of(&self, xt: &TransactionFor) -> TxHash { + self.inner_pool.hash_of(xt) + } + + fn on_broadcasted(&self, propagations: HashMap, Vec>) { + self.inner_pool.on_broadcasted(propagations) + } + + fn ready_transaction(&self, hash: &TxHash) -> Option> { + self.inner_pool.ready_transaction(hash) + } + + fn ready_at( + &self, + at: NumberFor, + ) -> Pin< + Box< + dyn Future< + Output = Box> + Send>, + > + Send, + >, + > { + self.inner_pool.ready_at(at) + } + + fn ready(&self) -> Box> + Send> { + self.inner_pool.ready() + } + + fn futures(&self) -> Vec { + self.inner_pool.futures() + } +} diff --git a/parachain/node/src/main.rs b/parachain/node/src/main.rs index bfdba099d8..0bf81a5634 100644 --- a/parachain/node/src/main.rs +++ b/parachain/node/src/main.rs @@ -19,6 +19,7 @@ mod chain_specs; mod cli; mod command; +mod custom_txpool; mod evm_tracing_types; mod rpc; mod service; diff --git a/parachain/node/src/service.rs b/parachain/node/src/service.rs index 5ae8821156..d31c11bd24 100644 --- a/parachain/node/src/service.rs +++ b/parachain/node/src/service.rs @@ -749,11 +749,17 @@ where let select_chain = maybe_select_chain .expect("In `standalone` mode, `new_partial` will return some `select_chain`; qed"); + // TODO: use fork-aware txpool when paritytech/polkadot-sdk#4639 is included in a stable release + // presumably in stable2412 + // This is a workaround mentioned in https://github.com/paritytech/polkadot-sdk/issues/1202 + let custom_txpool = + std::sync::Arc::new(crate::custom_txpool::CustomPool::new(transaction_pool.clone())); + if role.is_authority() { let proposer_factory = sc_basic_authorship::ProposerFactory::new( task_manager.spawn_handle(), client.clone(), - transaction_pool.clone(), + custom_txpool, None, None, ); @@ -1059,10 +1065,16 @@ where + cumulus_primitives_aura::AuraUnincludedSegmentApi + cumulus_primitives_core::CollectCollationInfo, { + // TODO: use fork-aware txpool when paritytech/polkadot-sdk#4639 is included in a stable release + // presumably in stable2412 + // This is a workaround mentioned in https://github.com/paritytech/polkadot-sdk/issues/1202 + let custom_txpool = + std::sync::Arc::new(crate::custom_txpool::CustomPool::new(transaction_pool.clone())); + let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), - transaction_pool, + custom_txpool, prometheus_registry, telemetry.clone(), ); diff --git a/parachain/runtime/paseo/Cargo.toml b/parachain/runtime/paseo/Cargo.toml index 8df201903c..2fb76e12e4 100644 --- a/parachain/runtime/paseo/Cargo.toml +++ b/parachain/runtime/paseo/Cargo.toml @@ -85,6 +85,7 @@ pallet-account-fix = { workspace = true } pallet-asset-manager = { workspace = true } pallet-assets = { workspace = true } pallet-assets-handler = { workspace = true } +pallet-bitacross = { workspace = true } pallet-bridge-transfer = { workspace = true } pallet-chain-bridge = { workspace = true } pallet-evm-assertions = { workspace = true } @@ -165,6 +166,7 @@ runtime-benchmarks = [ "pallet-asset-manager/runtime-benchmarks", "pallet-assets-handler/runtime-benchmarks", "pallet-assets/runtime-benchmarks", + "pallet-bitacross/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", "pallet-bridge-transfer/runtime-benchmarks", @@ -252,6 +254,7 @@ std = [ "pallet-aura/std", "pallet-authorship/std", "pallet-balances/std", + "pallet-bitacross/std", "pallet-bounties/std", "pallet-bridge-transfer/std", "pallet-chain-bridge/std", @@ -358,6 +361,7 @@ try-runtime = [ "pallet-aura/try-runtime", "pallet-authorship/try-runtime", "pallet-balances/try-runtime", + "pallet-bitacross/try-runtime", "pallet-bounties/try-runtime", "pallet-bridge-transfer/try-runtime", "pallet-chain-bridge/try-runtime", diff --git a/parachain/runtime/paseo/src/lib.rs b/parachain/runtime/paseo/src/lib.rs index e26a7825ab..38402cc395 100644 --- a/parachain/runtime/paseo/src/lib.rs +++ b/parachain/runtime/paseo/src/lib.rs @@ -233,7 +233,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { impl_name: create_runtime_str!("paseo-parachain"), authoring_version: 1, // same versioning-mechanism as polkadot: use last digit for minor updates - spec_version: 9220, + spec_version: 9221, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1253,6 +1253,12 @@ impl pallet_omni_account::Config for Runtime { type Permission = OmniAccountPermission; } +impl pallet_bitacross::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type TEECallOrigin = EnsureEnclaveSigner; + type SetAdminOrigin = EnsureRootOrAllCouncil; +} + impl pallet_evm_assertions::Config for Runtime { type RuntimeEvent = RuntimeEvent; type AssertionId = H160; @@ -1454,6 +1460,7 @@ construct_runtime! { VCManagement: pallet_vc_management = 66, IMPExtrinsicWhitelist: pallet_group:: = 67, VCMPExtrinsicWhitelist: pallet_group:: = 68, + Bitacross: pallet_bitacross = 70, EvmAssertions: pallet_evm_assertions = 71, // Developer council @@ -1583,6 +1590,7 @@ impl Contains for NormalModeFilter { // AccountFix RuntimeCall::AccountFix(_) | RuntimeCall::AssetsHandler(_) | + RuntimeCall::Bitacross(_) | RuntimeCall::EvmAssertions(_) | RuntimeCall::ScoreStaking(_) | RuntimeCall::OmniAccount(_) | diff --git a/parachain/zombienet/config.toml b/parachain/zombienet/config.toml index cb17da902b..a7a4209aa3 100644 --- a/parachain/zombienet/config.toml +++ b/parachain/zombienet/config.toml @@ -31,7 +31,6 @@ args = [ "--force-authoring", "--enable-evm-rpc", "--state-pruning=archive", - "--delayed-best-block", "-l=parachain=debug,txpool=trace" ] ws_port = {{COLLATOR_WS_PORT}} diff --git a/tee-worker/identity/client-api/parachain-api/CHANGELOG.md b/tee-worker/identity/client-api/parachain-api/CHANGELOG.md index da0121f5c7..9beeb06def 100644 --- a/tee-worker/identity/client-api/parachain-api/CHANGELOG.md +++ b/tee-worker/identity/client-api/parachain-api/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.21-next.0] - 2024-12-17 + +- Update for version [parachain-release v0.9.21-01](https://github.com/litentry/litentry-parachain/releases/tag/v0.9.21-01) + ## Added - Type definitions for the new OmniAccount Pallet under the name of `omniAccount`. diff --git a/tee-worker/identity/client-api/parachain-api/package.json b/tee-worker/identity/client-api/parachain-api/package.json index 113f2b4b06..d7241c376d 100644 --- a/tee-worker/identity/client-api/parachain-api/package.json +++ b/tee-worker/identity/client-api/parachain-api/package.json @@ -5,7 +5,7 @@ "main": "dist/src/index.js", "module": "dist/src/index.js", "sideEffects": false, - "version": "0.9.20-next.10", + "version": "0.9.21-next.0", "scripts": { "clean": "rm -rf dist build node_modules", "update-metadata": "curl -s -H \"Content-Type: application/json\" -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://localhost:9944 > prepare-build/litentry-parachain-metadata.json", diff --git a/tee-worker/identity/client-api/sidechain-api/CHANGELOG.md b/tee-worker/identity/client-api/sidechain-api/CHANGELOG.md index 07b6b90be5..c02a230d59 100644 --- a/tee-worker/identity/client-api/sidechain-api/CHANGELOG.md +++ b/tee-worker/identity/client-api/sidechain-api/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.21-next.0] - 2024-12-17 + +- Update for version [parachain-release v0.9.21-01](https://github.com/litentry/litentry-parachain/releases/tag/v0.9.21-01) + ## Added - Type definitions for the new OmniAccount Pallet. diff --git a/tee-worker/identity/client-api/sidechain-api/package.json b/tee-worker/identity/client-api/sidechain-api/package.json index dfb1de4e6e..3078479c1b 100644 --- a/tee-worker/identity/client-api/sidechain-api/package.json +++ b/tee-worker/identity/client-api/sidechain-api/package.json @@ -5,7 +5,7 @@ "main": "dist/src/index.js", "module": "dist/src/index.js", "sideEffects": false, - "version": "0.9.20-next.8", + "version": "0.9.21-next.0", "scripts": { "clean": "rm -rf dist build node_modules", "update-metadata": "../../bin/litentry-cli print-sgx-metadata-raw > prepare-build/litentry-sidechain-metadata.json",