diff --git a/Cargo.lock b/Cargo.lock index a939f4cde6..729741a02c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5508,6 +5508,7 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-bitacross", "pallet-bounties", "pallet-bridge", "pallet-bridge-transfer", @@ -5524,6 +5525,7 @@ dependencies = [ "pallet-proxy", "pallet-scheduler", "pallet-session", + "pallet-teebag", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/node/src/chain_specs/litentry.rs b/node/src/chain_specs/litentry.rs index 7ebd6bd69f..9590a5dbe7 100644 --- a/node/src/chain_specs/litentry.rs +++ b/node/src/chain_specs/litentry.rs @@ -17,9 +17,10 @@ use super::*; use cumulus_primitives_core::ParaId; use litentry_parachain_runtime::{ - AccountId, AuraId, Balance, BalancesConfig, CouncilMembershipConfig, GenesisConfig, - ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, SessionConfig, SystemConfig, - TechnicalCommitteeMembershipConfig, UNIT, WASM_BINARY, + AccountId, AuraId, Balance, BalancesConfig, BitacrossConfig, CouncilMembershipConfig, + GenesisConfig, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, SessionConfig, + SystemConfig, TechnicalCommitteeMembershipConfig, TeebagConfig, TeebagOperationalMode, UNIT, + WASM_BINARY, }; use sc_service::ChainType; use sc_telemetry::TelemetryEndpoints; @@ -230,5 +231,11 @@ fn generate_genesis( polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) }, transaction_payment: Default::default(), tokens: Default::default(), + teebag: TeebagConfig { + allow_sgx_debug_mode: true, + admin: None, + mode: TeebagOperationalMode::Development, + }, + bitacross: BitacrossConfig { admin: None }, } } diff --git a/runtime/litentry/Cargo.toml b/runtime/litentry/Cargo.toml index 4d9bc3dbfe..be600b960e 100644 --- a/runtime/litentry/Cargo.toml +++ b/runtime/litentry/Cargo.toml @@ -76,10 +76,12 @@ frame-system-benchmarking = { workspace = true, optional = true } core-primitives = { workspace = true } pallet-account-fix = { workspace = true } pallet-asset-manager = { workspace = true } +pallet-bitacross = { workspace = true } pallet-bridge = { workspace = true } pallet-bridge-transfer = { workspace = true } pallet-extrinsic-filter = { workspace = true } pallet-parachain-staking = { workspace = true } +pallet-teebag = { workspace = true } runtime-common = { workspace = true } fp-rpc = { workspace = true } @@ -124,6 +126,7 @@ runtime-benchmarks = [ "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", + "pallet-teebag/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", @@ -208,6 +211,8 @@ std = [ "pallet-bridge/std", "pallet-bridge-transfer/std", "pallet-extrinsic-filter/std", + "pallet-bitacross/std", + "pallet-teebag/std", "moonbeam-evm-tracer/std", "moonbeam-rpc-primitives-debug/std", "moonbeam-rpc-primitives-txpool/std", diff --git a/runtime/litentry/src/lib.rs b/runtime/litentry/src/lib.rs index 342f2c8c27..24aa4fdc35 100644 --- a/runtime/litentry/src/lib.rs +++ b/runtime/litentry/src/lib.rs @@ -59,10 +59,11 @@ pub use core_primitives::{ opaque, AccountId, Amount, AssetId, Balance, BlockNumber, Hash, Header, Index, Signature, DAYS, HOURS, MINUTES, SLOT_DURATION, }; +use pallet_ethereum::TransactionStatus; pub use runtime_common::currency::*; use runtime_common::{ impl_runtime_transaction_payment_fees, prod_or_fast, BlockHashCount, BlockLength, - CouncilInstance, CouncilMembershipInstance, EnsureRootOrAllCouncil, + CouncilInstance, CouncilMembershipInstance, EnsureEnclaveSigner, EnsureRootOrAllCouncil, EnsureRootOrAllTechnicalCommittee, EnsureRootOrHalfCouncil, EnsureRootOrHalfTechnicalCommittee, EnsureRootOrTwoThirdsCouncil, EnsureRootOrTwoThirdsTechnicalCommittee, NegativeImbalance, RuntimeBlockWeights, SlowAdjustingFeeUpdate, TechnicalCommitteeInstance, @@ -70,7 +71,10 @@ use runtime_common::{ }; use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; -use pallet_ethereum::TransactionStatus; +// for TEE +pub use pallet_balances::Call as BalancesCall; +pub use pallet_teebag::{self, OperationalMode as TeebagOperationalMode}; + // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); @@ -842,6 +846,24 @@ impl pallet_extrinsic_filter::Config for Runtime { type WeightInfo = weights::pallet_extrinsic_filter::WeightInfo; } +parameter_types! { + pub const MomentsPerDay: u64 = 86_400_000; // [ms/d] +} + +impl pallet_teebag::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MomentsPerDay = MomentsPerDay; + type SetAdminOrigin = EnsureRootOrHalfCouncil; + type MaxEnclaveIdentifier = ConstU32<3>; + type MaxAuthorizedEnclave = ConstU32<5>; +} + +impl pallet_bitacross::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type TEECallOrigin = EnsureEnclaveSigner; + type SetAdminOrigin = EnsureRootOrHalfCouncil; +} + impl runtime_common::BaseRuntimeRequirements for Runtime {} impl runtime_common::ParaRuntimeRequirements for Runtime {} @@ -912,6 +934,8 @@ construct_runtime! { BridgeTransfer: pallet_bridge_transfer = 61, ExtrinsicFilter: pallet_extrinsic_filter = 63, AssetManager: pallet_asset_manager = 64, + Teebag: pallet_teebag = 65, + Bitacross: pallet_bitacross = 66, // TMP AccountFix: pallet_account_fix = 254, @@ -977,7 +1001,11 @@ impl Contains for NormalModeFilter { // Balance RuntimeCall::Balances(_) | // AccountFix - RuntimeCall::AccountFix(_) + RuntimeCall::AccountFix(_) | + // TEE enclave management + RuntimeCall::Teebag(_) | + // Bitacross + RuntimeCall::Bitacross(_) ) } }