pub struct PalletCmd {
Show 32 fields pub pallet: Option<String>, pub extrinsic: Option<String>, pub steps: u32, pub lowest_range_values: Vec<u32>, pub highest_range_values: Vec<u32>, pub repeat: u32, pub external_repeat: u32, pub json_output: bool, pub json_file: Option<PathBuf>, pub no_median_slopes: bool, pub no_min_squares: bool, pub output: Option<PathBuf>, pub header: Option<PathBuf>, pub template: Option<PathBuf>, pub hostinfo_params: HostInfoParams, pub output_analysis: Option<String>, pub output_pov_analysis: Option<String>, pub default_pov_mode: PovEstimationMode, pub heap_pages: Option<u64>, pub no_verify: bool, pub extra: bool, pub shared_params: SharedParams, pub wasm_method: WasmExecutionMethod, pub wasmtime_instantiation_strategy: WasmtimeInstantiationStrategy, pub execution: Option<String>, pub database_cache_size: u32, pub list: bool, pub no_storage_info: bool, pub worst_case_map_values: u32, pub additional_trie_layers: u8, pub json_input: Option<PathBuf>, pub unsafe_overwrite_results: bool,
}
Expand description

Benchmark the extrinsic weight of FRAME Pallets.

Fields§

§pallet: Option<String>

Select a FRAME Pallet to benchmark, or * for all (in which case extrinsic must be *).

§extrinsic: Option<String>

Select an extrinsic inside the pallet to benchmark, or * for all.

§steps: u32

Select how many samples we should take across the variable components.

§lowest_range_values: Vec<u32>

Indicates lowest values for each of the component ranges.

§highest_range_values: Vec<u32>

Indicates highest values for each of the component ranges.

§repeat: u32

Select how many repetitions of this benchmark should run from within the wasm.

§external_repeat: u32

Select how many repetitions of this benchmark should run from the client.

NOTE: Using this alone may give slower results, but will afford you maximum Wasm memory.

§json_output: bool

Print the raw results in JSON format.

§json_file: Option<PathBuf>

Write the raw results in JSON format into the given file.

§no_median_slopes: bool

Don’t print the median-slopes linear regression analysis.

§no_min_squares: bool

Don’t print the min-squares linear regression analysis.

§output: Option<PathBuf>

Output the benchmarks to a Rust file at the given path.

§header: Option<PathBuf>

Add a header file to your outputted benchmarks.

§template: Option<PathBuf>

Path to Handlebars template file used for outputting benchmark results. (Optional)

§hostinfo_params: HostInfoParams§output_analysis: Option<String>

Which analysis function to use when outputting benchmarks:

  • min-squares (default)
  • median-slopes
  • max (max of min squares and median slopes for each value)
§output_pov_analysis: Option<String>

Which analysis function to use when analyzing measured proof sizes.

§default_pov_mode: PovEstimationMode

The PoV estimation mode of a benchmark if no pov_mode attribute is present.

§heap_pages: Option<u64>

Set the heap pages while running benchmarks. If not set, the default value from the client is used.

§no_verify: bool

Disable verification logic when running benchmarks.

§extra: bool

Display and run extra benchmarks that would otherwise not be needed for weight construction.

§shared_params: SharedParams§wasm_method: WasmExecutionMethod

Method for executing Wasm runtime code.

§wasmtime_instantiation_strategy: WasmtimeInstantiationStrategy

The WASM instantiation method to use.

Only has an effect when wasm-execution is set to compiled.

§execution: Option<String>

DEPRECATED: This argument has no effect.

§database_cache_size: u32

Limit the memory the database cache can use.

§list: bool

List the benchmarks that match your query rather than running them.

When nothing is provided, we list all benchmarks.

§no_storage_info: bool

If enabled, the storage info is not displayed in the output next to the analysis.

This is independent of the storage info appearing in the output file. Use a Handlebar template for that purpose.

§worst_case_map_values: u32

The assumed default maximum size of any StorageMap.

When the maximum size of a map is not defined by the runtime developer, this value is used as a worst case scenario. It will affect the calculated worst case PoV size for accessing a value in a map, since the PoV will need to include the trie nodes down to the underlying value.

§additional_trie_layers: u8

Adjust the PoV estimation by adding additional trie layers to it.

This should be set to log16(n) where n is the number of top-level storage items in the runtime, eg. StorageMaps and StorageValues. A value of 2 to 3 is usually sufficient. Each layer will result in an additional 495 bytes PoV per distinct top-level access. Therefore multiple StorageMap accesses only suffer from this increase once. The exact number of storage items depends on the runtime and the deployed pallets.

§json_input: Option<PathBuf>

A path to a .json file with existing benchmark results generated with --json or --json-file. When specified the benchmarks are not actually executed, and the data for the analysis is read from this file.

§unsafe_overwrite_results: bool

Allow overwriting a single file with multiple results.

This exists only to restore legacy behaviour. It should never actually be needed.

Implementations§

source§

impl PalletCmd

source

pub fn run<BB, ExtraHostFunctions>(&self, config: Configuration) -> Result<()>where BB: BlockT + Debug, <<<BB as BlockT>::Header as HeaderT>::Number as FromStr>::Err: Debug, ExtraHostFunctions: HostFunctions,

Runs the command and benchmarks the chain.

Trait Implementations§

source§

impl Args for PalletCmd

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl CliConfiguration<()> for PalletCmd

source§

fn shared_params(&self) -> &SharedParams

Get the SharedParams for this object
source§

fn chain_id(&self, _is_dev: bool) -> Result<String>

Get the chain ID (string). Read more
source§

fn import_params(&self) -> Option<&ImportParams>

Get the ImportParams for this object
source§

fn pruning_params(&self) -> Option<&PruningParams>

Get the PruningParams for this object
source§

fn keystore_params(&self) -> Option<&KeystoreParams>

Get the KeystoreParams for this object
source§

fn network_params(&self) -> Option<&NetworkParams>

Get the NetworkParams for this object
source§

fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>

Get a reference to OffchainWorkerParams for this object.
source§

fn node_key_params(&self) -> Option<&NodeKeyParams>

Get the NodeKeyParams for this object
source§

fn database_params(&self) -> Option<&DatabaseParams>

Get the DatabaseParams for this object
source§

fn base_path(&self) -> Result<Option<BasePath>, Error>

Get the base path of the configuration (if any) Read more
source§

fn is_dev(&self) -> Result<bool, Error>

Returns true if the node is for development or not Read more
source§

fn role(&self, _is_dev: bool) -> Result<Role, Error>

Gets the role Read more
source§

fn transaction_pool(&self, _is_dev: bool) -> Result<Options, Error>

Get the transaction pool options Read more
source§

fn network_config( &self, chain_spec: &Box<dyn ChainSpec + 'static, Global>, is_dev: bool, is_validator: bool, net_config_dir: PathBuf, client_id: &str, node_name: &str, node_key: NodeKeyConfig, default_listen_port: u16 ) -> Result<NetworkConfiguration, Error>

Get the network configuration Read more
source§

fn keystore_config(&self, config_dir: &PathBuf) -> Result<KeystoreConfig, Error>

Get the keystore configuration. Read more
source§

fn database_cache_size(&self) -> Result<Option<usize>, Error>

Get the database cache size. Read more
source§

fn database(&self) -> Result<Option<Database>, Error>

Get the database backend variant. Read more
source§

fn database_config( &self, base_path: &PathBuf, cache_size: usize, database: Database ) -> Result<DatabaseSource, Error>

Get the database configuration object for the parameters provided
source§

fn trie_cache_maximum_size(&self) -> Result<Option<usize>, Error>

Get the trie cache maximum size. Read more
source§

fn state_pruning(&self) -> Result<Option<PruningMode>, Error>

Get the state pruning mode. Read more
source§

fn blocks_pruning(&self) -> Result<BlocksPruning, Error>

Get the block pruning mode. Read more
source§

fn node_name(&self) -> Result<String, Error>

Get the name of the node. Read more
source§

fn wasm_method(&self) -> Result<WasmExecutionMethod, Error>

Get the WASM execution method. Read more
source§

fn wasm_runtime_overrides(&self) -> Option<PathBuf>

Get the path where WASM overrides live. Read more
source§

fn rpc_addr( &self, _default_listen_port: u16 ) -> Result<Option<SocketAddr>, Error>

Get the RPC address.
source§

fn rpc_methods(&self) -> Result<RpcMethods, Error>

Returns the RPC method set to expose. Read more
source§

fn rpc_max_connections(&self) -> Result<u32, Error>

Get the maximum number of RPC server connections.
source§

fn rpc_cors(&self, _is_dev: bool) -> Result<Option<Vec<String, Global>>, Error>

Get the RPC cors (None if disabled) Read more
source§

fn rpc_max_request_size(&self) -> Result<u32, Error>

Get maximum RPC request payload size.
source§

fn rpc_max_response_size(&self) -> Result<u32, Error>

Get maximum RPC response payload size.
source§

fn rpc_max_subscriptions_per_connection(&self) -> Result<u32, Error>

Get maximum number of subscriptions per connection.
source§

fn prometheus_config( &self, _default_listen_port: u16, _chain_spec: &Box<dyn ChainSpec + 'static, Global> ) -> Result<Option<PrometheusConfig>, Error>

Get the prometheus configuration (None if disabled) Read more
source§

fn telemetry_endpoints( &self, chain_spec: &Box<dyn ChainSpec + 'static, Global> ) -> Result<Option<TelemetryEndpoints>, Error>

Get the telemetry endpoints (if any) Read more
source§

fn default_heap_pages(&self) -> Result<Option<u64>, Error>

Get the default value for heap pages Read more
source§

fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig, Error>

Returns an offchain worker config wrapped in Ok(_) Read more
source§

fn force_authoring(&self) -> Result<bool, Error>

Returns Ok(true) if authoring should be forced Read more
source§

fn disable_grandpa(&self) -> Result<bool, Error>

Returns Ok(true) if grandpa should be disabled Read more
source§

fn dev_key_seed(&self, _is_dev: bool) -> Result<Option<String>, Error>

Get the development key seed from the current object Read more
source§

fn tracing_targets(&self) -> Result<Option<String>, Error>

Get the tracing targets from the current object (if any) Read more
source§

fn tracing_receiver(&self) -> Result<TracingReceiver, Error>

Get the TracingReceiver value from the current object Read more
source§

fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig, Error>

Get the node key from the current object Read more
source§

fn max_runtime_instances(&self) -> Result<Option<usize>, Error>

Get maximum runtime instances Read more
source§

fn runtime_cache_size(&self) -> Result<u8, Error>

Get maximum different runtimes in cache Read more
source§

fn announce_block(&self) -> Result<bool, Error>

Activate or not the automatic announcing of blocks after import Read more
source§

fn create_configuration<C>( &self, cli: &C, tokio_handle: Handle ) -> Result<Configuration, Error>where C: SubstrateCli,

Create a Configuration object from the current object
source§

fn log_filters(&self) -> Result<String, Error>

Get the filters for the logging. Read more
source§

fn detailed_log_output(&self) -> Result<bool, Error>

Should the detailed log output be enabled.
source§

fn enable_log_reloading(&self) -> Result<bool, Error>

Is log reloading enabled?
source§

fn disable_log_color(&self) -> Result<bool, Error>

Should the log color output be disabled?
source§

fn init<F>( &self, support_url: &String, impl_version: &String, logger_hook: F, config: &Configuration ) -> Result<(), Error>where F: FnOnce(&mut LoggerBuilder, &Configuration),

Initialize substrate. This must be done only once per process. Read more
source§

impl CommandFactory for PalletCmd

source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
source§

impl Debug for PalletCmd

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for PalletCmd

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for PalletCmd

§

fn parse() -> Self

Parse from std::env::args_os(), exit on error
§

fn try_parse() -> Result<Self, Error<RichFormatter>>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Selfwhere I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error<RichFormatter>>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error<RichFormatter>>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedConversion for T

source§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
source§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IsType<T> for T

source§

fn from_ref(t: &T) -> &T

Cast reference.
source§

fn into_ref(&self) -> &T

Cast reference.
source§

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
source§

fn into_mut(&mut self) -> &mut T

Cast mutable reference.
source§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeDebug for Twhere T: Debug,

source§

impl<T> MaybeRefUnwindSafe for Twhere T: RefUnwindSafe,

§

impl<T> MaybeSend for Twhere T: Send,