Skip to content

Commit f696d51

Browse files
authored
Merge branch 'master' into voting_hook
2 parents 9807ca9 + 35e6bef commit f696d51

File tree

22 files changed

+1423
-65
lines changed

22 files changed

+1423
-65
lines changed

.github/workflows/check-frame-omni-bencher.yml

+14-3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
8080
matrix:
8181
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
82+
bench_cmd: ["pallet", "overhead"]
8283
container:
8384
image: ${{ needs.preflight.outputs.IMAGE }}
8485
env:
@@ -89,16 +90,26 @@ jobs:
8990
- name: Checkout
9091
uses: actions/checkout@v4
9192

92-
- name: script
93+
- name: script (benchmark ${{ matrix.bench_cmd }})
9394
id: required
95+
shell: bash
9496
run: |
9597
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
9698
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
99+
BENCH_CMD=${{ matrix.bench_cmd }}
97100
forklift cargo build --release --locked -p $PACKAGE_NAME -p frame-omni-bencher --features=${{ matrix.runtime.bench_features }} --quiet
98-
echo "Running short benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
101+
echo "Running short $BENCH_CMD benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
99102
ls -lrt $RUNTIME_BLOB_PATH
103+
104+
if [[ "$BENCH_CMD" == "pallet" ]]; then
105+
cmd="./target/release/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS"
106+
elif [[ "$BENCH_CMD" == "overhead" ]]; then
107+
cmd="./target/release/frame-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH"
108+
else
109+
echo "Error: Unknown BENCH_CMD value: $BENCH_CMD"
110+
exit 1
111+
fi
100112
101-
cmd="./target/release/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS"
102113
echo "Running command: $cmd"
103114
eval "$cmd"
104115
- name: Stop all workflows if failed

Cargo.lock

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ members = [
379379
"substrate/frame/membership",
380380
"substrate/frame/merkle-mountain-range",
381381
"substrate/frame/message-queue",
382+
"substrate/frame/meta-tx",
382383
"substrate/frame/metadata-hash-extension",
383384
"substrate/frame/migrations",
384385
"substrate/frame/mixnet",
@@ -962,6 +963,7 @@ pallet-insecure-randomness-collective-flip = { path = "substrate/frame/insecure-
962963
pallet-lottery = { default-features = false, path = "substrate/frame/lottery" }
963964
pallet-membership = { path = "substrate/frame/membership", default-features = false }
964965
pallet-message-queue = { path = "substrate/frame/message-queue", default-features = false }
966+
pallet-meta-tx = { path = "substrate/frame/meta-tx", default-features = false }
965967
pallet-migrations = { path = "substrate/frame/migrations", default-features = false }
966968
pallet-minimal-template = { path = "templates/minimal/pallets/template", default-features = false }
967969
pallet-mixnet = { default-features = false, path = "substrate/frame/mixnet" }

cumulus/README.md

+13-27
Original file line numberDiff line numberDiff line change
@@ -211,40 +211,26 @@ Refer to the [setup instructions](#manual-setup) to run a local network for deve
211211

212212
See [the `bridge-hubs` readme](parachains/runtimes/bridge-hubs/README.md) for details.
213213

214-
## Rococo 👑
215-
[Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a [Community Parachain
216-
Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/) for parachain teams in the
217-
Polkadot ecosystem. It supports multiple parachains with the differentiation of long-term connections and recurring
218-
short-term connections, to see which parachains are currently connected and how long they will be connected for [see
219-
here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains).
214+
## Testnets
220215

221-
Rococo is an elaborate style of design and the name describes the painstaking effort that has gone into this project.
216+
### Paseo
222217

223-
### Build & Launch Rococo Collators
218+
[Paseo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fpaseo.rpc.amforc.com#/explorer) is the newest testnet for Polkadot,
219+
replacing Rococo as a decentralised, community run, stable testnet for Parachain teams and dapp developers to build on.
220+
For more information, check the [Paseo repo](https://github.com/paseo-network).
224221

225-
Collators are similar to validators in the relay chain. These nodes build the blocks that will eventually be included by
226-
the relay chain for a parachain.
222+
### Westend
227223

228-
To run a Rococo collator you will need to compile the following binary:
224+
[Westend](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwestend-rpc.polkadot.io#/explorer)
225+
is a long running testnet for Polkadot,
226+
primarily intended to provide a testing environment for Parity to test the latest changes in the SDK.
229227

228+
### Testnet Parachains
230229

231-
```bash
232-
cargo build --release --locked --bin polkadot-parachain
233-
```
234-
235-
Once the executable is built, launch collators for each parachain (repeat once each for chain `tick`, `trick`, `track`):
236-
237-
```bash
238-
./target/release/polkadot-parachain --chain $CHAIN --validator
239-
```
240-
241-
You can also build [using a container](./docs/contributor/container.md).
242-
243-
### Parachains
230+
A few testnet parachain instances:
244231

245-
- [Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer)
246-
- [Contracts on Rococo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer)
247-
- [RILT](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.kilt.io#/explorer)
232+
- [Asset Hub Westend](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwestend-asset-hub-rpc.polkadot.io#/explorer)
233+
- [Frequency Paseo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F0.rpc.testnet.amplica.io#/explorer)
248234

249235
The network uses horizontal message passing (HRMP) to enable communication between parachains and the relay chain and,
250236
in turn, between parachains. This means that every message is sent to the relay chain, and from the relay chain to its

polkadot/runtime/westend/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pallet-identity = { workspace = true }
7070
pallet-indices = { workspace = true }
7171
pallet-membership = { workspace = true }
7272
pallet-message-queue = { workspace = true }
73+
pallet-meta-tx = { workspace = true }
7374
pallet-migrations = { workspace = true }
7475
pallet-mmr = { workspace = true }
7576
pallet-multisig = { workspace = true }
@@ -94,6 +95,7 @@ pallet-transaction-payment = { workspace = true }
9495
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
9596
pallet-treasury = { workspace = true }
9697
pallet-utility = { workspace = true }
98+
pallet-verify-signature = { workspace = true }
9799
pallet-vesting = { workspace = true }
98100
pallet-whitelist = { workspace = true }
99101
pallet-xcm = { workspace = true }
@@ -168,6 +170,7 @@ std = [
168170
"pallet-indices/std",
169171
"pallet-membership/std",
170172
"pallet-message-queue/std",
173+
"pallet-meta-tx/std",
171174
"pallet-migrations/std",
172175
"pallet-mmr/std",
173176
"pallet-multisig/std",
@@ -195,6 +198,7 @@ std = [
195198
"pallet-transaction-payment/std",
196199
"pallet-treasury/std",
197200
"pallet-utility/std",
201+
"pallet-verify-signature/std",
198202
"pallet-vesting/std",
199203
"pallet-whitelist/std",
200204
"pallet-xcm-benchmarks?/std",
@@ -257,6 +261,7 @@ runtime-benchmarks = [
257261
"pallet-indices/runtime-benchmarks",
258262
"pallet-membership/runtime-benchmarks",
259263
"pallet-message-queue/runtime-benchmarks",
264+
"pallet-meta-tx/runtime-benchmarks",
260265
"pallet-migrations/runtime-benchmarks",
261266
"pallet-mmr/runtime-benchmarks",
262267
"pallet-multisig/runtime-benchmarks",
@@ -279,6 +284,7 @@ runtime-benchmarks = [
279284
"pallet-transaction-payment/runtime-benchmarks",
280285
"pallet-treasury/runtime-benchmarks",
281286
"pallet-utility/runtime-benchmarks",
287+
"pallet-verify-signature/runtime-benchmarks",
282288
"pallet-vesting/runtime-benchmarks",
283289
"pallet-whitelist/runtime-benchmarks",
284290
"pallet-xcm-benchmarks/runtime-benchmarks",
@@ -319,6 +325,7 @@ try-runtime = [
319325
"pallet-indices/try-runtime",
320326
"pallet-membership/try-runtime",
321327
"pallet-message-queue/try-runtime",
328+
"pallet-meta-tx/try-runtime",
322329
"pallet-migrations/try-runtime",
323330
"pallet-mmr/try-runtime",
324331
"pallet-multisig/try-runtime",
@@ -340,6 +347,7 @@ try-runtime = [
340347
"pallet-transaction-payment/try-runtime",
341348
"pallet-treasury/try-runtime",
342349
"pallet-utility/try-runtime",
350+
"pallet-verify-signature/try-runtime",
343351
"pallet-vesting/try-runtime",
344352
"pallet-whitelist/try-runtime",
345353
"pallet-xcm/try-runtime",

polkadot/runtime/westend/src/lib.rs

+38-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ use sp_runtime::{
104104
OpaqueKeys, SaturatedConversion, Verify,
105105
},
106106
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
107-
ApplyExtrinsicResult, FixedU128, KeyTypeId, Percent, Permill,
107+
ApplyExtrinsicResult, FixedU128, KeyTypeId, MultiSignature, MultiSigner, Percent, Permill,
108108
};
109109
use sp_staking::SessionIndex;
110110
#[cfg(any(feature = "std", test))]
@@ -1616,6 +1616,35 @@ impl OnSwap for SwapLeases {
16161616
}
16171617
}
16181618

1619+
pub type MetaTxExtension = (
1620+
pallet_verify_signature::VerifySignature<Runtime>,
1621+
pallet_meta_tx::MetaTxMarker<Runtime>,
1622+
frame_system::CheckNonZeroSender<Runtime>,
1623+
frame_system::CheckSpecVersion<Runtime>,
1624+
frame_system::CheckTxVersion<Runtime>,
1625+
frame_system::CheckGenesis<Runtime>,
1626+
frame_system::CheckMortality<Runtime>,
1627+
frame_system::CheckNonce<Runtime>,
1628+
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
1629+
);
1630+
1631+
impl pallet_meta_tx::Config for Runtime {
1632+
type WeightInfo = weights::pallet_meta_tx::WeightInfo<Runtime>;
1633+
type RuntimeEvent = RuntimeEvent;
1634+
#[cfg(not(feature = "runtime-benchmarks"))]
1635+
type Extension = MetaTxExtension;
1636+
#[cfg(feature = "runtime-benchmarks")]
1637+
type Extension = pallet_meta_tx::WeightlessExtension<Runtime>;
1638+
}
1639+
1640+
impl pallet_verify_signature::Config for Runtime {
1641+
type Signature = MultiSignature;
1642+
type AccountIdentifier = MultiSigner;
1643+
type WeightInfo = weights::pallet_verify_signature::WeightInfo<Runtime>;
1644+
#[cfg(feature = "runtime-benchmarks")]
1645+
type BenchmarkHelper = ();
1646+
}
1647+
16191648
#[frame_support::runtime(legacy_ordering)]
16201649
mod runtime {
16211650
#[runtime::runtime]
@@ -1809,6 +1838,12 @@ mod runtime {
18091838
#[runtime::pallet_index(102)]
18101839
pub type RootTesting = pallet_root_testing;
18111840

1841+
#[runtime::pallet_index(103)]
1842+
pub type MetaTx = pallet_meta_tx::Pallet<Runtime>;
1843+
1844+
#[runtime::pallet_index(104)]
1845+
pub type VerifySignature = pallet_verify_signature::Pallet<Runtime>;
1846+
18121847
// BEEFY Bridges support.
18131848
#[runtime::pallet_index(200)]
18141849
pub type Beefy = pallet_beefy;
@@ -1959,6 +1994,8 @@ mod benches {
19591994
[pallet_vesting, Vesting]
19601995
[pallet_whitelist, Whitelist]
19611996
[pallet_asset_rate, AssetRate]
1997+
[pallet_meta_tx, MetaTx]
1998+
[pallet_verify_signature, VerifySignature]
19621999
// XCM
19632000
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
19642001
// NOTE: Make sure you point to the individual modules below.

polkadot/runtime/westend/src/weights/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub mod pallet_fast_unstake;
2828
pub mod pallet_identity;
2929
pub mod pallet_indices;
3030
pub mod pallet_message_queue;
31+
pub mod pallet_meta_tx;
3132
pub mod pallet_migrations;
3233
pub mod pallet_mmr;
3334
pub mod pallet_multisig;
@@ -44,6 +45,7 @@ pub mod pallet_timestamp;
4445
pub mod pallet_transaction_payment;
4546
pub mod pallet_treasury;
4647
pub mod pallet_utility;
48+
pub mod pallet_verify_signature;
4749
pub mod pallet_vesting;
4850
pub mod pallet_whitelist;
4951
pub mod pallet_xcm;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (C) Parity Technologies (UK) Ltd.
2+
// This file is part of Polkadot.
3+
4+
// Polkadot is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
9+
// Polkadot is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
14+
// You should have received a copy of the GNU General Public License
15+
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
16+
17+
//! Autogenerated weights for `pallet_meta_tx`
18+
//!
19+
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
20+
//! DATE: 2024-11-08, STEPS: `50`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
21+
//! WORST CASE MAP SIZE: `1000000`
22+
//! HOSTNAME: `cob`, CPU: `<UNKNOWN>`
23+
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024
24+
25+
// Executed Command:
26+
// ./target/debug/polkadot
27+
// benchmark
28+
// pallet
29+
// --chain=westend-dev
30+
// --steps=50
31+
// --repeat=2
32+
// --pallet=pallet-meta-tx
33+
// --extrinsic=*
34+
// --wasm-execution=compiled
35+
// --heap-pages=4096
36+
// --output=./polkadot/runtime/westend/src/weights/
37+
38+
#![cfg_attr(rustfmt, rustfmt_skip)]
39+
#![allow(unused_parens)]
40+
#![allow(unused_imports)]
41+
#![allow(missing_docs)]
42+
43+
use frame_support::{traits::Get, weights::Weight};
44+
use core::marker::PhantomData;
45+
46+
/// Weight functions for `pallet_meta_tx`.
47+
pub struct WeightInfo<T>(PhantomData<T>);
48+
impl<T: frame_system::Config> pallet_meta_tx::WeightInfo for WeightInfo<T> {
49+
fn bare_dispatch() -> Weight {
50+
// Proof Size summary in bytes:
51+
// Measured: `0`
52+
// Estimated: `0`
53+
// Minimum execution time: 138_000_000 picoseconds.
54+
Weight::from_parts(140_000_000, 0)
55+
.saturating_add(Weight::from_parts(0, 0))
56+
}
57+
}

0 commit comments

Comments
 (0)