From 00e9f53784618708e31554e7f53213186e109860 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 18 Dec 2023 17:28:39 +0100 Subject: [PATCH 1/3] Change DIP provider template to have u64 as block number --- dip-template/runtimes/dip-provider/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index 8a083b92b9..8385220722 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -89,7 +89,7 @@ pub type AccountId = AccountId32; pub type Address = MultiAddress; pub type Balance = u128; pub type Block = generic::Block; -pub type BlockNumber = u32; +pub type BlockNumber = u64; pub type DidIdentifier = AccountId; pub type Hash = sp_core::H256; pub type Header = generic::Header; From e58a6b89cbbd8e5ed3655a7ae3457469677fafdb Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 18 Dec 2023 17:36:24 +0100 Subject: [PATCH 2/3] Fix compilation errors --- dip-template/runtimes/dip-provider/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index 8385220722..ac6208bb09 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -229,7 +229,7 @@ impl frame_system::Config for Runtime { type AccountData = AccountData; type AccountId = AccountId; type BaseCallFilter = Everything; - type BlockHashCount = ConstU32<256>; + type BlockHashCount = ConstU64<256>; type BlockLength = RuntimeBlockLength; type Block = Block; type BlockWeights = RuntimeBlockWeights; @@ -324,7 +324,7 @@ parameter_types! { impl pallet_collator_selection::Config for Runtime { type Currency = Balances; type PotId = PotId; - type KickThreshold = ConstU32<{ 6 * HOURS }>; + type KickThreshold = ConstU64<{ 6 * HOURS }>; type MaxCandidates = ConstU32<1_000>; type MaxInvulnerables = ConstU32<100>; type MinEligibleCollators = ConstU32<5>; @@ -344,11 +344,11 @@ impl_opaque_keys! { impl pallet_session::Config for Runtime { type Keys = SessionKeys; - type NextSessionRotation = PeriodicSessions, ConstU32<0>>; + type NextSessionRotation = PeriodicSessions, ConstU64<0>>; type RuntimeEvent = RuntimeEvent; type SessionHandler = ::KeyTypeIdProviders; type SessionManager = CollatorSelection; - type ShouldEndSession = PeriodicSessions, ConstU32<0>>; + type ShouldEndSession = PeriodicSessions, ConstU64<0>>; type ValidatorId = AccountId; type ValidatorIdOf = IdentityCollator; type WeightInfo = (); @@ -392,7 +392,7 @@ impl did::Config for Runtime { type Fee = ConstU128; type FeeCollector = (); type KeyDeposit = ConstU128; - type MaxBlocksTxValidity = ConstU32; + type MaxBlocksTxValidity = ConstU64; type MaxNewKeyAgreementKeys = MaxNewKeyAgreementKeys; type MaxNumberOfServicesPerDid = ConstU32<1>; type MaxNumberOfTypesPerService = ConstU32<1>; From 48c2c610d7c6a91f9c1579c8a93d12c59b35b6cc Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 19 Dec 2023 10:10:40 +0100 Subject: [PATCH 3/3] More changes --- dip-template/runtimes/dip-consumer/src/lib.rs | 14 +++++++------- dip-template/runtimes/dip-provider/src/lib.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dip-template/runtimes/dip-consumer/src/lib.rs b/dip-template/runtimes/dip-consumer/src/lib.rs index 06e031d2d5..cbbcb2dc20 100644 --- a/dip-template/runtimes/dip-consumer/src/lib.rs +++ b/dip-template/runtimes/dip-consumer/src/lib.rs @@ -89,12 +89,12 @@ pub type AccountId = AccountId32; pub type Address = MultiAddress; pub type Balance = u128; pub type Block = generic::Block; -pub type BlockNumber = u32; +pub type BlockNumber = u64; pub type DidIdentifier = AccountId; pub type Hasher = BlakeTwo256; pub type Hash = sp_core::H256; pub type Header = generic::Header; -pub type Nonce = u32; +pub type Nonce = u64; pub type Signature = MultiSignature; pub type SignedExtra = ( @@ -228,7 +228,7 @@ impl frame_system::Config for Runtime { type AccountData = AccountData; type AccountId = AccountId; type BaseCallFilter = Everything; - type BlockHashCount = ConstU32<256>; + type BlockHashCount = ConstU64<256>; type BlockLength = RuntimeBlockLength; type Block = Block; type BlockWeights = RuntimeBlockWeights; @@ -237,7 +237,7 @@ impl frame_system::Config for Runtime { type Hashing = BlakeTwo256; type Lookup = AccountIdLookup; type MaxConsumers = ConstU32<16>; - type Nonce = u32; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = ParachainSetCode; @@ -323,7 +323,7 @@ parameter_types! { impl pallet_collator_selection::Config for Runtime { type Currency = Balances; type PotId = PotId; - type KickThreshold = ConstU32<{ 6 * HOURS }>; + type KickThreshold = ConstU64<{ 6 * HOURS }>; type MaxCandidates = ConstU32<1_000>; type MaxInvulnerables = ConstU32<100>; type MinEligibleCollators = ConstU32<5>; @@ -343,11 +343,11 @@ impl_opaque_keys! { impl pallet_session::Config for Runtime { type Keys = SessionKeys; - type NextSessionRotation = PeriodicSessions, ConstU32<0>>; + type NextSessionRotation = PeriodicSessions, ConstU64<0>>; type RuntimeEvent = RuntimeEvent; type SessionHandler = ::KeyTypeIdProviders; type SessionManager = CollatorSelection; - type ShouldEndSession = PeriodicSessions, ConstU32<0>>; + type ShouldEndSession = PeriodicSessions, ConstU64<0>>; type ValidatorId = AccountId; type ValidatorIdOf = IdentityCollator; type WeightInfo = (); diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index ac6208bb09..7d6e1581af 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -93,7 +93,7 @@ pub type BlockNumber = u64; pub type DidIdentifier = AccountId; pub type Hash = sp_core::H256; pub type Header = generic::Header; -pub type Nonce = u32; +pub type Nonce = u64; pub type Signature = MultiSignature; pub type SignedExtra = ( @@ -238,7 +238,7 @@ impl frame_system::Config for Runtime { type Hashing = BlakeTwo256; type Lookup = AccountIdLookup; type MaxConsumers = ConstU32<16>; - type Nonce = u32; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = ParachainSetCode;