Skip to content

Commit c15fb37

Browse files
committed
unrevert some stuff that we need
1 parent e14b22b commit c15fb37

File tree

12 files changed

+202
-11
lines changed

12 files changed

+202
-11
lines changed

.github/workflows/runtimes-matrix.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"header": "substrate/HEADER-APACHE2",
77
"template": "substrate/.maintain/frame-weight-template.hbs",
88
"bench_features": "runtime-benchmarks",
9-
"bench_flags": "--genesis-builder-policy=none --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
9+
"bench_flags": "--exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
1010
"uri": null,
1111
"is_relay": false
1212
},

polkadot/runtime/common/src/try_runtime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ where
3636

3737
let all_stakers = Ledger::<T>::iter().map(|(ctrl, l)| (ctrl, l.stash)).collect::<BTreeSet<_>>();
3838
let mut all_exposed = BTreeSet::new();
39-
ErasStakers::<T>::iter().for_each(|(_, val, expo)| {
39+
ErasStakersPaged::<T>::iter().for_each(|((_era, val, _page), expo)| {
4040
all_exposed.insert(val);
4141
all_exposed.extend(expo.others.iter().map(|ie| ie.who.clone()))
4242
});

prdoc/pr_6034.prdoc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
title: Adds multi-block election types and refactors current single logic to support it
2+
3+
doc:
4+
- audience: Runtime Dev
5+
description: |
6+
This PR adds election types and structs required to run a multi-block election. In addition,
7+
it modifies EPM, staking pallet and all dependent pallets and logic to use the multi-block types.
8+
9+
crates:
10+
- name: frame-election-provider-support
11+
bump: major
12+
- name: pallet-election-provider-multi-phase
13+
bump: major
14+
- name: pallet-staking
15+
bump: major
16+
- name: pallet-fast-unstake
17+
bump: minor
18+
- name: pallet-delegated-staking
19+
bump: minor
20+
- name: sp-npos-elections
21+
bump: major
22+
- name: sp-staking
23+
bump: major
24+
- name: pallet-bags-list-remote-tests
25+
bump: minor

prdoc/pr_6689.prdoc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
title: '[pallet-revive] Update gas encoding'
22
doc:
33
- audience: Runtime Dev
4-
description: |-
4+
description: |
55
Update the current approach to attach the `ref_time`, `pov` and `deposit` parameters to an Ethereum transaction.
6-
Previously, these three parameters were passed along with the signed payload, and the fees resulting from gas × gas_price were checked to ensure they matched the actual fees paid by the user for the extrinsic
7-
6+
Previously, these three parameters were passed along with the signed payload, and the fees resulting from gas × gas_price were checked to ensure they matched the actual fees paid by the user for the extrinsic
87
This approach unfortunately can be attacked. A malicious actor could force such a transaction to fail by injecting low values for some of these extra parameters as they are not part of the signed payload.
9-
108
The new approach encodes these 3 extra parameters in the lower digits of the transaction gas, using the log2 of the actual values to encode each components on 2 digits
9+
1110
crates:
1211
- name: pallet-revive-eth-rpc
1312
bump: minor

prdoc/pr_7042.prdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
title: `networking::TransactionPool` should accept `Arc`
1+
title: networking::TransactionPool should accept Arc
22
doc:
33
- audience: Node Dev
44
description: The `sc_network_transactions::config::TransactionPool` trait now returns an `Arc` for transactions.
55
crates:
66
- name: sc-network-transactions
77
bump: minor
88
- name: sc-service
9-
bump: minor
9+
bump: minor

prdoc/pr_7282.prdoc

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
title: AHM Multi-block staking election pallet
2+
doc:
3+
- audience: Runtime Dev
4+
description: |
5+
## Multi Block Election Pallet
6+
7+
This PR adds the first iteration of the multi-block staking pallet.
8+
9+
From this point onwards, the staking and its election provider pallets are being customized to work in AssetHub. While usage in solo-chains is still possible, it is not longer the main focus of this pallet. For a safer usage, please fork and user an older version of this pallet.
10+
crates:
11+
- name: pallet-election-provider-multi-block
12+
bump: major
13+
- name: frame-election-provider-support
14+
bump: major
15+
- name: frame-election-provider-solution-type
16+
bump: major
17+
- name: sp-npos-elections
18+
bump: major
19+
- name: sp-staking
20+
bump: major
21+
- name: pallet-staking
22+
bump: major
23+
- name: pallet-election-provider-multi-phase
24+
bump: major
25+
- name: westend-runtime
26+
bump: major
27+
- name: pallet-delegated-staking
28+
bump: major
29+
- name: pallet-fast-unstake
30+
bump: major
31+
- name: pallet-session-benchmarking
32+
bump: major
33+
- name: sc-consensus-grandpa
34+
bump: major
35+
- name: pallet-babe
36+
bump: major
37+
- name: pallet-beefy
38+
bump: major
39+
- name: pallet-grandpa
40+
bump: major
41+
- name: pallet-nomination-pools
42+
bump: major
43+
- name: pallet-root-offences
44+
bump: major
45+
- name: pallet-nomination-pools-benchmarking
46+
bump: major
47+
- name: pallet-offences-benchmarking
48+
bump: major
49+
- name: cumulus-pov-validator
50+
bump: major
51+
- name: polkadot-sdk
52+
bump: major
53+
- name: asset-hub-rococo-runtime
54+
bump: major
55+
- name: pallet-bags-list
56+
bump: major
57+
- name: frame-benchmarking
58+
bump: major
59+
- name: frame-support-procedural
60+
bump: major
61+
- name: frame-support
62+
bump: major
63+
- name: frame-benchmarking-cli
64+
bump: major
65+
- name: polkadot-runtime-common
66+
bump: major
67+
- name: pallet-elections-phragmen
68+
bump: major
69+
- name: pallet-election-provider-support-benchmarking
70+
bump: major
71+
- name: pallet-session
72+
bump: major

prdoc/pr_7424.prdoc

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
2+
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
3+
4+
title: 'Bounded Slashing: Paginated Offence Processing & Slash Application'
5+
6+
doc:
7+
- audience: Runtime Dev
8+
description: |
9+
This PR refactors the slashing mechanism in `pallet-staking` to be bounded by introducing paged offence processing and paged slash application.
10+
11+
### Key Changes
12+
- Offences are queued instead of being processed immediately.
13+
- Slashes are computed in pages, stored as a `StorageDoubleMap` with `(Validator, SlashFraction, PageIndex)` to uniquely identify them.
14+
- Slashes are applied incrementally across multiple blocks instead of a single unbounded operation.
15+
- New storage items: `OffenceQueue`, `ProcessingOffence`, `OffenceQueueEras`.
16+
- Updated API for cancelling and applying slashes.
17+
- Preliminary benchmarks added; further optimizations planned.
18+
19+
This enables staking slashing to scale efficiently and removes a major blocker for staking migration to a parachain (AH).
20+
21+
crates:
22+
- name: pallet-babe
23+
bump: patch
24+
- name: pallet-staking
25+
bump: major
26+
- name: pallet-grandpa
27+
bump: patch
28+
- name: westend-runtime
29+
bump: minor
30+
- name: pallet-beefy
31+
bump: patch
32+
- name: pallet-offences-benchmarking
33+
bump: patch
34+
- name: pallet-session-benchmarking
35+
bump: patch
36+
- name: pallet-root-offences
37+
bump: patch

prdoc/pr_7582.prdoc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
title: Implementation of `ah-client` and `rc-client` staking pallets
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
This PR introduces the initial structure for `pallet-ah-client` and `pallet-rc-client`. These
6+
pallets will reside on the relay chain and AssetHub, respectively, and will manage the interaction
7+
between `pallet-session` on the relay chain and `pallet-staking` on AssetHub.
8+
Both pallets are experimental and not intended for production use.
9+
crates:
10+
- name: pallet-staking-ah-client
11+
bump: major
12+
- name: pallet-staking-rc-client
13+
bump: major
14+
- name: pallet-election-provider-multi-block
15+
bump: minor
16+
- name: pallet-staking
17+
bump: major

substrate/.maintain/frame-umbrella-weight-template.hbs

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// This file is part of Substrate.
2+
3+
// Copyright (C) Parity Technologies (UK) Ltd.
4+
// SPDX-License-Identifier: Apache-2.0
5+
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
118
{{header}}
219
//! Autogenerated weights for `{{pallet}}`
320
//!

substrate/.maintain/frame-weight-template.hbs

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// This file is part of Substrate.
2+
3+
// Copyright (C) Parity Technologies (UK) Ltd.
4+
// SPDX-License-Identifier: Apache-2.0
5+
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
118
{{header}}
219
//! Autogenerated weights for `{{pallet}}`
320
//!

substrate/frame/bags-list/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub use list::{notional_bag_for, Bag, List, ListError, Node};
148148
pub use pallet::*;
149149
pub use weights::WeightInfo;
150150

151-
pub(crate) const LOG_TARGET: &str = "runtime::bags_list";
151+
pub(crate) const LOG_TARGET: &str = "runtime::bags-list";
152152

153153
// syntactic sugar for logging.
154154
#[macro_export]

substrate/frame/bags-list/src/list/mod.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl<T: Config<I>, I: 'static> List<T, I> {
255255
/// Iterate over all nodes in all bags in the list.
256256
///
257257
/// Full iteration can be expensive; it's recommended to limit the number of items with
258-
/// `.take(n)`.
258+
/// `.take(n)`, or call `.next()` one by one.
259259
pub(crate) fn iter() -> impl Iterator<Item = Node<T, I>> {
260260
// We need a touch of special handling here: because we permit `T::BagThresholds` to
261261
// omit the final bound, we need to ensure that we explicitly include that threshold in the
@@ -302,6 +302,13 @@ impl<T: Config<I>, I: 'static> List<T, I> {
302302
.filter_map(Bag::get)
303303
.flat_map(|bag| bag.iter());
304304

305+
crate::log!(
306+
debug,
307+
"starting to iterate from {:?}, who's bag is {:?}, and there are {:?} leftover bags",
308+
&start,
309+
start_node_upper,
310+
idx
311+
);
305312
Ok(start_bag.chain(leftover_bags))
306313
}
307314

@@ -341,7 +348,7 @@ impl<T: Config<I>, I: 'static> List<T, I> {
341348
bag.put();
342349

343350
crate::log!(
344-
debug,
351+
trace,
345352
"inserted {:?} with score {:?} into bag {:?}, new count is {}",
346353
id,
347354
score,

0 commit comments

Comments
 (0)