Skip to content

Commit

Permalink
Companion for paritytech/substrate#12183 (#1601)
Browse files Browse the repository at this point in the history
* Companion for paritytech/substrate#12183

* Fixes

* Update pallets/xcmp-queue/src/lib.rs

* Update pallets/xcmp-queue/src/lib.rs

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
  • Loading branch information
KiChjang authored Sep 8, 2022
1 parent 870b2bf commit 2a8b940
Show file tree
Hide file tree
Showing 24 changed files with 126 additions and 72 deletions.
7 changes: 5 additions & 2 deletions runtimes/assets/statemine/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ pub mod constants {

// At least 100 µs.
assert!(
w >= 100u64 * constants::WEIGHT_PER_MICROS,
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
}
10 changes: 8 additions & 2 deletions runtimes/assets/statemine/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ pub mod constants {
let w = super::constants::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 1 ms."
);
}
}
}
8 changes: 4 additions & 4 deletions runtimes/assets/statemine/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
8 changes: 4 additions & 4 deletions runtimes/assets/statemine/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
7 changes: 5 additions & 2 deletions runtimes/assets/statemint/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ pub mod constants {

// At least 100 µs.
assert!(
w >= 100u64 * constants::WEIGHT_PER_MICROS,
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
}
10 changes: 8 additions & 2 deletions runtimes/assets/statemint/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ pub mod constants {
let w = super::constants::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 1 ms."
);
}
}
}
8 changes: 4 additions & 4 deletions runtimes/assets/statemint/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
8 changes: 4 additions & 4 deletions runtimes/assets/statemint/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
7 changes: 5 additions & 2 deletions runtimes/assets/westmint/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ pub mod constants {

// At least 100 µs.
assert!(
w >= 100u64 * constants::WEIGHT_PER_MICROS,
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
}
10 changes: 8 additions & 2 deletions runtimes/assets/westmint/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ pub mod constants {
let w = super::constants::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 1 ms."
);
}
}
}
8 changes: 4 additions & 4 deletions runtimes/assets/westmint/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
8 changes: 4 additions & 4 deletions runtimes/assets/westmint/src/weights/rocksdb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ pub mod constants {

// At least 100 µs.
assert!(
w >= 100u64 * constants::WEIGHT_PER_MICROS,
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ pub mod constants {
let w = super::constants::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 1 ms."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ pub mod constants {

// At least 100 µs.
assert!(
w >= 100u64 * constants::WEIGHT_PER_MICROS,
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(w <= 50u64 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms.");
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ pub mod constants {
let w = super::constants::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(w >= 10u64 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs.");
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms.");
assert!(
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 1 ms."
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ pub mod constants {
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1) >= constants::WEIGHT_PER_MICROS,
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
Expand Down
Loading

0 comments on commit 2a8b940

Please sign in to comment.