forked from ghostchain/ghost-node
		
	ghost sudo added as a dependency to casper runtime
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
		
							parent
							
								
									4f23c39994
								
							
						
					
					
						commit
						384380ad55
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
[package]
 | 
					[package]
 | 
				
			||||||
name = "casper-runtime"
 | 
					name = "casper-runtime"
 | 
				
			||||||
version = "3.5.25"
 | 
					version = "3.5.26"
 | 
				
			||||||
build = "build.rs"
 | 
					build = "build.rs"
 | 
				
			||||||
description = "Runtime of the Casper Network"
 | 
					description = "Runtime of the Casper Network"
 | 
				
			||||||
edition.workspace = true
 | 
					edition.workspace = true
 | 
				
			||||||
@ -87,6 +87,7 @@ pallet-whitelist = { workspace = true }
 | 
				
			|||||||
ghost-networks = { workspace = true }
 | 
					ghost-networks = { workspace = true }
 | 
				
			||||||
ghost-claims = { workspace = true }
 | 
					ghost-claims = { workspace = true }
 | 
				
			||||||
ghost-slow-clap = { workspace = true }
 | 
					ghost-slow-clap = { workspace = true }
 | 
				
			||||||
 | 
					ghost-sudo = { workspace = true }
 | 
				
			||||||
casper-runtime-constants = { workspace = true }
 | 
					casper-runtime-constants = { workspace = true }
 | 
				
			||||||
runtime-common = { workspace = true }
 | 
					runtime-common = { workspace = true }
 | 
				
			||||||
primitives = { workspace = true }
 | 
					primitives = { workspace = true }
 | 
				
			||||||
@ -205,6 +206,7 @@ std = [
 | 
				
			|||||||
    "ghost-networks/std",
 | 
					    "ghost-networks/std",
 | 
				
			||||||
    "ghost-claims/std",
 | 
					    "ghost-claims/std",
 | 
				
			||||||
    "ghost-slow-clap/std",
 | 
					    "ghost-slow-clap/std",
 | 
				
			||||||
 | 
					    "ghost-sudo/std",
 | 
				
			||||||
    "casper-runtime-constants/std",
 | 
					    "casper-runtime-constants/std",
 | 
				
			||||||
    "runtime-common/std",
 | 
					    "runtime-common/std",
 | 
				
			||||||
    "primitives/std",
 | 
					    "primitives/std",
 | 
				
			||||||
@ -252,6 +254,7 @@ runtime-benchmarks = [
 | 
				
			|||||||
    "ghost-networks/runtime-benchmarks",
 | 
					    "ghost-networks/runtime-benchmarks",
 | 
				
			||||||
    "ghost-claims/runtime-benchmarks",
 | 
					    "ghost-claims/runtime-benchmarks",
 | 
				
			||||||
    "ghost-slow-clap/runtime-benchmarks",
 | 
					    "ghost-slow-clap/runtime-benchmarks",
 | 
				
			||||||
 | 
					    "ghost-sudo/runtime-benchmarks",
 | 
				
			||||||
    "runtime-common/runtime-benchmarks",
 | 
					    "runtime-common/runtime-benchmarks",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
try-runtime = [
 | 
					try-runtime = [
 | 
				
			||||||
@ -297,5 +300,6 @@ try-runtime = [
 | 
				
			|||||||
    "ghost-networks/try-runtime",
 | 
					    "ghost-networks/try-runtime",
 | 
				
			||||||
    "ghost-claims/try-runtime",
 | 
					    "ghost-claims/try-runtime",
 | 
				
			||||||
    "ghost-slow-clap/try-runtime",
 | 
					    "ghost-slow-clap/try-runtime",
 | 
				
			||||||
 | 
					    "ghost-sudo/try-runtime",
 | 
				
			||||||
    "runtime-common/try-runtime",
 | 
					    "runtime-common/try-runtime",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
				
			|||||||
@ -28,3 +28,6 @@ std = [
 | 
				
			|||||||
	"sp-runtime/std",
 | 
						"sp-runtime/std",
 | 
				
			||||||
	"sp-weights/std",
 | 
						"sp-weights/std",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Set timing constants (e.g session period) to faster versions to speed up testing.
 | 
				
			||||||
 | 
					fast-runtime = []
 | 
				
			||||||
 | 
				
			|||||||
@ -1105,6 +1105,12 @@ impl ghost_slow_clap::Config for Runtime {
 | 
				
			|||||||
    type WeightInfo = weights::ghost_slow_clap::WeightInfo<Runtime>;
 | 
					    type WeightInfo = weights::ghost_slow_clap::WeightInfo<Runtime>;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					impl ghost_sudo::Config for Runtime {
 | 
				
			||||||
 | 
					    type RuntimeEvent = RuntimeEvent;
 | 
				
			||||||
 | 
					    type RuntimeCall = RuntimeCall;
 | 
				
			||||||
 | 
					    type WeightInfo = weights::ghost_sudo::WeightInfo<Runtime>;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
construct_runtime! {
 | 
					construct_runtime! {
 | 
				
			||||||
    pub enum Runtime 
 | 
					    pub enum Runtime 
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -1132,6 +1138,7 @@ construct_runtime! {
 | 
				
			|||||||
        Session: pallet_session = 9,
 | 
					        Session: pallet_session = 9,
 | 
				
			||||||
        Grandpa: pallet_grandpa = 11,
 | 
					        Grandpa: pallet_grandpa = 11,
 | 
				
			||||||
        AuthorityDiscovery: pallet_authority_discovery = 12,
 | 
					        AuthorityDiscovery: pallet_authority_discovery = 12,
 | 
				
			||||||
 | 
					        GhostSudo: ghost_sudo = 13,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Governance stuff.
 | 
					        // Governance stuff.
 | 
				
			||||||
        Treasury: pallet_treasury = 19,
 | 
					        Treasury: pallet_treasury = 19,
 | 
				
			||||||
@ -1260,6 +1267,7 @@ mod benches {
 | 
				
			|||||||
        [ghost_networks, GhostNetworks]
 | 
					        [ghost_networks, GhostNetworks]
 | 
				
			||||||
        [ghost_claims, GhostClaims]
 | 
					        [ghost_claims, GhostClaims]
 | 
				
			||||||
        [ghost_slow_clap, GhostSlowClaps]
 | 
					        [ghost_slow_clap, GhostSlowClaps]
 | 
				
			||||||
 | 
					        [ghost_sudo, GhostSudo]
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1566,6 +1574,7 @@ sp_api::impl_runtime_apis! {
 | 
				
			|||||||
            (list, storage_info)
 | 
					            (list, storage_info)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #[allow(non_local_definitions)]
 | 
				
			||||||
        fn dispatch_benchmark(
 | 
					        fn dispatch_benchmark(
 | 
				
			||||||
            config: frame_benchmarking::BenchmarkConfig,
 | 
					            config: frame_benchmarking::BenchmarkConfig,
 | 
				
			||||||
        ) -> Result<
 | 
					        ) -> Result<
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										97
									
								
								runtime/casper/src/weights/ghost_sudo.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								runtime/casper/src/weights/ghost_sudo.rs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,97 @@
 | 
				
			|||||||
 | 
					// This file is part of Substrate.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Copyright (C) Parity Technologies (UK) Ltd.
 | 
				
			||||||
 | 
					// SPDX-License-Identifier: Apache-2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					// you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					// You may obtain a copy of the License at
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// 	http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					// distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					// See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					// limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//! Autogenerated weights for `pallet_sudo`
 | 
				
			||||||
 | 
					//!
 | 
				
			||||||
 | 
					//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
 | 
				
			||||||
 | 
					//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
 | 
				
			||||||
 | 
					//! WORST CASE MAP SIZE: `1000000`
 | 
				
			||||||
 | 
					//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
 | 
				
			||||||
 | 
					//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Executed Command:
 | 
				
			||||||
 | 
					// ./target/production/substrate-node
 | 
				
			||||||
 | 
					// benchmark
 | 
				
			||||||
 | 
					// pallet
 | 
				
			||||||
 | 
					// --chain=dev
 | 
				
			||||||
 | 
					// --steps=50
 | 
				
			||||||
 | 
					// --repeat=20
 | 
				
			||||||
 | 
					// --pallet=pallet_sudo
 | 
				
			||||||
 | 
					// --no-storage-info
 | 
				
			||||||
 | 
					// --no-median-slopes
 | 
				
			||||||
 | 
					// --no-min-squares
 | 
				
			||||||
 | 
					// --extrinsic=*
 | 
				
			||||||
 | 
					// --wasm-execution=compiled
 | 
				
			||||||
 | 
					// --heap-pages=4096
 | 
				
			||||||
 | 
					// --output=./substrate/frame/sudo/src/weights.rs
 | 
				
			||||||
 | 
					// --header=./substrate/HEADER-APACHE2
 | 
				
			||||||
 | 
					// --template=./substrate/.maintain/frame-weight-template.hbs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#![cfg_attr(rustfmt, rustfmt_skip)]
 | 
				
			||||||
 | 
					#![allow(unused_parens)]
 | 
				
			||||||
 | 
					#![allow(unused_imports)]
 | 
				
			||||||
 | 
					#![allow(missing_docs)]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 | 
				
			||||||
 | 
					use core::marker::PhantomData;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Weights for `pallet_sudo` using the Substrate node and recommended hardware.
 | 
				
			||||||
 | 
					pub struct WeightInfo<T>(PhantomData<T>);
 | 
				
			||||||
 | 
					impl<T: frame_system::Config> ghost_sudo::WeightInfo for WeightInfo<T> {
 | 
				
			||||||
 | 
						/// Storage: `Sudo::Key` (r:1 w:1)
 | 
				
			||||||
 | 
						/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
 | 
				
			||||||
 | 
						fn set_key() -> Weight {
 | 
				
			||||||
 | 
							// Proof Size summary in bytes:
 | 
				
			||||||
 | 
							//  Measured:  `165`
 | 
				
			||||||
 | 
							//  Estimated: `1517`
 | 
				
			||||||
 | 
							// Minimum execution time: 9_486_000 picoseconds.
 | 
				
			||||||
 | 
							Weight::from_parts(9_663_000, 1517)
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().reads(1_u64))
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().writes(1_u64))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						/// Storage: `Sudo::Key` (r:1 w:0)
 | 
				
			||||||
 | 
						/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
 | 
				
			||||||
 | 
						fn sudo() -> Weight {
 | 
				
			||||||
 | 
							// Proof Size summary in bytes:
 | 
				
			||||||
 | 
							//  Measured:  `165`
 | 
				
			||||||
 | 
							//  Estimated: `1517`
 | 
				
			||||||
 | 
							// Minimum execution time: 10_501_000 picoseconds.
 | 
				
			||||||
 | 
							Weight::from_parts(10_729_000, 1517)
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().reads(1_u64))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						/// Storage: `Sudo::Key` (r:1 w:0)
 | 
				
			||||||
 | 
						/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
 | 
				
			||||||
 | 
						fn sudo_as() -> Weight {
 | 
				
			||||||
 | 
							// Proof Size summary in bytes:
 | 
				
			||||||
 | 
							//  Measured:  `165`
 | 
				
			||||||
 | 
							//  Estimated: `1517`
 | 
				
			||||||
 | 
							// Minimum execution time: 10_742_000 picoseconds.
 | 
				
			||||||
 | 
							Weight::from_parts(11_003_000, 1517)
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().reads(1_u64))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						/// Storage: `Sudo::Key` (r:1 w:1)
 | 
				
			||||||
 | 
						/// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
 | 
				
			||||||
 | 
						fn remove_key() -> Weight {
 | 
				
			||||||
 | 
							// Proof Size summary in bytes:
 | 
				
			||||||
 | 
							//  Measured:  `165`
 | 
				
			||||||
 | 
							//  Estimated: `1517`
 | 
				
			||||||
 | 
							// Minimum execution time: 8_837_000 picoseconds.
 | 
				
			||||||
 | 
							Weight::from_parts(9_127_000, 1517)
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().reads(1_u64))
 | 
				
			||||||
 | 
								.saturating_add(T::DbWeight::get().writes(1_u64))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -3,6 +3,7 @@ pub mod frame_system;
 | 
				
			|||||||
pub mod ghost_claims;
 | 
					pub mod ghost_claims;
 | 
				
			||||||
pub mod ghost_networks;
 | 
					pub mod ghost_networks;
 | 
				
			||||||
pub mod ghost_slow_clap;
 | 
					pub mod ghost_slow_clap;
 | 
				
			||||||
 | 
					pub mod ghost_sudo;
 | 
				
			||||||
pub mod pallet_alliance;
 | 
					pub mod pallet_alliance;
 | 
				
			||||||
pub mod pallet_bags_list;
 | 
					pub mod pallet_bags_list;
 | 
				
			||||||
pub mod pallet_balances;
 | 
					pub mod pallet_balances;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user