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

Benchmark pallet sudo #13880

Merged
merged 24 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
086d363
set_key
Doordashcon Apr 11, 2023
0319a2f
v2
Doordashcon Apr 18, 2023
6e16a8c
Merge branch 'master' into ddc-OG
Doordashcon Apr 18, 2023
6cccbfe
update runtime
Doordashcon Apr 18, 2023
7b5817b
Merge branch 'ddc-OG' of https://github.com/Doordashcon/substrate int…
Doordashcon Apr 18, 2023
fd71be3
cargo fmt
Doordashcon Apr 18, 2023
823d98b
remove commenting
Doordashcon Apr 18, 2023
e082fec
Merge branch 'master' of https://github.com/paritytech/substrate into…
Apr 19, 2023
5078939
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_sudo
Apr 19, 2023
01a597a
impl weights
Doordashcon Apr 20, 2023
811d52d
Merge branch 'paritytech:master' into ddc-OG
Doordashcon Apr 23, 2023
fe6e0a4
Merge branch 'paritytech:master' into ddc-OG
Doordashcon Apr 24, 2023
1890456
sudo & sudo_as
Doordashcon May 1, 2023
885b7b0
Merge branch 'paritytech:master' into ddc-OG
Doordashcon May 3, 2023
28878cf
where
Doordashcon May 6, 2023
6d9d079
Merge branch 'paritytech:master' into ddc-OG
Doordashcon May 6, 2023
f931e7b
Merge branch 'paritytech:master' into ddc-OG
Doordashcon May 8, 2023
e38b8a9
Merge branch 'master' of https://github.com/paritytech/substrate into…
May 9, 2023
891a949
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_sudo
May 9, 2023
8ffafdf
update weights
Doordashcon May 9, 2023
ff180b3
cargo fmt
Doordashcon May 9, 2023
ff4405c
Merge branch 'paritytech:master' into ddc-OG
Doordashcon May 10, 2023
fc1d8af
Merge branch 'paritytech:master' into ddc-OG
Doordashcon May 10, 2023
6c3acef
Update Cargo.lock
ggwpez May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
impl weights
  • Loading branch information
Doordashcon committed Apr 20, 2023
commit 01a597a873beb5d70614f14b0ef79c82f52ab40e
1 change: 1 addition & 0 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ impl pallet_transaction_payment::Config for Runtime {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}

/// Configure the pallet-template in pallets/template.
Expand Down
1 change: 1 addition & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@ impl pallet_contracts::Config for Runtime {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
Expand Down
7 changes: 6 additions & 1 deletion frame/sudo/src/lib.rs
Doordashcon marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ mod tests;

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
pub mod weights;
pub use weights::*;
Doordashcon marked this conversation as resolved.
Show resolved Hide resolved
Doordashcon marked this conversation as resolved.
Show resolved Hide resolved

pub use extension::CheckOnlySudoAccount;
pub use pallet::*;
Expand All @@ -133,6 +135,9 @@ pub mod pallet {
type RuntimeCall: Parameter
+ UnfilteredDispatchable<RuntimeOrigin = Self::RuntimeOrigin>
+ GetDispatchInfo;

/// Type representing the weight of this pallet
type WeightInfo: WeightInfo;
}

#[pallet::pallet]
Expand Down Expand Up @@ -198,7 +203,7 @@ pub mod pallet {
/// ## Complexity
/// - O(1).
#[pallet::call_index(2)]
#[pallet::weight({0})] // FIXME
#[pallet::weight(T::WeightInfo::set_key())] // FIXME
Doordashcon marked this conversation as resolved.
Show resolved Hide resolved
pub fn set_key(
origin: OriginFor<T>,
new: AccountIdLookupOf<T>,
Expand Down
1 change: 1 addition & 0 deletions frame/sudo/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ impl logger::Config for Test {
impl Config for Test {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = ();
}

// New types for dispatchable functions.
Expand Down