Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 2306bfb

Browse files
EgorPopelyaevdependabot[bot]rphmeierbkonturbkchr
authored
[Backport] Missing PR's to fix compilation issues in the node branch (#2964)
* [Backport] missing fellowship prs (#2891) * Update substrate dependecies * Bump serde from 1.0.167 to 1.0.168 (#2848) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.167 to 1.0.168. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.167...v1.0.168) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Asynchronous-backing compatible Aura, not plugged in (#2573) * rough draft of potential parent search * get things compiling * fmt * add new function to all RelayChainInterface implementations * fix compilation * set slot and timestamp based on relay parent, prepare for find-parent * skeleton of new aura logic * fmt * introduce a collator module in the Aura crate * extract different implementations into own modules * make interface more convenient * docs and todos for lookahead * refactor basic collator to use new collator utility * some more refactoring * finish most of the control flow for new aura * introduce backend as parameter * fix compilation * fix a couple more TODOs * add an `announce_block` function to collator service * announce with barrier * rename block announcement validator to be more specific * fmt * clean up unused import errors * update references to BlockAnnounceValidator * rename unstable_reimpl * add AuraUnincludedSegmentApi * finish rename * integrate AuraUnincludedSegmentApi * add a new block announcement validator for backwards compatibility * add some naive equivocation defenses * rustfmt * clean up remaining TODO [now]s * fmt * try to fix inprocess-interface * actually fix compilation * ignored -> rejected rephrase * fix test compilation * fmt * clippy * Bump substrate (because of failing asset-hub-westend benchmarks) (#2853) * Bump substrate (because of failing asset-hub-westend benchmarks) * Cargo.lock * Update to compatible substrate vs polkadot * Companion for removal of execution strategies (#2836) * Companion for removal of execution strategies paritytech/substrate#14387 * Update Cargo.lock * Remove patches * Delete file again * update lockfile for {"polkadot", "substrate"} * Fix * FMT --------- Co-authored-by: parity-processbot <> * `GenesisBuild<T,I>` deprecated. `BuildGenesisConfig` added (#2757) * GenesisBuild<T,I> deprecated. BuildGenesisConfig added * ".git/.scripts/commands/fmt/fmt.sh" * integration-tests/emulated: ..Default::default added to genesis configs * Cargo.lock updated * Cargo.lock updated * update lockfile for {"polkadot", "substrate"} * clippy fixes * clippy fixes * clippy fixes again --------- Co-authored-by: command-bot <> * Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#2790) * Fixes * Removes unused import * Uses Block and removes BlockNumber/Header from Chain * Fixes bridges * Fixes * Removes unused import * Fixes build * Uses correct RelayBlock * Minor fix * Fixes glutton-kusama * Uses correct RelayBlock * Minor fix * Fixes benchmark for pallet-bridge-parachains * Adds appropriate constraints * Minor fixes * Removes unused import * Fixes integrity tests * Minor fixes * Updates trait bounds * Uses custom bound for AsPrimitive * Fixes trait bounds * Revert "Fixes trait bounds" This reverts commit 0b0f42f. * Revert "Uses custom bound for AsPrimitive" This reverts commit 838e528. * No AsPrimitive trait bound for now * Removes bounds on Number * update lockfile for {"substrate", "polkadot"} * Formatting * ".git/.scripts/commands/fmt/fmt.sh" * Minor fix --------- Co-authored-by: parity-processbot <> * Replace Index for Nonce (#2740) * replace Index for Nonce * update lockfile for {"substrate", "polkadot"} --------- Co-authored-by: parity-processbot <> * Bump clap from 4.3.11 to 4.3.12 (#2873) Bumps [clap](https://github.com/clap-rs/clap) from 4.3.11 to 4.3.12. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@v4.3.11...v4.3.12) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump proc-macro2 from 1.0.63 to 1.0.64 (#2849) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.63 to 1.0.64. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](dtolnay/proc-macro2@1.0.63...1.0.64) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump syn from 2.0.23 to 2.0.25 (#2847) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.23 to 2.0.25. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](dtolnay/syn@2.0.23...2.0.25) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump serde from 1.0.168 to 1.0.171 (#2855) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.168 to 1.0.171. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.168...v1.0.171) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump serde_json from 1.0.100 to 1.0.102 (#2859) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.100 to 1.0.102. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](serde-rs/json@v1.0.100...v1.0.102) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix duplication issue * Update polkadot and substrate deps * Removed `--execution wasm` (#2857) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: asynchronous rob <[email protected]> Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]> Co-authored-by: gupnik <[email protected]> Co-authored-by: Juan <[email protected]> * Backport missing PR's to fix compilation issues * Update bridges subtree (#2903) * Squashed 'bridges/' changes from 0417308a48..3c4ada921b 3c4ada921b Update dependecies (#2277) (#2281) 3e195c9e76 GRANDPA: optimize votes_ancestries when needed (#2262) (#2264) 7065bbabc6 Implement RuntimeDebug for GrandpaJustification (#2254) 8c9e59bcbc Define generate_grandpa_key_ownership_proof() (#2247) (#2248) 0b46956df7 Deduplicate Grandpa consensus log reading logic (#2245) (#2246) 96c9701710 Fix deps from Cumulus (#2244) git-subtree-dir: bridges git-subtree-split: 3c4ada921bbdbdba945c3aa85d76ce316f7baab3 * removed extra files * post-merge fixes * also post-merge fixes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: asynchronous rob <[email protected]> Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]> Co-authored-by: gupnik <[email protected]> Co-authored-by: Juan <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
1 parent 29f5eb0 commit 2306bfb

File tree

115 files changed

+2720
-1592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2720
-1592
lines changed

Cargo.lock

Lines changed: 349 additions & 316 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ members = [
3030
"pallets/xcmp-queue",
3131
"parachain-template/node",
3232
"parachain-template/runtime",
33+
"primitives/aura",
3334
"primitives/core",
3435
"primitives/parachain-inherent",
3536
"primitives/timestamp",
@@ -74,3 +75,4 @@ opt-level = 3
7475
inherits = "release"
7576
lto = true
7677
codegen-units = 1
78+

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ cargo build --release --bin polkadot-parachain
153153
./target/release/polkadot-parachain export-genesis-wasm > genesis-wasm
154154

155155
# Collator1
156-
./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --ws-port 9946 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30335
156+
./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335
157157

158158
# Collator2
159-
./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --ws-port 9947 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30336
159+
./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336
160160

161161
# Parachain Full Node 1
162-
./target/release/polkadot-parachain --tmp --port 40337 --ws-port 9948 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30337
162+
./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- --chain ../polkadot/rococo-local-cfde.json --port 30337
163163
```
164164

165165
#### Register the parachain
@@ -267,5 +267,5 @@ docker build --tag $OWNER/$IMAGE_NAME --file ./docker/polkadot-parachain_builder
267267
You may then run your new container:
268268

269269
```bash
270-
docker run --rm -it $OWNER/$IMAGE_NAME --collator --tmp --execution wasm --chain /specs/westmint.json
270+
docker run --rm -it $OWNER/$IMAGE_NAME --collator --tmp --chain /specs/westmint.json
271271
```

bridges/bin/runtime-common/src/integrity.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ use pallet_bridge_messages::WeightInfoExt as _;
3030
use sp_runtime::traits::SignedExtension;
3131

3232
/// Macro that ensures that the runtime configuration and chain primitives crate are sharing
33-
/// the same types (index, block number, hash, hasher, account id and header).
33+
/// the same types (nonce, block number, hash, hasher, account id and header).
3434
#[macro_export]
3535
macro_rules! assert_chain_types(
3636
( runtime: $r:path, this_chain: $this:path ) => {
3737
{
3838
// if one of asserts fail, then either bridge isn't configured properly (or alternatively - non-standard
3939
// configuration is used), or something has broke existing configuration (meaning that all bridged chains
4040
// and relays will stop functioning)
41-
use frame_system::Config as SystemConfig;
41+
use frame_system::{Config as SystemConfig, pallet_prelude::{BlockNumberFor, HeaderFor}};
4242
use static_assertions::assert_type_eq_all;
4343

44-
assert_type_eq_all!(<$r as SystemConfig>::Index, bp_runtime::IndexOf<$this>);
45-
assert_type_eq_all!(<$r as SystemConfig>::BlockNumber, bp_runtime::BlockNumberOf<$this>);
44+
assert_type_eq_all!(<$r as SystemConfig>::Nonce, bp_runtime::NonceOf<$this>);
45+
assert_type_eq_all!(BlockNumberFor<$r>, bp_runtime::BlockNumberOf<$this>);
4646
assert_type_eq_all!(<$r as SystemConfig>::Hash, bp_runtime::HashOf<$this>);
4747
assert_type_eq_all!(<$r as SystemConfig>::Hashing, bp_runtime::HasherOf<$this>);
4848
assert_type_eq_all!(<$r as SystemConfig>::AccountId, bp_runtime::AccountIdOf<$this>);
49-
assert_type_eq_all!(<$r as SystemConfig>::Header, bp_runtime::HeaderOf<$this>);
49+
assert_type_eq_all!(HeaderFor<$r>, bp_runtime::HeaderOf<$this>);
5050
}
5151
}
5252
);

bridges/bin/runtime-common/src/mock.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ pub type ThisChainCallOrigin = RuntimeOrigin;
6666
/// Header of `ThisChain`.
6767
pub type ThisChainHeader = sp_runtime::generic::Header<ThisChainBlockNumber, ThisChainHasher>;
6868
/// Block of `ThisChain`.
69-
pub type ThisChainBlock = frame_system::mocking::MockBlock<TestRuntime>;
70-
/// Unchecked extrinsic of `ThisChain`.
71-
pub type ThisChainUncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
69+
pub type ThisChainBlock = frame_system::mocking::MockBlockU32<TestRuntime>;
7270

7371
/// Account identifier at the `BridgedChain`.
7472
pub type BridgedChainAccountId = u128;
@@ -108,12 +106,9 @@ pub const BRIDGED_CHAIN_MAX_EXTRINSIC_WEIGHT: usize = 2048;
108106
pub const BRIDGED_CHAIN_MAX_EXTRINSIC_SIZE: u32 = 1024;
109107

110108
frame_support::construct_runtime! {
111-
pub enum TestRuntime where
112-
Block = ThisChainBlock,
113-
NodeBlock = ThisChainBlock,
114-
UncheckedExtrinsic = ThisChainUncheckedExtrinsic,
109+
pub enum TestRuntime
115110
{
116-
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
111+
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
117112
Utility: pallet_utility,
118113
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
119114
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
@@ -148,14 +143,13 @@ parameter_types! {
148143

149144
impl frame_system::Config for TestRuntime {
150145
type RuntimeOrigin = RuntimeOrigin;
151-
type Index = u64;
146+
type Nonce = u64;
152147
type RuntimeCall = RuntimeCall;
153-
type BlockNumber = ThisChainBlockNumber;
154148
type Hash = ThisChainHash;
155149
type Hashing = ThisChainHasher;
156150
type AccountId = ThisChainAccountId;
157151
type Lookup = IdentityLookup<Self::AccountId>;
158-
type Header = ThisChainHeader;
152+
type Block = ThisChainBlock;
159153
type RuntimeEvent = RuntimeEvent;
160154
type BlockHashCount = ConstU32<250>;
161155
type Version = ();
@@ -324,7 +318,7 @@ impl Chain for ThisUnderlyingChain {
324318
type Header = ThisChainHeader;
325319
type AccountId = ThisChainAccountId;
326320
type Balance = ThisChainBalance;
327-
type Index = u32;
321+
type Nonce = u32;
328322
type Signature = sp_runtime::MultiSignature;
329323

330324
fn max_extrinsic_size() -> u32 {
@@ -364,7 +358,7 @@ impl Chain for BridgedUnderlyingChain {
364358
type Header = BridgedChainHeader;
365359
type AccountId = BridgedChainAccountId;
366360
type Balance = BridgedChainBalance;
367-
type Index = u32;
361+
type Nonce = u32;
368362
type Signature = sp_runtime::MultiSignature;
369363

370364
fn max_extrinsic_size() -> u32 {
@@ -390,7 +384,7 @@ impl Chain for BridgedUnderlyingParachain {
390384
type Header = BridgedChainHeader;
391385
type AccountId = BridgedChainAccountId;
392386
type Balance = BridgedChainBalance;
393-
type Index = u32;
387+
type Nonce = u32;
394388
type Signature = sp_runtime::MultiSignature;
395389

396390
fn max_extrinsic_size() -> u32 {

bridges/modules/grandpa/src/call_ext.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ pub(crate) fn submit_finality_proof_info_from_args<T: Config<I>, I: 'static>(
179179
/// Returns maximal expected size of `submit_finality_proof` call arguments.
180180
fn max_expected_call_size<T: Config<I>, I: 'static>(required_precommits: u32) -> u32 {
181181
let max_expected_justification_size =
182-
GrandpaJustification::max_reasonable_size::<T::BridgedChain>(required_precommits);
182+
GrandpaJustification::<BridgedHeader<T, I>>::max_reasonable_size::<T::BridgedChain>(
183+
required_precommits,
184+
);
183185

184186
// call arguments are header and justification
185187
T::BridgedChain::MAX_HEADER_SIZE.saturating_add(max_expected_justification_size)

bridges/modules/grandpa/src/lib.rs

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
pub use storage_types::StoredAuthoritySet;
4040

4141
use bp_header_chain::{
42-
justification::GrandpaJustification, ChainWithGrandpa, HeaderChain, InitializationData,
43-
StoredHeaderData, StoredHeaderDataBuilder,
42+
justification::GrandpaJustification, ChainWithGrandpa, GrandpaConsensusLogReader, HeaderChain,
43+
InitializationData, StoredHeaderData, StoredHeaderDataBuilder,
4444
};
4545
use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
4646
use finality_grandpa::voter_set::VoterSet;
4747
use frame_support::{dispatch::PostDispatchInfo, ensure, DefaultNoBound};
48-
use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
4948
use sp_runtime::{
5049
traits::{Header as HeaderT, Zero},
5150
SaturatedConversion,
@@ -380,7 +379,7 @@ pub mod pallet {
380379
}
381380

382381
#[pallet::genesis_build]
383-
impl<T: Config<I>, I: 'static> GenesisBuild<T, I> for GenesisConfig<T, I> {
382+
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
384383
fn build(&self) {
385384
if let Some(ref owner) = self.owner {
386385
<PalletOwner<T, I>>::put(owner);
@@ -443,11 +442,17 @@ pub mod pallet {
443442

444443
// We don't support forced changes - at that point governance intervention is required.
445444
ensure!(
446-
super::find_forced_change(header).is_none(),
445+
GrandpaConsensusLogReader::<BridgedBlockNumber<T, I>>::find_forced_change(
446+
header.digest()
447+
)
448+
.is_none(),
447449
<Error<T, I>>::UnsupportedScheduledChange
448450
);
449451

450-
if let Some(change) = super::find_scheduled_change(header) {
452+
if let Some(change) =
453+
GrandpaConsensusLogReader::<BridgedBlockNumber<T, I>>::find_scheduled_change(
454+
header.digest(),
455+
) {
451456
// GRANDPA only includes a `delay` for forced changes, so this isn't valid.
452457
ensure!(change.delay == Zero::zero(), <Error<T, I>>::UnsupportedScheduledChange);
453458

@@ -616,42 +621,6 @@ impl<T: Config<I>, I: 'static> HeaderChain<BridgedChain<T, I>> for GrandpaChainH
616621
}
617622
}
618623

619-
pub(crate) fn find_scheduled_change<H: HeaderT>(
620-
header: &H,
621-
) -> Option<sp_consensus_grandpa::ScheduledChange<H::Number>> {
622-
use sp_runtime::generic::OpaqueDigestItemId;
623-
624-
let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID);
625-
626-
let filter_log = |log: ConsensusLog<H::Number>| match log {
627-
ConsensusLog::ScheduledChange(change) => Some(change),
628-
_ => None,
629-
};
630-
631-
// find the first consensus digest with the right ID which converts to
632-
// the right kind of consensus log.
633-
header.digest().convert_first(|l| l.try_to(id).and_then(filter_log))
634-
}
635-
636-
/// Checks the given header for a consensus digest signaling a **forced** scheduled change and
637-
/// extracts it.
638-
pub(crate) fn find_forced_change<H: HeaderT>(
639-
header: &H,
640-
) -> Option<(H::Number, sp_consensus_grandpa::ScheduledChange<H::Number>)> {
641-
use sp_runtime::generic::OpaqueDigestItemId;
642-
643-
let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID);
644-
645-
let filter_log = |log: ConsensusLog<H::Number>| match log {
646-
ConsensusLog::ForcedChange(delay, change) => Some((delay, change)),
647-
_ => None,
648-
};
649-
650-
// find the first consensus digest with the right ID which converts to
651-
// the right kind of consensus log.
652-
header.digest().convert_first(|l| l.try_to(id).and_then(filter_log))
653-
}
654-
655624
/// (Re)initialize bridge with given header for using it in `pallet-bridge-messages` benchmarks.
656625
#[cfg(feature = "runtime-benchmarks")]
657626
pub fn initialize_for_benchmarks<T: Config<I>, I: 'static>(header: BridgedHeader<T, I>) {
@@ -685,6 +654,7 @@ mod tests {
685654
storage::generator::StorageValue,
686655
};
687656
use frame_system::{EventRecord, Phase};
657+
use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
688658
use sp_core::Get;
689659
use sp_runtime::{Digest, DigestItem, DispatchError};
690660

bridges/modules/grandpa/src/mock.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,25 @@ use frame_support::{
2626
};
2727
use sp_core::sr25519::Signature;
2828
use sp_runtime::{
29-
testing::{Header, H256},
29+
testing::H256,
3030
traits::{BlakeTwo256, IdentityLookup},
3131
Perbill,
3232
};
3333

3434
pub type AccountId = u64;
35-
pub type TestHeader = crate::BridgedHeader<TestRuntime, ()>;
36-
pub type TestNumber = crate::BridgedBlockNumber<TestRuntime, ()>;
35+
pub type TestHeader = sp_runtime::testing::Header;
36+
pub type TestNumber = u64;
3737

3838
type Block = frame_system::mocking::MockBlock<TestRuntime>;
39-
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
4039

4140
pub const MAX_BRIDGED_AUTHORITIES: u32 = 5;
4241

4342
use crate as grandpa;
4443

4544
construct_runtime! {
46-
pub enum TestRuntime where
47-
Block = Block,
48-
NodeBlock = Block,
49-
UncheckedExtrinsic = UncheckedExtrinsic,
45+
pub enum TestRuntime
5046
{
51-
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
47+
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
5248
Grandpa: grandpa::{Pallet, Call, Event<T>},
5349
}
5450
}
@@ -61,14 +57,13 @@ parameter_types! {
6157

6258
impl frame_system::Config for TestRuntime {
6359
type RuntimeOrigin = RuntimeOrigin;
64-
type Index = u64;
60+
type Nonce = u64;
6561
type RuntimeCall = RuntimeCall;
66-
type BlockNumber = u64;
6762
type Hash = H256;
6863
type Hashing = BlakeTwo256;
6964
type AccountId = AccountId;
7065
type Lookup = IdentityLookup<Self::AccountId>;
71-
type Header = Header;
66+
type Block = Block;
7267
type RuntimeEvent = RuntimeEvent;
7368
type BlockHashCount = ConstU64<250>;
7469
type Version = ();
@@ -105,14 +100,14 @@ impl grandpa::Config for TestRuntime {
105100
pub struct TestBridgedChain;
106101

107102
impl Chain for TestBridgedChain {
108-
type BlockNumber = <TestRuntime as frame_system::Config>::BlockNumber;
103+
type BlockNumber = TestNumber;
109104
type Hash = <TestRuntime as frame_system::Config>::Hash;
110105
type Hasher = <TestRuntime as frame_system::Config>::Hashing;
111-
type Header = <TestRuntime as frame_system::Config>::Header;
106+
type Header = TestHeader;
112107

113108
type AccountId = AccountId;
114109
type Balance = u64;
115-
type Index = u64;
110+
type Nonce = u64;
116111
type Signature = Signature;
117112

118113
fn max_extrinsic_size() -> u32 {

bridges/modules/messages/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ pub mod pallet {
188188
#[pallet::hooks]
189189
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I>
190190
where
191-
u32: TryFrom<<T as frame_system::Config>::BlockNumber>,
191+
u32: TryFrom<BlockNumberFor<T>>,
192192
{
193-
fn on_idle(_block: T::BlockNumber, remaining_weight: Weight) -> Weight {
193+
fn on_idle(_block: BlockNumberFor<T>, remaining_weight: Weight) -> Weight {
194194
// we'll need at least to read outbound lane state, kill a message and update lane state
195195
let db_weight = T::DbWeight::get();
196196
if !remaining_weight.all_gte(db_weight.reads_writes(1, 2)) {
@@ -597,7 +597,7 @@ pub mod pallet {
597597
}
598598

599599
#[pallet::genesis_build]
600-
impl<T: Config<I>, I: 'static> GenesisBuild<T, I> for GenesisConfig<T, I> {
600+
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
601601
fn build(&self) {
602602
PalletOperatingMode::<T, I>::put(self.operating_mode);
603603
if let Some(ref owner) = self.owner {

bridges/modules/messages/src/mock.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ use frame_support::{
3939
use scale_info::TypeInfo;
4040
use sp_core::H256;
4141
use sp_runtime::{
42-
testing::Header as SubstrateHeader,
4342
traits::{BlakeTwo256, ConstU32, IdentityLookup},
44-
Perbill,
43+
BuildStorage, Perbill,
4544
};
4645
use std::{
4746
collections::{BTreeMap, VecDeque},
@@ -71,17 +70,13 @@ pub type TestRelayer = u64;
7170
pub type TestDispatchLevelResult = ();
7271

7372
type Block = frame_system::mocking::MockBlock<TestRuntime>;
74-
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
7573

7674
use crate as pallet_bridge_messages;
7775

7876
frame_support::construct_runtime! {
79-
pub enum TestRuntime where
80-
Block = Block,
81-
NodeBlock = Block,
82-
UncheckedExtrinsic = UncheckedExtrinsic,
77+
pub enum TestRuntime
8378
{
84-
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
79+
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
8580
Balances: pallet_balances::{Pallet, Call, Event<T>},
8681
Messages: pallet_bridge_messages::{Pallet, Call, Event<T>},
8782
}
@@ -98,14 +93,13 @@ pub type DbWeight = RocksDbWeight;
9893

9994
impl frame_system::Config for TestRuntime {
10095
type RuntimeOrigin = RuntimeOrigin;
101-
type Index = u64;
96+
type Nonce = u64;
10297
type RuntimeCall = RuntimeCall;
103-
type BlockNumber = u64;
10498
type Hash = H256;
10599
type Hashing = BlakeTwo256;
106100
type AccountId = AccountId;
107101
type Lookup = IdentityLookup<Self::AccountId>;
108-
type Header = SubstrateHeader;
102+
type Block = Block;
109103
type RuntimeEvent = RuntimeEvent;
110104
type BlockHashCount = ConstU64<250>;
111105
type Version = ();
@@ -487,7 +481,7 @@ pub fn inbound_unrewarded_relayers_state(lane: bp_messages::LaneId) -> Unrewarde
487481

488482
/// Return test externalities to use in tests.
489483
pub fn new_test_ext() -> sp_io::TestExternalities {
490-
let mut t = frame_system::GenesisConfig::default().build_storage::<TestRuntime>().unwrap();
484+
let mut t = frame_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
491485
pallet_balances::GenesisConfig::<TestRuntime> { balances: vec![(ENDOWED_ACCOUNT, 1_000_000)] }
492486
.assimilate_storage(&mut t)
493487
.unwrap();

bridges/modules/parachains/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ pub mod pallet {
623623
}
624624

625625
#[pallet::genesis_build]
626-
impl<T: Config<I>, I: 'static> GenesisBuild<T, I> for GenesisConfig<T, I> {
626+
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
627627
fn build(&self) {
628628
PalletOperatingMode::<T, I>::put(self.operating_mode);
629629
if let Some(ref owner) = self.owner {

0 commit comments

Comments
 (0)