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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rh-async-backing-fe…
Browse files Browse the repository at this point in the history
…ature-while-frozen
  • Loading branch information
slumber committed May 25, 2023
2 parents baf1365 + dfab533 commit 5c53e31
Show file tree
Hide file tree
Showing 56 changed files with 1,530 additions and 777 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variables:
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.50"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.55"

default:
cache: {}
Expand Down
368 changes: 184 additions & 184 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions node/network/availability-recovery/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ async fn overseer_signal(
.send(FromOrchestra::Signal(signal))
.timeout(TIMEOUT)
.await
.expect("10ms is more than enough for sending signals.");
.unwrap_or_else(|| {
panic!("{}ms is more than enough for sending signals.", TIMEOUT.as_millis())
});
}

async fn overseer_send(
Expand All @@ -184,7 +186,9 @@ async fn overseer_send(
.send(FromOrchestra::Communication { msg })
.timeout(TIMEOUT)
.await
.expect("10ms is more than enough for sending messages.");
.unwrap_or_else(|| {
panic!("{}ms is more than enough for sending messages.", TIMEOUT.as_millis())
});
}

async fn overseer_recv(
Expand Down
11 changes: 6 additions & 5 deletions node/network/bitfield-distribution/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ use sp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};

use std::{iter::FromIterator as _, sync::Arc, time::Duration};

const TIMEOUT: Duration = Duration::from_millis(50);
macro_rules! launch {
($fut:expr) => {
$fut.timeout(Duration::from_millis(10))
.await
.expect("10ms is more than enough for sending messages.")
$fut.timeout(TIMEOUT).await.unwrap_or_else(|| {
panic!("{}ms is more than enough for sending messages.", TIMEOUT.as_millis())
});
};
}

Expand Down Expand Up @@ -231,7 +232,7 @@ fn receive_invalid_signature() {
));

// reputation doesn't change due to one_job_per_validator check
assert!(handle.recv().timeout(Duration::from_millis(10)).await.is_none());
assert!(handle.recv().timeout(TIMEOUT).await.is_none());

launch!(handle_network_msg(
&mut ctx,
Expand Down Expand Up @@ -549,7 +550,7 @@ fn do_not_relay_message_twice() {
);

// There shouldn't be any other message
assert!(handle.recv().timeout(Duration::from_millis(10)).await.is_none());
assert!(handle.recv().timeout(TIMEOUT).await.is_none());
});
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/assigned_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ mod tests {
type MaxLocks = ();
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/auctions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ mod tests {
type MaxLocks = ();
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ mod tests {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/crowdloan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ mod tests {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod tests {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl pallet_balances::Config for Test {
type WeightInfo = ();
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ mod tests {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/purchase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ mod tests {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/slots/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ mod tests {
type MaxLocks = ();
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
7 changes: 3 additions & 4 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl pallet_balances::Config for Runtime {
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
type FreezeIdentifier = ();
type MaxFreezes = ();
type HoldIdentifier = RuntimeHoldReason;
type RuntimeHoldReason = RuntimeHoldReason;
type MaxHolds = ConstU32<1>;
}

Expand Down Expand Up @@ -1284,7 +1284,7 @@ impl pallet_balances::Config<NisCounterpartInstance> for Runtime {
type MaxReserves = ConstU32<4>;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances_nis_counterpart_balances::WeightInfo<Runtime>;
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand All @@ -1299,7 +1299,6 @@ parameter_types! {
pub const ThawThrottle: (Perquintill, BlockNumber) = (Perquintill::from_percent(25), 5);
pub storage NisTarget: Perquintill = Perquintill::zero();
pub const NisPalletId: PalletId = PalletId(*b"py/nis ");
pub const NisHoldReason: RuntimeHoldReason = RuntimeHoldReason::Nis(pallet_nis::HoldReason::NftReceipt);
}

impl pallet_nis::Config for Runtime {
Expand All @@ -1323,7 +1322,7 @@ impl pallet_nis::Config for Runtime {
type IntakePeriod = IntakePeriod;
type MaxIntakeWeight = MaxIntakeWeight;
type ThawThrottle = ThawThrottle;
type HoldReason = NisHoldReason;
type RuntimeHoldReason = RuntimeHoldReason;
}

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use sp_runtime::FixedPointNumber;

#[test]
fn nis_hold_reason_encoding_is_correct() {
assert_eq!(NisHoldReason::get().encode(), [38, 0]);
assert_eq!(RuntimeHoldReason::Nis(pallet_nis::HoldReason::NftReceipt).encode(), [38, 0]);
}

#[test]
Expand Down
12 changes: 6 additions & 6 deletions runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ use xcm_builder::{
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete,
MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds,
WithComputedOrigin,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
};
use xcm_executor::traits::WithOriginFilter;

Expand Down Expand Up @@ -115,14 +115,14 @@ parameter_types! {

/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our
/// individual routers.
pub type XcmRouter = (
pub type XcmRouter = WithUniqueTopic<(
// Only one router so far - use DMP to communicate with child parachains.
ChildParachainRouter<
Runtime,
XcmPallet,
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>,
>,
);
)>;

parameter_types! {
pub const Ksm: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
Expand All @@ -142,7 +142,7 @@ match_types! {
}

/// The barriers one of which must be passed for an XCM message to be executed.
pub type Barrier = (
pub type Barrier = TrailingSetTopicAsId<(
// Weight that is paid for may be consumed.
TakeWeightCredit,
// Expected responses are OK.
Expand All @@ -159,7 +159,7 @@ pub type Barrier = (
UniversalLocation,
ConstU32<8>,
>,
);
)>;

/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl pallet_balances::Config for Test {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl pallet_balances::Config for Runtime {
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
12 changes: 4 additions & 8 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl pallet_balances::Config for Runtime {
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
type FreezeIdentifier = ();
type MaxFreezes = ConstU32<1>;
type HoldIdentifier = RuntimeHoldReason;
type RuntimeHoldReason = RuntimeHoldReason;
type MaxHolds = ConstU32<1>;
}

Expand Down Expand Up @@ -1225,7 +1225,7 @@ impl pallet_balances::Config<NisCounterpartInstance> for Runtime {
type MaxReserves = ConstU32<4>;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances_nis_counterpart_balances::WeightInfo<Runtime>;
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand All @@ -1240,7 +1240,6 @@ parameter_types! {
pub const ThawThrottle: (Perquintill, BlockNumber) = (Perquintill::from_percent(25), 5);
pub storage NisTarget: Perquintill = Perquintill::zero();
pub const NisPalletId: PalletId = PalletId(*b"py/nis ");
pub const NisHoldReason: RuntimeHoldReason = RuntimeHoldReason::Nis(pallet_nis::HoldReason::NftReceipt);
}

impl pallet_nis::Config for Runtime {
Expand All @@ -1264,7 +1263,7 @@ impl pallet_nis::Config for Runtime {
type IntakePeriod = IntakePeriod;
type MaxIntakeWeight = MaxIntakeWeight;
type ThawThrottle = ThawThrottle;
type HoldReason = NisHoldReason;
type RuntimeHoldReason = RuntimeHoldReason;
}

parameter_types! {
Expand All @@ -1282,12 +1281,9 @@ impl pallet_beefy::Config for Runtime {
pallet_beefy::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}

type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;

impl pallet_mmr::Config for Runtime {
const INDEXING_PREFIX: &'static [u8] = mmr::INDEXING_PREFIX;
type Hashing = Keccak256;
type Hash = MmrHash;
type OnNewRoot = pallet_beefy_mmr::DepositBeefyDigest<Runtime>;
type WeightInfo = ();
type LeafData = pallet_beefy_mmr::Pallet<Runtime>;
Expand Down Expand Up @@ -2315,7 +2311,7 @@ mod encoding_tests {

#[test]
fn nis_hold_reason_encoding_is_correct() {
assert_eq!(NisHoldReason::get().encode(), [38, 0]);
assert_eq!(RuntimeHoldReason::Nis(pallet_nis::HoldReason::NftReceipt).encode(), [38, 0]);
}
}

Expand Down
11 changes: 6 additions & 5 deletions runtime/rococo/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ use xcm_builder::{
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete,
MintLocation, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin,
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
WithUniqueTopic,
};
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};

Expand Down Expand Up @@ -95,14 +96,14 @@ parameter_types! {

/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our
/// individual routers.
pub type XcmRouter = (
pub type XcmRouter = WithUniqueTopic<(
// Only one router so far - use DMP to communicate with child parachains.
ChildParachainRouter<
Runtime,
XcmPallet,
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>,
>,
);
)>;

parameter_types! {
pub const Roc: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
Expand Down Expand Up @@ -137,7 +138,7 @@ match_types! {
}

/// The barriers one of which must be passed for an XCM message to be executed.
pub type Barrier = (
pub type Barrier = TrailingSetTopicAsId<(
// Weight that is paid for may be consumed.
TakeWeightCredit,
// Expected responses are OK.
Expand All @@ -154,7 +155,7 @@ pub type Barrier = (
UniversalLocation,
ConstU32<8>,
>,
);
)>;

/// A call filter for the XCM Transact instruction. This is a temporary measure until we
/// properly account for proof size weights.
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl pallet_balances::Config for Runtime {
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl pallet_balances::Config for Runtime {
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
Loading

0 comments on commit 5c53e31

Please sign in to comment.