From 7263ad53d4ae96bbfbb4675aa9f86e73ca210fa4 Mon Sep 17 00:00:00 2001 From: Nikola Todorovic Date: Thu, 27 Jul 2023 02:30:51 +0200 Subject: [PATCH 01/11] Testnet Release 1.2.0 - Sudo removal (#63) * Bump runtime version for Alphanet to 113 * Disable sudo in chain_spec * Remove sudo pallet --- Cargo.lock | 3 +-- node/src/chain_spec.rs | 12 ++++++------ runtime/Cargo.toml | 5 +---- runtime/src/lib.rs | 10 +--------- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14e04a9..866e3a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6015,7 +6015,7 @@ dependencies = [ [[package]] name = "origintrail-parachain-runtime" -version = "1.1.2" +version = "1.2.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -6056,7 +6056,6 @@ dependencies = [ "pallet-preimage", "pallet-scheduler", "pallet-session", - "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index f91d248..ce9552d 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,6 @@ use cumulus_primitives_core::ParaId; use origintrail_parachain_runtime::{AccountId, AuraId, - EVMConfig, EthereumConfig, Signature, SudoConfig, EXISTENTIAL_DEPOSIT}; + EVMConfig, EthereumConfig, Signature, EXISTENTIAL_DEPOSIT}; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; use serde::{Deserialize, Serialize}; @@ -181,7 +181,7 @@ pub fn local_testnet_config() -> ChainSpec { fn testnet_genesis( invulnerables: Vec<(AccountId, AuraId)>, - root_key: AccountId, + _root_key: AccountId, endowed_accounts: Vec, id: ParaId, ) -> origintrail_parachain_runtime::GenesisConfig { @@ -220,10 +220,10 @@ fn testnet_genesis( polkadot_xcm: origintrail_parachain_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, - sudo: SudoConfig { - // Assign network admin rights. - key: Some(root_key), - }, + // sudo: SudoConfig { + // // Assign network admin rights. + // key: Some(root_key), + // }, vesting: Default::default(), treasury: Default::default(), evm: EVMConfig { diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 98cfb22..8acc779 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "origintrail-parachain-runtime" -version = "1.1.2" +version = "1.2.0" authors = ["TraceLabs"] description = "OriginTrail Parachain Runtime - Cumulus FRAME-based Substrate Runtime" license = "GPL-3.0-only" @@ -39,7 +39,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.40" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } @@ -136,7 +135,6 @@ std = [ "pallet-preimage/std", "pallet-scheduler/std", "pallet-session/std", - "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", @@ -211,7 +209,6 @@ try-runtime = [ "pallet-preimage/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", - "pallet-sudo/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", "pallet-timestamp/try-runtime", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index ff7a159..df0b614 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -250,7 +250,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("origintrail-parachain"), impl_name: create_runtime_str!("origintrail-parachain"), authoring_version: 1, - spec_version: 112, + spec_version: 120, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -620,11 +620,6 @@ impl pallet_scheduler::Config for Runtime { type OriginPrivilegeCmp = EqualPrivilegeOnly; } -impl pallet_sudo::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} - parameter_types! { pub const MinVestedTransfer: Balance = 15 * OTP; pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = @@ -1091,9 +1086,6 @@ construct_runtime!( Council: pallet_collective:: = 62, Democracy: pallet_democracy = 63, Identity: pallet_identity = 64, - - // Temporary. - Sudo: pallet_sudo = 255, } ); From 1f07b94890d7d855fd3f5837c5af83637f02f3cc Mon Sep 17 00:00:00 2001 From: NZT48 Date: Thu, 27 Jul 2023 00:33:20 +0000 Subject: [PATCH 02/11] Update Evm chain id for testnet --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index df0b614..ab1d631 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -784,7 +784,7 @@ impl> FindAuthor for FindAuthorTruncated { } parameter_types! { - pub const ChainId: u64 = 2043; + pub const ChainId: u64 = 20430; pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS); pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::new(); pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); From 5442eec8e54ac35480e7776e1b944ff890e02698 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Fri, 25 Aug 2023 15:57:26 +0100 Subject: [PATCH 03/11] Added multisig pallet to the runtime --- Cargo.lock | 71 +++++++++++++++++++++++----------------------- runtime/Cargo.toml | 4 ++- runtime/src/lib.rs | 18 +++++++++++- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 866e3a6..47bd97b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -445,7 +445,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -727,9 +727,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bounded-collections" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbd1d11282a1eb134d3c3b7cf8ce213b5161c6e5f73fb1b98618482c606b64" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ "log", "parity-scale-codec", @@ -1045,7 +1045,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -1979,7 +1979,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -1996,7 +1996,7 @@ checksum = "4a076022ece33e7686fb76513518e219cca4fce5750a8ae6d1ce6c0f48fd1af9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -2249,7 +2249,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -2409,7 +2409,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -2420,7 +2420,7 @@ checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -3575,7 +3575,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -6015,7 +6015,7 @@ dependencies = [ [[package]] name = "origintrail-parachain-runtime" -version = "1.2.0" +version = "1.2.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -6053,6 +6053,7 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-identity", + "pallet-multisig", "pallet-preimage", "pallet-scheduler", "pallet-session", @@ -7339,9 +7340,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.5.0" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -7354,9 +7355,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7514,7 +7515,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -7555,7 +7556,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -8959,9 +8960,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -9125,9 +9126,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -9330,7 +9331,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -11117,22 +11118,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -12405,9 +12406,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -12505,7 +12506,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -12685,7 +12686,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -12814,7 +12815,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -13287,7 +13288,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -13321,7 +13322,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14426,7 +14427,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 8acc779..d7defbb 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "origintrail-parachain-runtime" -version = "1.2.0" +version = "1.2.1" authors = ["TraceLabs"] description = "OriginTrail Parachain Runtime - Cumulus FRAME-based Substrate Runtime" license = "GPL-3.0-only" @@ -37,6 +37,7 @@ pallet-assets = { git = "https://github.com/paritytech/substrate", default-featu pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.40" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } @@ -133,6 +134,7 @@ std = [ "pallet-ethereum/std", "pallet-identity/std", "pallet-preimage/std", + "pallet-multisig/std", "pallet-scheduler/std", "pallet-session/std", "pallet-timestamp/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index df0b614..61eb381 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -250,7 +250,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("origintrail-parachain"), impl_name: create_runtime_str!("origintrail-parachain"), authoring_version: 1, - spec_version: 120, + spec_version: 121, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -548,6 +548,21 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; } +parameter_types! { + pub const DepositBase: Balance = deposit(1, 88); + pub const DepositFactor: Balance = deposit(0, 32); +} + +impl pallet_multisig::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = ConstU32<100>; + type WeightInfo = pallet_multisig::weights::SubstrateWeight; +} + parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; @@ -1052,6 +1067,7 @@ construct_runtime!( Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, Utility: pallet_utility = 4, + Multisig: pallet_multisig = 5, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, From 0725cb2c3b9ddacf8b1e4258bf7edbe921e8949b Mon Sep 17 00:00:00 2001 From: NZT48 Date: Thu, 31 Aug 2023 13:23:24 +0000 Subject: [PATCH 04/11] Resolve conflicts --- Cargo.lock | 1 - runtime/Cargo.toml | 3 --- runtime/src/lib.rs | 7 ------- 3 files changed, 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d54e80..7343abb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6056,7 +6056,6 @@ dependencies = [ "pallet-preimage", "pallet-scheduler", "pallet-session", - "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 5e7048a..c4aff6a 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -39,7 +39,6 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", default-f pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.40" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } -pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } @@ -136,7 +135,6 @@ std = [ "pallet-preimage/std", "pallet-scheduler/std", "pallet-session/std", - "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", @@ -211,7 +209,6 @@ try-runtime = [ "pallet-preimage/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", - "pallet-sudo/try-runtime", "pallet-utility/try-runtime", "pallet-vesting/try-runtime", "pallet-timestamp/try-runtime", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 49acd87..6c62210 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1037,11 +1037,6 @@ impl pallet_identity::Config for Runtime { type WeightInfo = pallet_identity::weights::SubstrateWeight; } -impl pallet_sudo::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; -} - // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -1091,8 +1086,6 @@ construct_runtime!( Council: pallet_collective:: = 62, Democracy: pallet_democracy = 63, Identity: pallet_identity = 64, - - Sudo: pallet_sudo = 255, } ); From 0accb9d541f755eed0fbe5a7aceb3e9b173bb2e0 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Thu, 21 Sep 2023 14:33:53 +0200 Subject: [PATCH 05/11] Added step to free disk space on Ubuntu container used for running tests in the github actions --- .github/workflows/test-code.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 2452153..64cb619 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -21,6 +21,14 @@ jobs: runs-on: ubuntu-22.04 steps: + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h - name: Checkout Code uses: actions/checkout@v3 From 1811a0c0dd8e16af4baf0174c3ca1704ad51373a Mon Sep 17 00:00:00 2001 From: Nikola Todorovic Date: Wed, 17 Jan 2024 16:56:08 +0100 Subject: [PATCH 06/11] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e72972e..f7014fd 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -# OriginTrail Parachain Node +# NeuroWeb Node
- + [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Substrate version](https://img.shields.io/badge/Substrate-3.0.0-brightgreen?logo=Parity%20Substrate)](https://substrate.io) -[![Twitter URL](https://img.shields.io/twitter/follow/OT_Parachain?style=social)](https://twitter.com/OT_Parachain) +[![Twitter URL](https://img.shields.io/twitter/follow/NeuroWebAI?style=social)](https://twitter.com/NeuroWebAI) [![Telegram](https://img.shields.io/endpoint?color=neon&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Forigintrail)](https://t.me/origintrail) [![Medium](https://badgen.net/badge/icon/medium?icon=medium&label)](https://medium.com/origintrail) [![Discord](https://img.shields.io/badge/Discord-gray?logo=discord)](https://discord.gg/FCgYk2S)
-The OriginTrail Parachain is the next-generation L1 blockchain designed to tightly integrate with the OriginTrail DKG. As an OriginTrail-tailored blockchain it is optimized for maximum performance and usability in the OriginTrail consensus layer. It leverages the strong trust model and inherent interoperability of Polkadot, enabling smooth integration with other Polkadot ecosystem projects. +NeuroWeb Network is a decentralized Artificial Intelligence blockchain designed to incentivise knowledge creation, connectivity and sharing through **Knowledge Mining**. It's utility token NEURO is designed to fuel the AI knowledge economy, rewarding relevant knowledge contributions to the **OriginTrail Decentralized Knowledge Graph**. -![](https://parachain.origintrail.io/storage/whitepaper-content/April2022/img-otl-ayer-2@2x.jpg) - -OriginTrail Parachain node is built with [Substrate](https://substrate.dev) framework. +- NeuroWeb builds on the basis of its predecessor - the OriginTrail Parachain - which was transformed into NeuroWeb via a community Governance vote on OriginTrail Parachain in December 2023. +- NeuroWeb is a permissionless, EVM enabled blockchain secured by Polkadot validators. +- NeuroWeb node is built with [Substrate](https://substrate.dev) framework. ## Build & Run @@ -41,14 +41,14 @@ cargo build --release ### Run a network -To run a full network with multiple OriginTrail parachain nodes (collators and non-collators), first we need to start relay chain, and after that our parachain. +To run a full network with multiple NeuroWeb nodes (collators and non-collators), first we need to start relay chain, and after that our parachain. ![](https://parachain.origintrail.io/storage/whitepaper-content/April2022/img-flow-chart@2x.png) #### Run A Relay Chain To start a relay chain we recommend reading and following instructions in [Cumulus Workshop](https://docs.substrate.io/tutorials/build-a-parachain/prepare-a-local-relay-chain/). -OriginTrail parachain is currently compatible with Polkadot v0.9.40 version. +NeuroWeb is currently compatible with Polkadot v0.9.40 version. #### Parachain Nodes (Collators) From 8941a67d023fb9307819b82880456106b37d8ce0 Mon Sep 17 00:00:00 2001 From: Nikola Todorovic Date: Wed, 17 Jan 2024 17:12:04 +0100 Subject: [PATCH 07/11] Remove learn more from README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index f7014fd..8dde2fc 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,3 @@ docker run -it -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -v /data:/d --no-mdns --execution=wasm --pruning=archive\ -- --execution=wasm --wasm-execution=Compiled --chain=polkadot ``` - -## Learn More - -- More about expanding the multi-chain OriginTrail with Polkadot and OriginTrail Parachain development roadmap you can find on - [parachain.origintrail.io](https://parachain.origintrail.io/) -- More about OriginTrail Parachain and Decentralized Knowledge Graph read in [whitepaper](https://origintrail.io/ecosystem/whitepaper) From aa24e7fea823bb4121d13d40ccb6d09203a07017 Mon Sep 17 00:00:00 2001 From: NZT48 Date: Mon, 26 Feb 2024 16:24:06 +0100 Subject: [PATCH 08/11] Rename origintrail parachain to neuroweb --- Cargo.lock | 280 +++++++++--------- node/Cargo.toml | 16 +- node/src/chain_spec.rs | 26 +- node/src/command.rs | 18 +- node/src/main.rs | 2 +- node/src/rpc.rs | 2 +- node/src/service.rs | 6 +- pallets/xc-asset-config/src/weights.rs | 2 +- polkadot-launch/config.json | 2 +- precompiles/assets-erc20/src/lib.rs | 6 +- precompiles/assets-erc20/src/mock.rs | 2 +- precompiles/assets-erc20/src/tests.rs | 2 +- precompiles/utils/macro/src/lib.rs | 2 +- precompiles/utils/src/data.rs | 2 +- precompiles/utils/src/lib.rs | 2 +- precompiles/utils/src/testing.rs | 2 +- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 4 +- runtime/src/weights/pallet_xc_asset_config.rs | 2 +- 19 files changed, 190 insertions(+), 190 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7343abb..a9eaf34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5691,6 +5691,146 @@ dependencies = [ "tokio", ] +[[package]] +name = "neuroweb-node" +version = "1.1.1" +dependencies = [ + "clap", + "cumulus-client-cli", + "cumulus-client-consensus-aura", + "cumulus-client-consensus-common", + "cumulus-client-service", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", + "fc-db", + "fc-mapping-sync", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "fp-evm", + "fp-rpc", + "frame-benchmarking", + "frame-benchmarking-cli", + "futures", + "jsonrpsee", + "log", + "neuroweb-runtime", + "pallet-transaction-payment-rpc", + "parity-scale-codec", + "polkadot-cli", + "polkadot-primitives", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-sync", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-offchain", + "sp-runtime", + "sp-timestamp", + "substrate-build-script-utils", + "substrate-frame-rpc-system", + "substrate-prometheus-endpoint", + "try-runtime-cli", + "xcm", +] + +[[package]] +name = "neuroweb-runtime" +version = "1.2.1" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "fp-rpc", + "fp-self-contained", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-base-fee", + "pallet-collator-selection", + "pallet-collective", + "pallet-democracy", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-accounts", + "pallet-evm-precompile-assets-erc20", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", + "pallet-identity", + "pallet-preimage", + "pallet-scheduler", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xc-asset-config", + "pallet-xcm", + "parachain-info", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "nix" version = "0.24.3" @@ -5947,146 +6087,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "origintrail-parachain-node" -version = "1.1.1" -dependencies = [ - "clap", - "cumulus-client-cli", - "cumulus-client-consensus-aura", - "cumulus-client-consensus-common", - "cumulus-client-service", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-relay-chain-interface", - "fc-db", - "fc-mapping-sync", - "fc-rpc", - "fc-rpc-core", - "fc-storage", - "fp-evm", - "fp-rpc", - "frame-benchmarking", - "frame-benchmarking-cli", - "futures", - "jsonrpsee", - "log", - "origintrail-parachain-runtime", - "pallet-transaction-payment-rpc", - "parity-scale-codec", - "polkadot-cli", - "polkadot-primitives", - "sc-basic-authorship", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-keystore", - "sc-network", - "sc-network-sync", - "sc-rpc", - "sc-rpc-api", - "sc-service", - "sc-sysinfo", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-offchain", - "sp-runtime", - "sp-timestamp", - "substrate-build-script-utils", - "substrate-frame-rpc-system", - "substrate-prometheus-endpoint", - "try-runtime-cli", - "xcm", -] - -[[package]] -name = "origintrail-parachain-runtime" -version = "1.2.1" -dependencies = [ - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "fp-rpc", - "fp-self-contained", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "pallet-assets", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-base-fee", - "pallet-collator-selection", - "pallet-collective", - "pallet-democracy", - "pallet-ethereum", - "pallet-evm", - "pallet-evm-accounts", - "pallet-evm-precompile-assets-erc20", - "pallet-evm-precompile-modexp", - "pallet-evm-precompile-sha3fips", - "pallet-evm-precompile-simple", - "pallet-identity", - "pallet-preimage", - "pallet-scheduler", - "pallet-session", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-xc-asset-config", - "pallet-xcm", - "parachain-info", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-runtime-common", - "scale-info", - "smallvec", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std", - "sp-transaction-pool", - "sp-version", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", -] - [[package]] name = "p256" version = "0.11.1" diff --git a/node/Cargo.toml b/node/Cargo.toml index 8c999ea..0cf1260 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "origintrail-parachain-node" +name = "neuroweb-node" version = "1.1.1" authors = ["TraceLabs"] -description = "OriginTrail Parachain - Cumulus FRAME-based Substrate Node" +description = "NeuroWeb - Cumulus FRAME-based Substrate Node" license = "GPL-3.0-only" -homepage = "https://parachain.origintrail.io/" -repository = "https://github.com/OriginTrail/origintrail-parachain/" +homepage = "https://neuroweb.ai/" +repository = "https://github.com/OriginTrail/neuroweb/" edition = "2021" build = "build.rs" [[bin]] -name = "origintrail-parachain" +name = "neuroweb" path = "src/main.rs" [dependencies] @@ -22,7 +22,7 @@ serde = { version = "1.0.152", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } # Local -origintrail-parachain-runtime = { path = "../runtime" } +neuroweb-runtime = { path = "../runtime" } # Substrate frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } @@ -91,10 +91,10 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate" default = ["fc-rpc/rpc-binary-search-estimate"] runtime-benchmarks = [ "try-runtime-cli/try-runtime", - "origintrail-parachain-runtime/runtime-benchmarks", + "neuroweb-runtime/runtime-benchmarks", "polkadot-cli/runtime-benchmarks", ] try-runtime = [ "try-runtime-cli/try-runtime", - "origintrail-parachain-runtime/try-runtime", + "neuroweb-runtime/try-runtime", ] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index ce9552d..1208d6a 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,5 +1,5 @@ use cumulus_primitives_core::ParaId; -use origintrail_parachain_runtime::{AccountId, AuraId, +use neuroweb_runtime::{AccountId, AuraId, EVMConfig, EthereumConfig, Signature, EXISTENTIAL_DEPOSIT}; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; @@ -10,7 +10,7 @@ use std::{collections::BTreeMap, str::FromStr}; /// Specialized `ChainSpec` for the normal parachain runtime. pub type ChainSpec = - sc_service::GenericChainSpec; + sc_service::GenericChainSpec; /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; @@ -59,8 +59,8 @@ where /// Generate the session keys from individual elements. /// /// The input must be a tuple of individual keys (a single arg for now since we have just one key). -pub fn template_session_keys(keys: AuraId) -> origintrail_parachain_runtime::SessionKeys { - origintrail_parachain_runtime::SessionKeys { aura: keys } +pub fn template_session_keys(keys: AuraId) -> neuroweb_runtime::SessionKeys { + neuroweb_runtime::SessionKeys { aura: keys } } pub fn development_config() -> ChainSpec { @@ -184,23 +184,23 @@ fn testnet_genesis( _root_key: AccountId, endowed_accounts: Vec, id: ParaId, -) -> origintrail_parachain_runtime::GenesisConfig { - origintrail_parachain_runtime::GenesisConfig { - system: origintrail_parachain_runtime::SystemConfig { - code: origintrail_parachain_runtime::WASM_BINARY +) -> neuroweb_runtime::GenesisConfig { + neuroweb_runtime::GenesisConfig { + system: neuroweb_runtime::SystemConfig { + code: neuroweb_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), }, - balances: origintrail_parachain_runtime::BalancesConfig { + balances: neuroweb_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), }, - parachain_info: origintrail_parachain_runtime::ParachainInfoConfig { parachain_id: id }, - collator_selection: origintrail_parachain_runtime::CollatorSelectionConfig { + parachain_info: neuroweb_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: neuroweb_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: EXISTENTIAL_DEPOSIT * 16, ..Default::default() }, - session: origintrail_parachain_runtime::SessionConfig { + session: neuroweb_runtime::SessionConfig { keys: invulnerables .into_iter() .map(|(acc, aura)| { @@ -217,7 +217,7 @@ fn testnet_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), - polkadot_xcm: origintrail_parachain_runtime::PolkadotXcmConfig { + polkadot_xcm: neuroweb_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, // sudo: SudoConfig { diff --git a/node/src/command.rs b/node/src/command.rs index dfb38fc..ca329c5 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -4,7 +4,7 @@ use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::{info, warn}; -use origintrail_parachain_runtime::Block; +use neuroweb_runtime::Block; use sc_cli::{ ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli, @@ -31,7 +31,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { impl SubstrateCli for Cli { fn impl_name() -> String { - "OriginTrail Parachain".into() + "NeuroWeb".into() } fn impl_version() -> String { @@ -40,7 +40,7 @@ impl SubstrateCli for Cli { fn description() -> String { format!( - "OriginTrail Parachain\n\nThe command-line arguments provided first will be \ + "NeuroWeb\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", @@ -53,7 +53,7 @@ impl SubstrateCli for Cli { } fn support_url() -> String { - "https://github.com/OriginTrail/origintrail-parachain/issues/new".into() + "https://github.com/OriginTrail/neuroweb/issues/new".into() } fn copyright_start_year() -> i32 { @@ -65,13 +65,13 @@ impl SubstrateCli for Cli { } fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { - &origintrail_parachain_runtime::VERSION + &neuroweb_runtime::VERSION } } impl SubstrateCli for RelayChainCli { fn impl_name() -> String { - "OriginTrail Parachain".into() + "NeuroWeb".into() } fn impl_version() -> String { @@ -80,7 +80,7 @@ impl SubstrateCli for RelayChainCli { fn description() -> String { format!( - "OriginTrail Parachain \n\nThe command-line arguments provided first will be \ + "NeuroWeb \n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relay chain node.\n\n\ {} -- ", Self::executable_name() @@ -92,7 +92,7 @@ impl SubstrateCli for RelayChainCli { } fn support_url() -> String { - "https://github.com/OriginTrail/origintrail-parachain/issues/new".into() + "https://github.com/OriginTrail/neuroweb/issues/new".into() } fn copyright_start_year() -> i32 { @@ -232,7 +232,7 @@ pub fn run() -> Result<()> { } #[cfg(feature = "try-runtime")] Some(Subcommand::TryRuntime(cmd)) => { - use origintrail_parachain_runtime::MILLISECS_PER_BLOCK; + use neuroweb_runtime::MILLISECS_PER_BLOCK; use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; use try_runtime_cli::block_building_info::timestamp_with_aura_info; diff --git a/node/src/main.rs b/node/src/main.rs index fdd6a8a..b895177 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,4 +1,4 @@ -//! OriginTrail Parachain Node CLI +//! NeuroWeb Node CLI #![warn(missing_docs)] diff --git a/node/src/rpc.rs b/node/src/rpc.rs index f535c92..0f0b8f1 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -7,7 +7,7 @@ use std::sync::Arc; -use origintrail_parachain_runtime::{opaque::Block, AccountId, Balance, Hash, Index as Nonce}; +use neuroweb_runtime::{opaque::Block, AccountId, Balance, Hash, Index as Nonce}; use sc_client_api::{ AuxStore, Backend, BlockchainEvents, StateBackend, StorageProvider, diff --git a/node/src/service.rs b/node/src/service.rs index 5dacffb..c08a85f 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -5,7 +5,7 @@ use std::{sync::Arc, path::PathBuf, time::Duration, collections::BTreeMap}; use cumulus_client_cli::CollatorOptions; // Local Runtime Types -use origintrail_parachain_runtime::{ +use neuroweb_runtime::{ opaque::Block, RuntimeApi, }; @@ -45,11 +45,11 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { - origintrail_parachain_runtime::api::dispatch(method, data) + neuroweb_runtime::api::dispatch(method, data) } fn native_version() -> sc_executor::NativeVersion { - origintrail_parachain_runtime::native_version() + neuroweb_runtime::native_version() } } diff --git a/pallets/xc-asset-config/src/weights.rs b/pallets/xc-asset-config/src/weights.rs index b588f50..f303f5e 100644 --- a/pallets/xc-asset-config/src/weights.rs +++ b/pallets/xc-asset-config/src/weights.rs @@ -10,7 +10,7 @@ //! // Executed Command: -// ./target/release/origintrail-parachain +// ./target/release/neuroweb // benchmark // pallet // --chain diff --git a/polkadot-launch/config.json b/polkadot-launch/config.json index 86f13c0..fcb0066 100644 --- a/polkadot-launch/config.json +++ b/polkadot-launch/config.json @@ -17,7 +17,7 @@ }, "parachains": [ { - "bin": "../target/release/origintrail-parachain", + "bin": "../target/release/neuroweb", "id": "200", "balance": "1000000000000000000000", "nodes": [ diff --git a/precompiles/assets-erc20/src/lib.rs b/precompiles/assets-erc20/src/lib.rs index c75f204..629163f 100644 --- a/precompiles/assets-erc20/src/lib.rs +++ b/precompiles/assets-erc20/src/lib.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of AssetsERC20 package, originally developed by Purestake Inc. -// AssetsERC20 package used in OriginTrail Parachain in terms of GPLv3. +// AssetsERC20 package used in NeuroWeb Parachain in terms of GPLv3. // // AssetsERC20 is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -90,8 +90,8 @@ pub trait AddressToAssetId { /// The following distribution has been decided for the precompiles /// 0-1023: Ethereum Mainnet Precompiles -/// 1024-2047 Precompiles that are not in Ethereum Mainnet but are neither OriginTrail Parachain specific -/// 2048-4095 OriginTrail Parachain specific precompiles +/// 1024-2047 Precompiles that are not in Ethereum Mainnet but are neither NeuroWeb Parachain specific +/// 2048-4095 NeuroWeb Parachain specific precompiles /// Asset precompiles can only fall between /// 0xFFFFFFFF00000000000000000000000000000000 - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF /// The precompile for AssetId X, where X is a u128 (i.e.16 bytes), if 0XFFFFFFFF + Bytes(AssetId) diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index f785ded..c041729 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of AssetsERC20 package, originally developed by Purestake Inc. -// AssetsERC20 package used in OriginTrail Parachain Network in terms of GPLv3. +// AssetsERC20 package used in NeuroWeb Parachain Network in terms of GPLv3. // // AssetsERC20 is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/precompiles/assets-erc20/src/tests.rs b/precompiles/assets-erc20/src/tests.rs index 6983153..1cdd8d8 100644 --- a/precompiles/assets-erc20/src/tests.rs +++ b/precompiles/assets-erc20/src/tests.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of AssetsERC20 package, originally developed by Purestake Inc. -// AssetsERC20 package used in OriginTrail Parachain in terms of GPLv3. +// AssetsERC20 package used in NeuroWeb Parachain in terms of GPLv3. // // AssetsERC20 is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/precompiles/utils/macro/src/lib.rs b/precompiles/utils/macro/src/lib.rs index 64394e7..6a4b24d 100644 --- a/precompiles/utils/macro/src/lib.rs +++ b/precompiles/utils/macro/src/lib.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of Utils package, originally developed by Purestake Inc. -// Utils package used in OriginTrail Parachain Network in terms of GPLv3. +// Utils package used in NeuroWeb Parachain Network in terms of GPLv3. // // Utils is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/precompiles/utils/src/data.rs b/precompiles/utils/src/data.rs index bbf03c2..8edce68 100644 --- a/precompiles/utils/src/data.rs +++ b/precompiles/utils/src/data.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of Utils package, originally developed by Purestake Inc. -// Utils package used in OriginTrail Parachain Network in terms of GPLv3. +// Utils package used in NeuroWeb Parachain Network in terms of GPLv3. // // Utils is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/precompiles/utils/src/lib.rs b/precompiles/utils/src/lib.rs index e20bee6..842976c 100644 --- a/precompiles/utils/src/lib.rs +++ b/precompiles/utils/src/lib.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of Utils package, originally developed by Purestake Inc. -// Utils package used in OriginTrail Parachain Network in terms of GPLv3. +// Utils package used in NeuroWeb Parachain Network in terms of GPLv3. // // Utils is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/precompiles/utils/src/testing.rs b/precompiles/utils/src/testing.rs index 8a05bfd..a02fec2 100644 --- a/precompiles/utils/src/testing.rs +++ b/precompiles/utils/src/testing.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of Utils package, originally developed by Purestake Inc. -// Utils package used in OriginTrail Parachain Network in terms of GPLv3. +// Utils package used in NeuroWeb Parachain Network in terms of GPLv3. // // Utils is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c4aff6a..c610ee5 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "origintrail-parachain-runtime" +name = "neuroweb-runtime" version = "1.2.1" authors = ["TraceLabs"] description = "OriginTrail Parachain Runtime - Cumulus FRAME-based Substrate Runtime" diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 8183e37..fdb9a3d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -248,9 +248,9 @@ impl_opaque_keys! { #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("origintrail-parachain"), - impl_name: create_runtime_str!("origintrail-parachain"), + impl_name: create_runtime_str!("neuroweb"), authoring_version: 1, - spec_version: 121, + spec_version: 122, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/src/weights/pallet_xc_asset_config.rs b/runtime/src/weights/pallet_xc_asset_config.rs index 229b58c..82ab92d 100644 --- a/runtime/src/weights/pallet_xc_asset_config.rs +++ b/runtime/src/weights/pallet_xc_asset_config.rs @@ -6,7 +6,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/origintrail-parachain +// ./target/release/neuroweb // benchmark // pallet // --chain From 39388ff96ff6397da20c6a9523285c4cf6ed277b Mon Sep 17 00:00:00 2001 From: NZT48 Date: Mon, 26 Feb 2024 16:32:08 +0100 Subject: [PATCH 09/11] Bump version to 1.3.0 --- node/Cargo.toml | 2 +- runtime/Cargo.toml | 8 ++++---- runtime/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/node/Cargo.toml b/node/Cargo.toml index 0cf1260..1e83fcd 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "neuroweb-node" -version = "1.1.1" +version = "1.3.0" authors = ["TraceLabs"] description = "NeuroWeb - Cumulus FRAME-based Substrate Node" license = "GPL-3.0-only" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c610ee5..83700a2 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "neuroweb-runtime" -version = "1.2.1" +version = "1.3.0" authors = ["TraceLabs"] -description = "OriginTrail Parachain Runtime - Cumulus FRAME-based Substrate Runtime" +description = "NeuroWeb Runtime - Cumulus FRAME-based Substrate Runtime" license = "GPL-3.0-only" -homepage = "https://parachain.origintrail.io/" -repository = "https://github.com/OriginTrail/origintrail-parachain/" +homepage = "https://neuroweb.ai/" +repository = "https://github.com/OriginTrail/neuroweb/" edition = "2021" [package.metadata.docs.rs] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index fdb9a3d..5a4c0d5 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -250,7 +250,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("origintrail-parachain"), impl_name: create_runtime_str!("neuroweb"), authoring_version: 1, - spec_version: 122, + spec_version: 130, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 4885f639945cf41732175b00c155ba8ab6bac677 Mon Sep 17 00:00:00 2001 From: NZT48 Date: Tue, 16 Apr 2024 15:55:36 +0200 Subject: [PATCH 10/11] Rename origintrail parachain to neuroweb in comments --- precompiles/utils/macro/tests/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precompiles/utils/macro/tests/tests.rs b/precompiles/utils/macro/tests/tests.rs index 6e42bc2..7e37162 100644 --- a/precompiles/utils/macro/tests/tests.rs +++ b/precompiles/utils/macro/tests/tests.rs @@ -2,7 +2,7 @@ // Copyright 2022 Stake Technologies // Copyright 2022 TraceLabs // This file is part of Utils package, originally developed by Purestake Inc. -// Utils package used in OriginTrail Parachain Network in terms of GPLv3. +// Utils package used in NeuroWeb Parachain Network in terms of GPLv3. // // Utils is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by From 42d2b82c11819c1664ceccee7f5cd3ed12b93ce2 Mon Sep 17 00:00:00 2001 From: NZT48 Date: Mon, 22 Apr 2024 23:30:21 +0200 Subject: [PATCH 11/11] Add Proxy pallet --- Cargo.lock | 6 ++-- runtime/Cargo.toml | 4 +++ runtime/src/lib.rs | 90 ++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 92 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5cc868..30500df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5693,7 +5693,7 @@ dependencies = [ [[package]] name = "neuroweb-node" -version = "1.1.1" +version = "1.3.0" dependencies = [ "clap", "cumulus-client-cli", @@ -5759,7 +5759,7 @@ dependencies = [ [[package]] name = "neuroweb-runtime" -version = "1.2.1" +version = "1.3.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -5797,7 +5797,9 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-identity", + "pallet-multisig", "pallet-preimage", + "pallet-proxy", "pallet-scheduler", "pallet-session", "pallet-timestamp", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index fc6afd9..5875d5a 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -38,6 +38,7 @@ pallet-aura = { git = "https://github.com/paritytech/substrate", default-feature pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } +pallet-proxy = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.40" } pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.40" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40" } @@ -134,6 +135,7 @@ std = [ "pallet-ethereum/std", "pallet-identity/std", "pallet-preimage/std", + "pallet-proxy/std", "pallet-multisig/std", "pallet-scheduler/std", "pallet-session/std", @@ -179,6 +181,7 @@ runtime-benchmarks = [ "pallet-ethereum/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", @@ -209,6 +212,7 @@ try-runtime = [ "pallet-democracy/runtime-benchmarks", "pallet-identity/runtime-benchmarks", "pallet-preimage/try-runtime", + "pallet-proxy/try-runtime", "pallet-scheduler/try-runtime", "pallet-session/try-runtime", "pallet-utility/try-runtime", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d3ca350..c5941fe 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -23,7 +23,7 @@ use sp_runtime::{ transaction_validity::{ TransactionSource, TransactionValidity, TransactionValidityError }, - ApplyExtrinsicResult, MultiSignature, + ApplyExtrinsicResult, MultiSignature, RuntimeDebug, }; use sp_std::prelude::*; @@ -31,14 +31,13 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; -use codec::{Encode}; -pub use frame_support::traits::EqualPrivilegeOnly; +use codec::{Encode, Decode, MaxEncodedLen}; use frame_support::{ construct_runtime, parameter_types, transactional, traits::{ - AsEnsureOriginWithArg, Currency as PalletCurrency, EitherOfDiverse, Everything, FindAuthor, - ReservableCurrency, Imbalance, OnUnbalanced, ConstU128, ConstU32, ConstU64, ConstU8, - WithdrawReasons + AsEnsureOriginWithArg, Currency as PalletCurrency, EqualPrivilegeOnly, EitherOfDiverse, + Everything, FindAuthor, ReservableCurrency, Imbalance, InstanceFilter, OnUnbalanced, + ConstU128, ConstU32, ConstU64, ConstU8, WithdrawReasons, }, dispatch::DispatchClass, weights::{ @@ -1052,6 +1051,83 @@ impl pallet_identity::Config for Runtime { type WeightInfo = pallet_identity::weights::SubstrateWeight; } +parameter_types! { + // One storage item; key size 32, value size 8; . + pub const ProxyDepositBase: Balance = deposit(1, 8); + // Additional storage item size of 33 bytes. + pub const ProxyDepositFactor: Balance = deposit(0, 33); + pub const AnnouncementDepositBase: Balance = deposit(1, 8); + pub const AnnouncementDepositFactor: Balance = deposit(0, 66); +} + +/// The type used to represent the kinds of proxying allowed. +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + MaxEncodedLen, + scale_info::TypeInfo, +)] +pub enum ProxyType { + Any, + NonTransfer, + Governance, +} +impl Default for ProxyType { + fn default() -> Self { + Self::Any + } +} +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { + match self { + ProxyType::Any => true, + ProxyType::NonTransfer => !matches!( + c, + RuntimeCall::Balances(..) | + RuntimeCall::Assets(..) | + RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) + ), + ProxyType::Governance => matches!( + c, + RuntimeCall::Democracy(..) | + RuntimeCall::Council(..) | + RuntimeCall::Treasury(..) + ), + } + } + fn is_superset(&self, o: &Self) -> bool { + match (self, o) { + (x, y) if x == y => true, + (ProxyType::Any, _) => true, + (_, ProxyType::Any) => false, + (ProxyType::NonTransfer, _) => true, + _ => false, + } + } +} + +impl pallet_proxy::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type ProxyType = ProxyType; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type MaxProxies = ConstU32<32>; + type WeightInfo = pallet_proxy::weights::SubstrateWeight; + type MaxPending = ConstU32<32>; + type CallHasher = BlakeTwo256; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -1068,6 +1144,7 @@ construct_runtime!( ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, Utility: pallet_utility = 4, Multisig: pallet_multisig = 5, + Proxy: pallet_proxy = 6, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -1118,6 +1195,7 @@ mod benches { [pallet_democracy, Democracy] [pallet_identity, Identity] [pallet_preimage, Preimage] + [pallet_proxy, Proxy] [pallet_session, SessionBench::] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection]