diff --git a/Cargo.lock b/Cargo.lock index 8268615b9b..afbc07323d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1434,9 +1434,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.19" +version = "4.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67816e006b17427c9b4386915109b494fec2d929c63e3bd3561234cbf1bf1e" +checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682" dependencies = [ "atty", "bitflags", @@ -1453,14 +1453,14 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfe581a2035db4174cdbdc91265e1aba50f381577f0510d0ad36c7bc59cc84a3" dependencies = [ - "clap 4.0.19", + "clap 4.0.22", ] [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -2259,7 +2259,7 @@ version = "0.1.0" dependencies = [ "anyhow", "base64 0.11.0", - "clap 4.0.19", + "clap 4.0.22", "frame-support", "hex", "parity-scale-codec", @@ -3077,7 +3077,7 @@ dependencies = [ "Inflector", "array-bytes", "chrono", - "clap 4.0.19", + "clap 4.0.22", "comfy-table", "frame-benchmarking", "frame-support", @@ -3739,7 +3739,7 @@ version = "0.1.0" dependencies = [ "anyhow", "chrono", - "clap 4.0.19", + "clap 4.0.22", "env_logger", "log", "parity-scale-codec", @@ -5836,7 +5836,7 @@ name = "node-inspect" version = "0.9.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "clap 4.0.19", + "clap 4.0.22", "parity-scale-codec", "sc-cli", "sc-client-api", @@ -7424,7 +7424,7 @@ version = "3.0.0" dependencies = [ "assert_cmd", "async-std", - "clap 4.0.19", + "clap 4.0.22", "clap_complete", "criterion 0.3.6", "frame-benchmarking-cli", @@ -7745,7 +7745,7 @@ dependencies = [ "anyhow", "async-trait", "base64 0.13.0", - "clap 4.0.19", + "clap 4.0.22", "env_logger", "frame-system", "futures", @@ -8848,7 +8848,7 @@ dependencies = [ "anyhow", "bytes 1.1.0", "chrono", - "clap 4.0.19", + "clap 4.0.22", "env_logger", "hex", "log", @@ -9451,7 +9451,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a dependencies = [ "array-bytes", "chrono", - "clap 4.0.19", + "clap 4.0.22", "fdlimit", "futures", "libp2p", @@ -10794,7 +10794,7 @@ dependencies = [ name = "sfq-test" version = "0.1.0" dependencies = [ - "clap 4.0.19", + "clap 4.0.22", "phala-scheduler", "rocket", ] @@ -12251,7 +12251,7 @@ name = "substrate-frame-cli" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "clap 4.0.19", + "clap 4.0.22", "frame-support", "frame-system", "sc-cli", @@ -13153,7 +13153,7 @@ name = "try-runtime-cli" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.31#7a4e5163091384c4c10b6d76f5cb80dac0834f38" dependencies = [ - "clap 4.0.19", + "clap 4.0.22", "frame-try-runtime", "log", "parity-scale-codec", diff --git a/crates/pink/src/runtime.rs b/crates/pink/src/runtime.rs index e96a9027c1..fd5f83bf23 100644 --- a/crates/pink/src/runtime.rs +++ b/crates/pink/src/runtime.rs @@ -139,11 +139,9 @@ impl Config for PinkRuntime { #[test] fn detect_parameter_changes() { - use sp_core::Get; insta::assert_debug_snapshot!(( ::BlockWeights::get(), ::Schedule::get(), - ::ContractAccessWeight::get(), ::DeletionQueueDepth::get(), ::DeletionWeightLimit::get(), ::MaxCodeLen::get(), diff --git a/crates/sidevm/host/src/main.rs b/crates/sidevm/host/src/main.rs index dc25babe4b..9f2318fb27 100644 --- a/crates/sidevm/host/src/main.rs +++ b/crates/sidevm/host/src/main.rs @@ -1,6 +1,6 @@ use sidevm_host_runtime::{CacheOps, DynCacheOps, OcallError}; -use clap::{AppSettings, Parser}; +use clap::Parser; use once_cell::sync::Lazy; use std::collections::HashMap; use std::sync::RwLock; @@ -9,7 +9,6 @@ mod web_api; #[derive(Parser)] #[clap(about = "Demo sidevm host app", version, author)] -#[clap(global_setting(AppSettings::DeriveDisplayOrder))] pub struct Args { /// The gas limit for each poll. #[arg(long, default_value_t = 50_000_000_000_u64)] diff --git a/scripts/debug-cli/src/main.rs b/scripts/debug-cli/src/main.rs index cf91685ea0..900904eb28 100644 --- a/scripts/debug-cli/src/main.rs +++ b/scripts/debug-cli/src/main.rs @@ -9,7 +9,7 @@ use std::fmt::Debug; // use phala_types; #[derive(Debug, Parser)] -#[clap(name = "Phala Debug Utility CLI", next_display_order = None)] +#[clap(name = "Phala Debug Utility CLI")] enum Cli { DecodeWorkerRegistrationInfo { #[arg(short)] diff --git a/standalone/headers-cache/src/main.rs b/standalone/headers-cache/src/main.rs index c227fb7d06..8ae53d365d 100644 --- a/standalone/headers-cache/src/main.rs +++ b/standalone/headers-cache/src/main.rs @@ -14,7 +14,7 @@ mod web_api; type BlockNumber = u32; #[derive(Parser)] -#[clap(about = "Cache server for relaychain headers", version, author, next_display_order = None)] +#[clap(about = "Cache server for relaychain headers", version, author)] pub struct Args { #[command(subcommand)] action: Action, diff --git a/standalone/node/tests/common.rs b/standalone/node/tests/common.rs index b313524a68..6f62cc70b9 100644 --- a/standalone/node/tests/common.rs +++ b/standalone/node/tests/common.rs @@ -24,8 +24,7 @@ use nix::{ sys::signal::{kill, Signal::SIGINT}, unistd::Pid, }; -use node_primitives::Block; -use remote_externalities::rpc_api::RpcService; +use node_primitives::{Hash, Header}; use std::{ io::{BufRead, BufReader, Read}, ops::{Deref, DerefMut}, diff --git a/standalone/pherry/src/lib.rs b/standalone/pherry/src/lib.rs index 6876e6a64a..94e0ccafcf 100644 --- a/standalone/pherry/src/lib.rs +++ b/standalone/pherry/src/lib.rs @@ -48,20 +48,19 @@ pub use phaxt::connect as subxt_connect; #[clap( about = "Sync messages between pruntime and the blockchain.", version, - author, - next_display_order = None + author )] pub struct Args { - #[clap( + #[arg( long, help = "Dev mode (equivalent to `--use-dev-key --mnemonic='//Alice'`)" )] dev: bool, - #[clap(short = 'n', long = "no-init", help = "Should init pRuntime?")] + #[arg(short = 'n', long = "no-init", help = "Should init pRuntime?")] no_init: bool, - #[clap( + #[arg( long = "no-sync", help = "Don't sync pRuntime. Quit right after initialization." )] @@ -76,41 +75,41 @@ pub struct Args { #[arg(long, help = "Skip binding the worker endpoint.")] no_bind: bool, - #[clap( + #[arg( long, help = "Inject dev key (0x1) to pRuntime. Cannot be used with remote attestation enabled." )] use_dev_key: bool, - #[clap( + #[arg( default_value = "", long = "inject-key", help = "Inject key to pRuntime." )] inject_key: String, - #[clap( + #[arg( default_value = "ws://localhost:9944", long, help = "Substrate rpc websocket endpoint" )] substrate_ws_endpoint: String, - #[clap( + #[arg( default_value = "ws://localhost:9977", long, help = "Parachain collator rpc websocket endpoint" )] collator_ws_endpoint: String, - #[clap( + #[arg( default_value = "http://localhost:8000", long, help = "pRuntime http endpoint" )] pruntime_endpoint: String, - #[clap( + #[arg( long, help = "pRuntime http endpoint to handover the key. The handover will only happen when the old pRuntime is synced." )] @@ -119,7 +118,7 @@ pub struct Args { #[arg(default_value = "", long, help = "notify endpoint")] notify_endpoint: String, - #[clap( + #[arg( default_value = "//Alice", short = 'm', long = "mnemonic", @@ -127,21 +126,21 @@ pub struct Args { )] mnemonic: String, - #[clap( + #[arg( default_value = "1000", long = "fetch-blocks", help = "The batch size to fetch blocks from Substrate." )] fetch_blocks: u32, - #[clap( + #[arg( default_value = "4", long = "sync-blocks", help = "The batch size to sync blocks to pRuntime." )] sync_blocks: BlockNumber, - #[clap( + #[arg( long = "operator", help = "The operator account to set the miner for the worker." )] @@ -150,7 +149,7 @@ pub struct Args { #[arg(long = "parachain", help = "Parachain mode")] parachain: bool, - #[clap( + #[arg( long, help = "The first parent header to be synced, default to auto-determine" )] @@ -159,27 +158,28 @@ pub struct Args { #[arg(long, help = "Don't wait the substrate nodes to sync blocks")] no_wait: bool, - #[clap( + #[arg( default_value = "5000", long, help = "(Debug only) Set the wait block duration in ms" )] dev_wait_block_ms: u64, - #[clap( + #[arg( default_value = "0", long, help = "The charge transaction payment, unit: balance" )] tip: u128, - #[clap( + + #[arg( default_value = "4", long, help = "The transaction longevity, should be a power of two between 4 and 65536. unit: block" )] longevity: u64, - #[clap( + #[arg( default_value = "200", long, help = "Max number of messages to be submitted per-round" @@ -189,7 +189,7 @@ pub struct Args { #[arg(long, help = "Auto restart self after an error occurred")] auto_restart: bool, - #[clap( + #[arg( default_value = "10", long, help = "Max auto restart retries if it continiously failing. Only used with --auto-restart" @@ -208,14 +208,14 @@ pub struct Args { #[arg(default_value_t = BlockNumber::MAX)] to_block: BlockNumber, - #[clap( + #[arg( long, help = "Disable syncing waiting parachain blocks in the beginning of each round" )] disable_sync_waiting_paraheaders: bool, /// Attestation provider - #[clap(long, short = 'r', value_enum, default_value_t = RaOption::Ias)] + #[arg(long, short = 'r', value_enum, default_value_t = RaOption::Ias)] attestation_provider: RaOption, } diff --git a/standalone/pruntime/Cargo.lock b/standalone/pruntime/Cargo.lock index b0656f92de..ca3f8db331 100644 --- a/standalone/pruntime/Cargo.lock +++ b/standalone/pruntime/Cargo.lock @@ -757,9 +757,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.19" +version = "4.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67816e006b17427c9b4386915109b494fec2d929c63e3bd3561234cbf1bf1e" +checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682" dependencies = [ "atty", "bitflags", @@ -772,9 +772,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck 0.4.0", "proc-macro-error", diff --git a/standalone/pruntime/src/main.rs b/standalone/pruntime/src/main.rs index 31b0d6a725..ed25628be0 100644 --- a/standalone/pruntime/src/main.rs +++ b/standalone/pruntime/src/main.rs @@ -14,7 +14,7 @@ use phactory_api::ecall_args::{git_revision, InitArgs}; mod logger; #[derive(Parser, Debug, Clone)] -#[clap(about = "The Phala TEE worker app.", version, author, next_display_order = None)] +#[clap(about = "The Phala TEE worker app.", version, author)] struct Args { /// Number of CPU cores to be used for mining. #[arg(short, long)] diff --git a/standalone/replay/src/main.rs b/standalone/replay/src/main.rs index 226fdb2322..65d9031fb8 100644 --- a/standalone/replay/src/main.rs +++ b/standalone/replay/src/main.rs @@ -3,51 +3,51 @@ mod replay_gk; use clap::Parser; #[derive(Parser, Debug)] -#[clap(about = "The Phala TEE worker app.", version, author, next_display_order = None)] +#[clap(about = "The Phala TEE worker app.", version, author)] pub struct Args { - #[clap( + #[arg( default_value = "ws://localhost:9944", long, help = "Substrate rpc websocket endpoint." )] node_uri: String, - #[clap( + #[arg( default_value = "413895", long, help = "The block number to start to replay at." )] start_at: u32, - #[clap( + #[arg( default_value = "127.0.0.1:8080", long, help = "Bind address for local HTTP server." )] bind_addr: String, - #[clap( + #[arg( default_value = "", long, help = "The PostgresQL database to store the events." )] persist_events_to: String, - #[clap( + #[arg( default_value = "0", long, help = "Assume the give number of block finalized." )] assume_finalized: u32, - #[clap( + #[arg( default_value = "100000", long, help = "The number of blocks between two checkpoints. 0 for disabled" )] checkpoint_interval: u32, - #[clap( + #[arg( long, help = "The checkpoint file to restore from. Default is to use the latest checkpoint." )] diff --git a/standalone/runtime/src/impls.rs b/standalone/runtime/src/impls.rs index 8347593687..803d722596 100644 --- a/standalone/runtime/src/impls.rs +++ b/standalone/runtime/src/impls.rs @@ -49,7 +49,10 @@ mod multiplier_tests { AdjustmentVariable, MaximumMultiplier, MinimumMultiplier, Runtime, RuntimeBlockWeights as BlockWeights, System, TargetBlockFullness, TransactionPayment, }; - use frame_support::weights::{DispatchClass, Weight, WeightToFee}; + use frame_support::{ + dispatch::DispatchClass, + weights::{Weight, WeightToFee}, + }; fn max_normal() -> Weight { BlockWeights::get() diff --git a/standalone/sfq-test/src/main.rs b/standalone/sfq-test/src/main.rs index c82f60839e..c5d38e617b 100644 --- a/standalone/sfq-test/src/main.rs +++ b/standalone/sfq-test/src/main.rs @@ -11,9 +11,9 @@ use rocket::{get, launch, routes, State}; #[derive(Parser, Debug)] #[clap(about = "SFQ test server", version, author)] pub struct Args { - #[clap(short, long, default_value = "32")] + #[arg(short, long, default_value = "32")] backlog: usize, - #[clap(short, long, default_value = "3")] + #[arg(short, long, default_value = "3")] depth: u32, }