From 4f03b3e5c749bfb5ae340b5a337bb37213f69910 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 22 Nov 2021 16:06:57 +0000 Subject: [PATCH 01/10] Implement TransactionCallFilter struct --- runtime/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a3ad2a2b3..2ccfc719e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -14,6 +14,7 @@ mod parameters; mod txfilter; #[cfg(feature = "parachain")] mod xcm_config; +mod txfilter; pub use parameters::*; From 74da454e1fb73c4427430c93a30fea066c8fe0e8 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 22 Nov 2021 20:58:00 +0000 Subject: [PATCH 02/10] Complete txfilter implementation --- runtime/Cargo.toml | 1 + runtime/src/lib.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d3f0f78c2..027d1c260 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -147,6 +147,7 @@ std = [ "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", + "log/std", "orml-currencies/std", "orml-tokens/std", "orml-traits/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2ccfc719e..eb43735d6 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -14,6 +14,7 @@ mod parameters; mod txfilter; #[cfg(feature = "parachain")] mod xcm_config; +// #[cfg(feature = "parachain")] mod txfilter; pub use parameters::*; @@ -25,6 +26,8 @@ use frame_support::{ weights::{constants::RocksDbWeight, IdentityFee}, }; use frame_system::{EnsureOneOf, EnsureRoot}; +//#[cfg(feature = "parachain")] +use parity_scale_codec::Encode; use sp_api::impl_runtime_apis; use sp_core::{ crypto::KeyTypeId, @@ -37,6 +40,11 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; +// #[cfg(feature = "parachain")] +use sp_runtime::{ + traits::{Extrinsic as ExtrinsicT, Verify}, + SaturatedConversion, +}; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; @@ -108,6 +116,7 @@ type SignedExtra = ( #[cfg(not(feature = "txfilter"))] type SignedExtra = ( + txfilter::TransactionCallFilter, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, frame_system::CheckGenesis, From 01005cd2b80186e9f2baac35a56ea2d073eda409 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 22 Nov 2021 22:01:39 +0000 Subject: [PATCH 03/10] Add txfilter feature and prettify code --- runtime/Cargo.toml | 1 - runtime/src/lib.rs | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 027d1c260..d3f0f78c2 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -147,7 +147,6 @@ std = [ "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", - "log/std", "orml-currencies/std", "orml-tokens/std", "orml-traits/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index eb43735d6..a3ad2a2b3 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -14,8 +14,6 @@ mod parameters; mod txfilter; #[cfg(feature = "parachain")] mod xcm_config; -// #[cfg(feature = "parachain")] -mod txfilter; pub use parameters::*; @@ -26,8 +24,6 @@ use frame_support::{ weights::{constants::RocksDbWeight, IdentityFee}, }; use frame_system::{EnsureOneOf, EnsureRoot}; -//#[cfg(feature = "parachain")] -use parity_scale_codec::Encode; use sp_api::impl_runtime_apis; use sp_core::{ crypto::KeyTypeId, @@ -40,11 +36,6 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; -// #[cfg(feature = "parachain")] -use sp_runtime::{ - traits::{Extrinsic as ExtrinsicT, Verify}, - SaturatedConversion, -}; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; @@ -116,7 +107,6 @@ type SignedExtra = ( #[cfg(not(feature = "txfilter"))] type SignedExtra = ( - txfilter::TransactionCallFilter, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, frame_system::CheckGenesis, From 4e784374a34a2fe0c9e51bec023cd5b5edcbf7cd Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 25 Nov 2021 15:45:33 +0000 Subject: [PATCH 04/10] Add initialization constants & rename key functions --- node/src/chain_spec/mod.rs | 2 -- node/src/chain_spec/zeitgeist.rs | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 79163c4c0..01bbc76f8 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -46,12 +46,10 @@ cfg_if::cfg_if! { let millisecs_per_year = hours_per_year * 60 * 60 * 1000; let round_millisecs = DefaultBlocksPerRound::get() as u64 * MILLISECS_PER_BLOCK as u64; let rounds_per_year = millisecs_per_year / round_millisecs; - let annual_inflation = ztg::STAKING_PTD; let expected_annual_amount = ztg::COLLATORS * zeitgeist_primitives::constants::BASE; let round_inflation_parts = annual_inflation.deconstruct() as u64 / rounds_per_year; let round_inflation = Perbill::from_parts(round_inflation_parts as _); - parachain_staking::InflationInfo { annual: parachain_staking::Range { ideal: annual_inflation, diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index 61926da95..1d9e96009 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -4,6 +4,7 @@ use crate::chain_spec::{ }; use sc_service::ChainType; +// TODO: swap *_testnet with *_mainnet pub fn zeitgeist_staging_config( #[cfg(feature = "parachain")] parachain_id: cumulus_primitives_core::ParaId, ) -> Result { From 82a06959d4422037f6799bce031a5d686d7f1d26 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 25 Nov 2021 16:17:28 +0000 Subject: [PATCH 05/10] Modify generic_genesis() to allow more control over endowed accounts --- node/src/chain_spec/dev.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index bf1df68b4..eb1e69250 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -7,6 +7,7 @@ use crate::chain_spec::{ }; use sc_service::ChainType; use sp_core::sr25519; +use super::EndowedAccountWithBalance; use zeitgeist_primitives::types::Balance; const INITIAL_BALANCE: Balance = Balance::MAX >> 4; From e3d6012c43135184eac3da82e4172990df9a14ea Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 25 Nov 2021 18:08:49 +0000 Subject: [PATCH 06/10] Configure initial keys --- node/src/chain_spec/zeitgeist.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index 1d9e96009..61926da95 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -4,7 +4,6 @@ use crate::chain_spec::{ }; use sc_service::ChainType; -// TODO: swap *_testnet with *_mainnet pub fn zeitgeist_staging_config( #[cfg(feature = "parachain")] parachain_id: cumulus_primitives_core::ParaId, ) -> Result { From 68f82fc4482f49904d5e9333f810520589bd0a61 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 25 Nov 2021 18:11:12 +0000 Subject: [PATCH 07/10] Cargo fmt --- node/src/chain_spec/dev.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index eb1e69250..bf1df68b4 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -7,7 +7,6 @@ use crate::chain_spec::{ }; use sc_service::ChainType; use sp_core::sr25519; -use super::EndowedAccountWithBalance; use zeitgeist_primitives::types::Balance; const INITIAL_BALANCE: Balance = Balance::MAX >> 4; From d885710a21c2424e4069902f4dddb36053ccf5f7 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 25 Nov 2021 18:44:52 +0000 Subject: [PATCH 08/10] Update versions --- Cargo.lock | 30 +++++++++---------- node/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- zrml/authorized/Cargo.toml | 2 +- zrml/court/Cargo.toml | 2 +- zrml/liquidity-mining/Cargo.toml | 2 +- zrml/market-commons/Cargo.toml | 2 +- zrml/orderbook-v1/Cargo.toml | 2 +- zrml/prediction-markets/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/rikiddo/Cargo.toml | 2 +- zrml/simple-disputes/Cargo.toml | 2 +- zrml/swaps/Cargo.toml | 2 +- zrml/swaps/rpc/Cargo.toml | 2 +- zrml/swaps/runtime-api/Cargo.toml | 2 +- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f295aee82..8c7f570cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12172,7 +12172,7 @@ dependencies = [ [[package]] name = "zeitgeist-node" -version = "0.2.0" +version = "0.2.1" dependencies = [ "cfg-if 1.0.0", "cumulus-client-cli", @@ -12236,7 +12236,7 @@ dependencies = [ [[package]] name = "zeitgeist-primitives" -version = "0.2.0" +version = "0.2.1" dependencies = [ "arbitrary", "frame-support", @@ -12252,7 +12252,7 @@ dependencies = [ [[package]] name = "zeitgeist-runtime" -version = "0.2.0" +version = "0.2.1" dependencies = [ "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12347,7 +12347,7 @@ dependencies = [ [[package]] name = "zrml-authorized" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12363,7 +12363,7 @@ dependencies = [ [[package]] name = "zrml-court" -version = "0.2.0" +version = "0.2.1" dependencies = [ "arrayvec 0.7.1", "frame-benchmarking", @@ -12382,7 +12382,7 @@ dependencies = [ [[package]] name = "zrml-liquidity-mining" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12399,7 +12399,7 @@ dependencies = [ [[package]] name = "zrml-market-commons" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-support", "frame-system", @@ -12410,7 +12410,7 @@ dependencies = [ [[package]] name = "zrml-orderbook-v1" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12438,7 +12438,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12481,7 +12481,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets-runtime-api" -version = "0.2.0" +version = "0.2.1" dependencies = [ "parity-scale-codec", "sp-api", @@ -12490,7 +12490,7 @@ dependencies = [ [[package]] name = "zrml-rikiddo" -version = "0.2.0" +version = "0.2.1" dependencies = [ "arbitrary", "cfg-if 1.0.0", @@ -12522,7 +12522,7 @@ dependencies = [ [[package]] name = "zrml-simple-disputes" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12538,7 +12538,7 @@ dependencies = [ [[package]] name = "zrml-swaps" -version = "0.2.0" +version = "0.2.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12573,7 +12573,7 @@ dependencies = [ [[package]] name = "zrml-swaps-rpc" -version = "0.2.0" +version = "0.2.1" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -12588,7 +12588,7 @@ dependencies = [ [[package]] name = "zrml-swaps-runtime-api" -version = "0.2.0" +version = "0.2.1" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/node/Cargo.toml b/node/Cargo.toml index 2b785cf55..ba0b10e3d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -132,7 +132,7 @@ description = 'An evolving blockchain for prediction markets and futarchy.' edition = '2018' homepage = 'https://zeitgeist.market' name = 'zeitgeist-node' -version = '0.2.0' +version = '0.2.1' [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 360a87e3b..798060fba 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -28,4 +28,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zeitgeist-primitives" -version = "0.2.0" \ No newline at end of file +version = "0.2.1" \ No newline at end of file diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d3f0f78c2..b08d439fc 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -235,7 +235,7 @@ txfilter = [ authors = ['Zeitgeist PM '] edition = "2018" name = "zeitgeist-runtime" -version = "0.2.0" +version = "0.2.1" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index 09de2629f..d84b89916 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -33,4 +33,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-authorized" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index 1cb4165cf..951e5e699 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -36,4 +36,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-court" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index b12f1224b..18c3a0134 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -35,4 +35,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-liquidity-mining" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index ace219f0f..497f93701 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -19,4 +19,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-market-commons" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/orderbook-v1/Cargo.toml b/zrml/orderbook-v1/Cargo.toml index 2a10d5b82..64f0b3306 100644 --- a/zrml/orderbook-v1/Cargo.toml +++ b/zrml/orderbook-v1/Cargo.toml @@ -42,4 +42,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-orderbook-v1" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index 4b21276f7..b0eeb7d38 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -70,4 +70,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-prediction-markets" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index 200aabee3..837a8a1f1 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -15,4 +15,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-prediction-markets-runtime-api" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index e91917170..5a586df89 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -37,4 +37,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-rikiddo" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index 6062e8669..e15b9e57d 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -33,4 +33,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-simple-disputes" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index 0f97be0d8..57e8a388f 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -58,4 +58,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-swaps" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index dc8fa5547..3949af116 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -13,4 +13,4 @@ zrml-swaps-runtime-api = { default-features = false, features = ["std"], path = authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-swaps-rpc" -version = "0.2.0" +version = "0.2.1" diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index 69b4a2439..02a4a7308 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -17,4 +17,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2018" name = "zrml-swaps-runtime-api" -version = "0.2.0" +version = "0.2.1" From 5bc97b0ee7b9862063ff08155b52c9a061983ec2 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 29 Nov 2021 16:59:35 +0000 Subject: [PATCH 09/10] Undo removal of empty lines in rebase --- node/src/chain_spec/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 01bbc76f8..221366643 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -46,10 +46,12 @@ cfg_if::cfg_if! { let millisecs_per_year = hours_per_year * 60 * 60 * 1000; let round_millisecs = DefaultBlocksPerRound::get() as u64 * MILLISECS_PER_BLOCK as u64; let rounds_per_year = millisecs_per_year / round_millisecs; + let annual_inflation = ztg::STAKING_PTD; let expected_annual_amount = ztg::COLLATORS * zeitgeist_primitives::constants::BASE; let round_inflation_parts = annual_inflation.deconstruct() as u64 / rounds_per_year; let round_inflation = Perbill::from_parts(round_inflation_parts as _); + parachain_staking::InflationInfo { annual: parachain_staking::Range { ideal: annual_inflation, From 8a7015aa58e086b25d6cf12dcaaaefd099eed276 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 29 Nov 2021 17:00:37 +0000 Subject: [PATCH 10/10] Cargo fmt --- node/src/chain_spec/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 221366643..79163c4c0 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -51,7 +51,7 @@ cfg_if::cfg_if! { let expected_annual_amount = ztg::COLLATORS * zeitgeist_primitives::constants::BASE; let round_inflation_parts = annual_inflation.deconstruct() as u64 / rounds_per_year; let round_inflation = Perbill::from_parts(round_inflation_parts as _); - + parachain_staking::InflationInfo { annual: parachain_staking::Range { ideal: annual_inflation,