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

Commit bc80afb

Browse files
authored
fix the new staking weight in substrate-node (#7131)
1 parent 0a90d5f commit bc80afb

File tree

3 files changed

+172
-1
lines changed

3 files changed

+172
-1
lines changed

bin/node/runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl pallet_staking::Trait for Runtime {
458458
type MinSolutionScoreBump = MinSolutionScoreBump;
459459
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
460460
type UnsignedPriority = StakingUnsignedPriority;
461-
type WeightInfo = ();
461+
type WeightInfo = weights::pallet_staking::WeightInfo;
462462
}
463463

464464
parameter_types! {

bin/node/runtime/src/weights/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ pub mod pallet_proxy;
2424
pub mod pallet_timestamp;
2525
pub mod pallet_utility;
2626
pub mod pallet_vesting;
27+
pub mod pallet_staking;
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
// This file is part of Substrate.
2+
3+
// Copyright (C) 2017-2020 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+
18+
//! Default weights of pallet-staking.
19+
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
20+
21+
#![allow(unused_parens)]
22+
#![allow(unused_imports)]
23+
24+
use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
25+
26+
pub struct WeightInfo;
27+
impl pallet_staking::WeightInfo for WeightInfo {
28+
fn bond() -> Weight {
29+
(144278000 as Weight)
30+
.saturating_add(DbWeight::get().reads(5 as Weight))
31+
.saturating_add(DbWeight::get().writes(4 as Weight))
32+
}
33+
fn bond_extra() -> Weight {
34+
(110715000 as Weight)
35+
.saturating_add(DbWeight::get().reads(4 as Weight))
36+
.saturating_add(DbWeight::get().writes(2 as Weight))
37+
}
38+
fn unbond() -> Weight {
39+
(99840000 as Weight)
40+
.saturating_add(DbWeight::get().reads(5 as Weight))
41+
.saturating_add(DbWeight::get().writes(3 as Weight))
42+
}
43+
fn withdraw_unbonded_update(s: u32, ) -> Weight {
44+
(100728000 as Weight)
45+
.saturating_add((63000 as Weight).saturating_mul(s as Weight))
46+
.saturating_add(DbWeight::get().reads(5 as Weight))
47+
.saturating_add(DbWeight::get().writes(3 as Weight))
48+
}
49+
fn withdraw_unbonded_kill(s: u32, ) -> Weight {
50+
(168879000 as Weight)
51+
.saturating_add((6666000 as Weight).saturating_mul(s as Weight))
52+
.saturating_add(DbWeight::get().reads(7 as Weight))
53+
.saturating_add(DbWeight::get().writes(8 as Weight))
54+
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
55+
}
56+
fn validate() -> Weight {
57+
(35539000 as Weight)
58+
.saturating_add(DbWeight::get().reads(2 as Weight))
59+
.saturating_add(DbWeight::get().writes(2 as Weight))
60+
}
61+
fn nominate(n: u32, ) -> Weight {
62+
(48596000 as Weight)
63+
.saturating_add((308000 as Weight).saturating_mul(n as Weight))
64+
.saturating_add(DbWeight::get().reads(3 as Weight))
65+
.saturating_add(DbWeight::get().writes(2 as Weight))
66+
}
67+
fn chill() -> Weight {
68+
(35144000 as Weight)
69+
.saturating_add(DbWeight::get().reads(2 as Weight))
70+
.saturating_add(DbWeight::get().writes(2 as Weight))
71+
}
72+
fn set_payee() -> Weight {
73+
(24255000 as Weight)
74+
.saturating_add(DbWeight::get().reads(1 as Weight))
75+
.saturating_add(DbWeight::get().writes(1 as Weight))
76+
}
77+
fn set_controller() -> Weight {
78+
(52294000 as Weight)
79+
.saturating_add(DbWeight::get().reads(3 as Weight))
80+
.saturating_add(DbWeight::get().writes(3 as Weight))
81+
}
82+
fn set_validator_count() -> Weight {
83+
(5185000 as Weight)
84+
.saturating_add(DbWeight::get().writes(1 as Weight))
85+
}
86+
fn force_no_eras() -> Weight {
87+
(5907000 as Weight)
88+
.saturating_add(DbWeight::get().writes(1 as Weight))
89+
}
90+
fn force_new_era() -> Weight {
91+
(5917000 as Weight)
92+
.saturating_add(DbWeight::get().writes(1 as Weight))
93+
}
94+
fn force_new_era_always() -> Weight {
95+
(5952000 as Weight)
96+
.saturating_add(DbWeight::get().writes(1 as Weight))
97+
}
98+
fn set_invulnerables(v: u32, ) -> Weight {
99+
(6324000 as Weight)
100+
.saturating_add((9000 as Weight).saturating_mul(v as Weight))
101+
.saturating_add(DbWeight::get().writes(1 as Weight))
102+
}
103+
fn force_unstake(s: u32, ) -> Weight {
104+
(119691000 as Weight)
105+
.saturating_add((6681000 as Weight).saturating_mul(s as Weight))
106+
.saturating_add(DbWeight::get().reads(4 as Weight))
107+
.saturating_add(DbWeight::get().writes(8 as Weight))
108+
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
109+
}
110+
fn cancel_deferred_slash(s: u32, ) -> Weight {
111+
(5820201000 as Weight)
112+
.saturating_add((34672000 as Weight).saturating_mul(s as Weight))
113+
.saturating_add(DbWeight::get().reads(1 as Weight))
114+
.saturating_add(DbWeight::get().writes(1 as Weight))
115+
}
116+
fn payout_stakers_dead_controller(n: u32, ) -> Weight {
117+
(0 as Weight)
118+
.saturating_add((92486000 as Weight).saturating_mul(n as Weight))
119+
.saturating_add(DbWeight::get().reads(4 as Weight))
120+
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
121+
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
122+
}
123+
fn payout_stakers_alive_staked(n: u32, ) -> Weight {
124+
(0 as Weight)
125+
.saturating_add((117324000 as Weight).saturating_mul(n as Weight))
126+
.saturating_add(DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
127+
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
128+
}
129+
fn rebond(l: u32, ) -> Weight {
130+
(71316000 as Weight)
131+
.saturating_add((142000 as Weight).saturating_mul(l as Weight))
132+
.saturating_add(DbWeight::get().reads(4 as Weight))
133+
.saturating_add(DbWeight::get().writes(3 as Weight))
134+
}
135+
fn set_history_depth(e: u32, ) -> Weight {
136+
(0 as Weight)
137+
.saturating_add((51901000 as Weight).saturating_mul(e as Weight))
138+
.saturating_add(DbWeight::get().reads(2 as Weight))
139+
.saturating_add(DbWeight::get().writes(4 as Weight))
140+
.saturating_add(DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
141+
}
142+
fn reap_stash(s: u32, ) -> Weight {
143+
(147166000 as Weight)
144+
.saturating_add((6661000 as Weight).saturating_mul(s as Weight))
145+
.saturating_add(DbWeight::get().reads(4 as Weight))
146+
.saturating_add(DbWeight::get().writes(8 as Weight))
147+
.saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
148+
}
149+
fn new_era(v: u32, n: u32, ) -> Weight {
150+
(0 as Weight)
151+
.saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
152+
.saturating_add((182580000 as Weight).saturating_mul(n as Weight))
153+
.saturating_add(DbWeight::get().reads(10 as Weight))
154+
.saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
155+
.saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
156+
.saturating_add(DbWeight::get().writes(8 as Weight))
157+
.saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
158+
}
159+
fn submit_solution_better(v: u32, n: u32, a: u32, w: u32, ) -> Weight {
160+
(0 as Weight)
161+
.saturating_add((964000 as Weight).saturating_mul(v as Weight))
162+
.saturating_add((432000 as Weight).saturating_mul(n as Weight))
163+
.saturating_add((204294000 as Weight).saturating_mul(a as Weight))
164+
.saturating_add((9546000 as Weight).saturating_mul(w as Weight))
165+
.saturating_add(DbWeight::get().reads(6 as Weight))
166+
.saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
167+
.saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
168+
.saturating_add(DbWeight::get().writes(2 as Weight))
169+
}
170+
}

0 commit comments

Comments
 (0)