From 723b6847a6fcde286f8db2fcd69f71b907e1de3e Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 17 Jul 2023 18:46:27 +0100 Subject: [PATCH 1/8] feat: add relayer key management support --- src/cli/simple/command/mod.rs | 68 +++++++++++++++++++++++++++++++++++ src/cli/simple/mod.rs | 50 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/src/cli/simple/command/mod.rs b/src/cli/simple/command/mod.rs index 918bedf..35023cf 100644 --- a/src/cli/simple/command/mod.rs +++ b/src/cli/simple/command/mod.rs @@ -8,6 +8,7 @@ use aurora_engine_types::parameters::engine::{ }; use aurora_engine_types::types::Address; use aurora_engine_types::{types::Wei, H256, U256}; +use near_crypto::{KeyType, PublicKey}; use near_primitives::views::{CallResult, FinalExecutionStatus}; use serde_json::Value; use std::fmt::{Display, Formatter}; @@ -459,6 +460,23 @@ pub fn key_pair(random: bool, seed: Option) -> anyhow::Result<()> { Ok(()) } +/// Return randomly generated content of the key file for `AccountId`. +pub fn gen_near_key(account_id: &str, key_type: KeyType) -> anyhow::Result<()> { + let secret_key = near_crypto::SecretKey::from_random(key_type); + let public_key = secret_key.public_key(); + + println!( + "{}", + serde_json::to_string_pretty(&serde_json::json!({ + "account_id": account_id, + "public_key": public_key, + "secret_key": secret_key + }))? + ); + + Ok(()) +} + /// Pause precompiles with mask. pub async fn pause_precompiles(client: Client, mask: u32) -> anyhow::Result<()> { let args = PausePrecompilesCallArgs { paused_mask: mask }.try_to_vec()?; @@ -490,6 +508,56 @@ pub async fn paused_precompiles(client: Client) -> anyhow::Result<()> { get_value::(client, "paused_precompiles", None).await } +/// Set relayer key manager. +pub async fn set_key_manager(client: Client, manager: Option) -> anyhow::Result<()> { + let message = manager.as_ref().map_or_else( + || "has been removed".to_string(), + |account_id| format!("{account_id} has been set"), + ); + // TODO: Use RelayerKeyManagerArgs from engine-types instead. + let args = serde_json::to_vec(&serde_json::json!({ "key_manager": manager }))?; + + contract_call!( + "set_key_manager", + "The key manager {message} successfully", + "Error while setting key manager" + ) + .proceed(client, args) + .await +} + +/// Add relayer public key. +pub async fn add_relayer_key( + client: Client, + public_key: PublicKey, + allowance: f64, +) -> anyhow::Result<()> { + // TODO: Use RelayerKeyArgs from engine-types instead. + let args = serde_json::to_vec(&serde_json::json!({ "public_key": public_key }))?; + + contract_call!( + "add_relayer_key", + "The public key: {public_key} has been added successfully", + "Error while adding public key" + ) + .proceed_with_deposit(client, args, allowance) + .await +} + +/// Remove relayer public key. +pub async fn remove_relayer_key(client: Client, public_key: PublicKey) -> anyhow::Result<()> { + // TODO: Use RelayerKeyArgs from engine-types instead. + let args = serde_json::to_vec(&serde_json::json!({ "public_key": public_key }))?; + + contract_call!( + "remove_relayer_key", + "The public key: {public_key} has been removed successfully", + "Error while removing public key" + ) + .proceed(client, args) + .await +} + async fn get_value( client: Client, method_name: &str, diff --git a/src/cli/simple/mod.rs b/src/cli/simple/mod.rs index 8e575ef..83a375b 100644 --- a/src/cli/simple/mod.rs +++ b/src/cli/simple/mod.rs @@ -1,5 +1,7 @@ +use aurora_engine_types::account_id::AccountId; use clap::{Parser, Subcommand}; use lazy_static::lazy_static; +use near_crypto::{KeyType, PublicKey}; use shadow_rs::shadow; use std::str::FromStr; @@ -190,6 +192,13 @@ pub enum Command { #[arg(long)] seed: Option, }, + /// Return randomly generated NEAR key for AccountId + GenerateNearKey { + /// AccountId + account_id: String, + /// Key type: ed25519 or secp256k1 + key_type: KeyType, + }, /// Return fixed gas cost GetFixedGasCost, /// Set fixed gas cost @@ -234,6 +243,26 @@ pub enum Command { #[arg(long)] entry: String, }, + /// Set relayer key manager + SetKeyManager { + /// AccountId of the key manager + #[arg(value_parser = parse_account_id)] + account_id: Option, + }, + /// Add relayer public key + AddRelayerKey { + /// Public key + #[arg(long)] + public_key: PublicKey, + /// Allowance + #[arg(long)] + allowance: f64, + }, + /// Remove relayer public key + RemoveRelayerKey { + /// Public key + public_key: PublicKey, + }, } #[derive(Clone)] @@ -355,6 +384,10 @@ pub async fn run(args: Cli) -> anyhow::Result<()> { } Command::EncodeAddress { account } => command::encode_address(&account), Command::KeyPair { random, seed } => command::key_pair(random, seed)?, + Command::GenerateNearKey { + account_id, + key_type, + } => command::gen_near_key(&account_id, key_type)?, // Silo Specific Methods Command::GetFixedGasCost => command::silo::get_fixed_gas_cost(client).await?, Command::SetFixedGasCost { cost } => { @@ -375,7 +408,24 @@ pub async fn run(args: Cli) -> anyhow::Result<()> { Command::RemoveEntryFromWhitelist { kind, entry } => { command::silo::remove_entry_from_whitelist(client, kind, entry).await?; } + Command::SetKeyManager { account_id } => { + // command::set_key_manager(client, account_id.map(|a| a.parse().unwrap())).await?; + command::set_key_manager(client, account_id).await?; + } + Command::AddRelayerKey { + public_key, + allowance, + } => { + command::add_relayer_key(client, public_key, allowance).await?; + } + Command::RemoveRelayerKey { public_key } => { + command::remove_relayer_key(client, public_key).await?; + } } Ok(()) } + +fn parse_account_id(arg: &str) -> anyhow::Result { + arg.parse().map_err(|e| anyhow::anyhow!("{e}")) +} From 3858860d24d9d6d1d960d7e8aac598ab00798a4c Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 17 Jul 2023 19:23:52 +0100 Subject: [PATCH 2/8] chore: increase timeout between stage and deploy upgrade --- scripts/simple.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simple.sh b/scripts/simple.sh index f95137b..6ec389e 100755 --- a/scripts/simple.sh +++ b/scripts/simple.sh @@ -145,7 +145,7 @@ sleep 1 # Upgrading Aurora EVM to 2.9.0. curl -sL $ENGINE_LAST_WASM_URL -o $ENGINE_WASM_PATH || error_exit aurora-cli --engine $ENGINE_ACCOUNT stage-upgrade $ENGINE_WASM_PATH || error_exit -sleep 2 +sleep 3 aurora-cli --engine $ENGINE_ACCOUNT deploy-upgrade || error_exit sleep 1 version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) From 748ac9309d21cb06e0c4c1a56fd8aabe61604bd3 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 17 Jul 2023 20:04:29 +0100 Subject: [PATCH 3/8] chore: use custom http client with timeout --- scripts/simple.sh | 2 +- src/client/near.rs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/simple.sh b/scripts/simple.sh index 6ec389e..f95137b 100755 --- a/scripts/simple.sh +++ b/scripts/simple.sh @@ -145,7 +145,7 @@ sleep 1 # Upgrading Aurora EVM to 2.9.0. curl -sL $ENGINE_LAST_WASM_URL -o $ENGINE_WASM_PATH || error_exit aurora-cli --engine $ENGINE_ACCOUNT stage-upgrade $ENGINE_WASM_PATH || error_exit -sleep 3 +sleep 2 aurora-cli --engine $ENGINE_ACCOUNT deploy-upgrade || error_exit sleep 1 version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) diff --git a/src/client/near.rs b/src/client/near.rs index fc726df..1b943c0 100644 --- a/src/client/near.rs +++ b/src/client/near.rs @@ -27,6 +27,7 @@ use crate::utils; // The maximum amount of prepaid NEAR gas required for paying for a transaction. const NEAR_GAS: u64 = 300_000_000_000_000; +const TIMEOUT: u64 = 20; pub struct NearClient { client: JsonRpcClient, @@ -36,7 +37,19 @@ pub struct NearClient { impl NearClient { pub fn new(url: U, engine_account_id: &str, signer_key_path: Option) -> Self { - let client = JsonRpcClient::connect(url); + let mut headers = reqwest::header::HeaderMap::with_capacity(2); + headers.insert( + reqwest::header::CONTENT_TYPE, + reqwest::header::HeaderValue::from_static("application/json"), + ); + let client = reqwest::Client::builder() + .timeout(std::time::Duration::from_secs(TIMEOUT)) + .default_headers(headers) + .build() + .map(JsonRpcClient::with) + .expect("couldn't create json rpc client"); + let client = client.connect(url); + Self { client, engine_account_id: engine_account_id.parse().unwrap(), From 48df6d5800d1c7dbf4faf7bffe0bb0fd05b1c34c Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 17 Jul 2023 21:32:54 +0100 Subject: [PATCH 4/8] chore: use connect timeout --- src/client/near.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/near.rs b/src/client/near.rs index 1b943c0..692cf14 100644 --- a/src/client/near.rs +++ b/src/client/near.rs @@ -44,6 +44,7 @@ impl NearClient { ); let client = reqwest::Client::builder() .timeout(std::time::Duration::from_secs(TIMEOUT)) + .connect_timeout(std::time::Duration::from_secs(TIMEOUT)) .default_headers(headers) .build() .map(JsonRpcClient::with) From ae1121523d2797b684346351501ac0b878d8b7e7 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 24 Jul 2023 15:58:14 +0100 Subject: [PATCH 5/8] chore: use arg types from aurora-engine-types --- Cargo.lock | 447 ++++++++++++++-------------------- src/cli/simple/command/mod.rs | 22 +- src/cli/simple/mod.rs | 3 +- 3 files changed, 191 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c46caa3..3c750f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,7 +129,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -139,14 +139,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arbitrary" @@ -188,18 +188,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "aurora-engine-modexp" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#6a368e254f5c45010cd21b4cea06f1f6913b8ef9" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" dependencies = [ "hex", "ibig", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "aurora-engine-precompiles" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#6a368e254f5c45010cd21b4cea06f1f6913b8ef9" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" dependencies = [ "aurora-engine-modexp", "aurora-engine-sdk", @@ -275,7 +275,7 @@ dependencies = [ [[package]] name = "aurora-engine-sdk" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#6a368e254f5c45010cd21b4cea06f1f6913b8ef9" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" dependencies = [ "aurora-engine-types", "base64 0.21.2", @@ -286,7 +286,7 @@ dependencies = [ [[package]] name = "aurora-engine-transactions" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#6a368e254f5c45010cd21b4cea06f1f6913b8ef9" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" dependencies = [ "aurora-engine-precompiles", "aurora-engine-sdk", @@ -298,10 +298,11 @@ dependencies = [ [[package]] name = "aurora-engine-types" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#6a368e254f5c45010cd21b4cea06f1f6913b8ef9" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" dependencies = [ "base64 0.21.2", "borsh 0.10.3", + "bs58 0.5.0", "hex", "primitive-types 0.12.1", "rlp", @@ -494,6 +495,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ + "sha2 0.10.7", "tinyvec", ] @@ -582,9 +584,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.10" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -593,9 +595,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.10" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", @@ -605,14 +607,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -677,9 +679,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ "darling_core", "darling_macro", @@ -754,27 +756,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -785,7 +787,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -851,9 +853,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" @@ -866,22 +868,22 @@ dependencies = [ [[package]] name = "enum-map" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988f0d17a0fa38291e5f41f71ea8d46a5d5497b9054d5a759fae2cbb819f2356" +checksum = "017b207acb4cc917f4c31758ed95c0bc63ddb0f358b22eb38f80a2b2a43f6b1f" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4da76b3b6116d758c7ba93f7ec6a35d2e2cf24feda76c6e38a375f4d5c59f2" +checksum = "8560b409800a72d2d7860f8e5f4e0b0bd22bea6a352ea2a9ce30ccdef7f16d2f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] @@ -892,9 +894,9 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -904,7 +906,7 @@ checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1039,12 +1041,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fixed-hash" @@ -1330,9 +1329,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -1556,26 +1555,6 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -1584,13 +1563,13 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "rustix 0.38.1", - "windows-sys 0.48.0", + "hermit-abi 0.3.2", + "rustix", + "windows-sys", ] [[package]] @@ -1610,9 +1589,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -1724,9 +1703,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +checksum = "24e6ab01971eb092ffe6a7d42f49f9ff42662f17604681e2843ad65077ba47dc" dependencies = [ "cc", "libc", @@ -1734,12 +1713,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.3" @@ -1768,7 +1741,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -1791,7 +1764,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1992,7 +1965,7 @@ dependencies = [ "smart-default", "strum", "thiserror", - "time 0.3.22", + "time 0.3.23", "tracing", ] @@ -2026,7 +1999,7 @@ checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" dependencies = [ "quote", "serde", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -2038,7 +2011,7 @@ dependencies = [ "fs2", "near-rpc-error-core", "serde", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -2073,9 +2046,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ "num-bigint 0.4.3", "num-complex", @@ -2164,9 +2137,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -2177,7 +2150,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", ] @@ -2225,7 +2198,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -2302,9 +2275,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" -version = "3.6.2" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7467bc45fea3d77e829a4df331b9e969e2ec6a4dcd4e126e660f8509b40a475" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec", "bitvec", @@ -2316,9 +2289,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.2" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9de611934c78014c455793552d0bf7d65a58211179c49996fde925aa667c38" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -2367,29 +2340,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e138fdd8263907a2b0e1b4e80b7e58c721126479b6e6eedfb1b402acea7b9bd" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fef411b303e3e12d534fb6e7852de82da56edd937d895125821fb7c09436c7" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -2478,9 +2451,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2561,9 +2534,9 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -2665,13 +2638,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.3", + "regex-syntax 0.7.4", ] [[package]] @@ -2683,6 +2657,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -2691,9 +2676,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" @@ -2780,48 +2765,34 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.21" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25693a73057a1b4cb56179dd3c7ea21a7c6c5ee7d85781f5749b46f34b79c" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc6396159432b5c8490d4e301d8c705f61860b8b6c863bf79942ce5401968f3" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno", "libc", - "linux-raw-sys 0.4.3", - "windows-sys 0.48.0", + "linux-raw-sys", + "windows-sys", ] [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "scale-info" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "bitvec", "cfg-if", @@ -2832,9 +2803,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -2844,18 +2815,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "secp256k1" @@ -2878,9 +2849,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2891,9 +2862,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -2901,35 +2872,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -2938,13 +2909,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "e168eaaf71e8f9bd6037feb05190485708e019f4fd87d161b3c0a0d37daf85e5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -2961,9 +2932,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02d8aa6e3c385bf084924f660ce2a3a6bd333ba55b35e8590b321f35d88513" +checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3" dependencies = [ "base64 0.21.2", "chrono", @@ -2972,26 +2943,26 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.22", + "time 0.3.23", ] [[package]] name = "serde_with_macros" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc7d5d3932fb12ce722ee5e64dd38c504efba37567f0c402f6ca728c3b8b070" +checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] name = "serde_yaml" -version = "0.9.22" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ "indexmap 2.0.0", "itoa", @@ -3043,7 +3014,7 @@ dependencies = [ "const_format", "git2", "is_debug", - "time 0.3.22", + "time 0.3.23", "tzdb", ] @@ -3082,9 +3053,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smart-default" @@ -3166,9 +3137,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -3183,36 +3154,35 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", "fastrand", "redox_syscall", - "rustix 0.37.21", - "windows-sys 0.48.0", + "rustix", + "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -3238,9 +3208,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", @@ -3258,9 +3228,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -3305,7 +3275,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3326,7 +3296,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -3395,9 +3365,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "toml_datetime", @@ -3499,7 +3469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.22", + "time 0.3.23", "tracing-subscriber", ] @@ -3511,7 +3481,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] @@ -3638,9 +3608,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -3665,9 +3635,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "url" @@ -3752,7 +3722,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -3786,7 +3756,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3849,21 +3819,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -3879,93 +3834,51 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" @@ -3974,9 +3887,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] @@ -4016,7 +3929,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.27", ] [[package]] diff --git a/src/cli/simple/command/mod.rs b/src/cli/simple/command/mod.rs index 35023cf..9986c61 100644 --- a/src/cli/simple/command/mod.rs +++ b/src/cli/simple/command/mod.rs @@ -3,12 +3,12 @@ use aurora_engine_types::account_id::AccountId; use aurora_engine_types::borsh::{self, BorshDeserialize, BorshSerialize}; use aurora_engine_types::parameters::connector::InitCallArgs; use aurora_engine_types::parameters::engine::{ - GetStorageAtArgs, NewCallArgs, NewCallArgsV2, PausePrecompilesCallArgs, SetOwnerArgs, - SubmitResult, TransactionStatus, + GetStorageAtArgs, NewCallArgs, NewCallArgsV2, PausePrecompilesCallArgs, RelayerKeyArgs, + RelayerKeyManagerArgs, SetOwnerArgs, SubmitResult, TransactionStatus, }; +use aurora_engine_types::public_key::{KeyType, PublicKey}; use aurora_engine_types::types::Address; use aurora_engine_types::{types::Wei, H256, U256}; -use near_crypto::{KeyType, PublicKey}; use near_primitives::views::{CallResult, FinalExecutionStatus}; use serde_json::Value; use std::fmt::{Display, Formatter}; @@ -462,7 +462,8 @@ pub fn key_pair(random: bool, seed: Option) -> anyhow::Result<()> { /// Return randomly generated content of the key file for `AccountId`. pub fn gen_near_key(account_id: &str, key_type: KeyType) -> anyhow::Result<()> { - let secret_key = near_crypto::SecretKey::from_random(key_type); + let near_key_type = near_crypto::KeyType::try_from(u8::from(key_type))?; + let secret_key = near_crypto::SecretKey::from_random(near_key_type); let public_key = secret_key.public_key(); println!( @@ -509,13 +510,12 @@ pub async fn paused_precompiles(client: Client) -> anyhow::Result<()> { } /// Set relayer key manager. -pub async fn set_key_manager(client: Client, manager: Option) -> anyhow::Result<()> { - let message = manager.as_ref().map_or_else( +pub async fn set_key_manager(client: Client, key_manager: Option) -> anyhow::Result<()> { + let message = key_manager.as_ref().map_or_else( || "has been removed".to_string(), |account_id| format!("{account_id} has been set"), ); - // TODO: Use RelayerKeyManagerArgs from engine-types instead. - let args = serde_json::to_vec(&serde_json::json!({ "key_manager": manager }))?; + let args = serde_json::to_vec(&RelayerKeyManagerArgs { key_manager })?; contract_call!( "set_key_manager", @@ -532,8 +532,7 @@ pub async fn add_relayer_key( public_key: PublicKey, allowance: f64, ) -> anyhow::Result<()> { - // TODO: Use RelayerKeyArgs from engine-types instead. - let args = serde_json::to_vec(&serde_json::json!({ "public_key": public_key }))?; + let args = serde_json::to_vec(&RelayerKeyArgs { public_key })?; contract_call!( "add_relayer_key", @@ -546,8 +545,7 @@ pub async fn add_relayer_key( /// Remove relayer public key. pub async fn remove_relayer_key(client: Client, public_key: PublicKey) -> anyhow::Result<()> { - // TODO: Use RelayerKeyArgs from engine-types instead. - let args = serde_json::to_vec(&serde_json::json!({ "public_key": public_key }))?; + let args = serde_json::to_vec(&RelayerKeyArgs { public_key })?; contract_call!( "remove_relayer_key", diff --git a/src/cli/simple/mod.rs b/src/cli/simple/mod.rs index 83a375b..d8362a5 100644 --- a/src/cli/simple/mod.rs +++ b/src/cli/simple/mod.rs @@ -1,7 +1,7 @@ use aurora_engine_types::account_id::AccountId; +use aurora_engine_types::public_key::{KeyType, PublicKey}; use clap::{Parser, Subcommand}; use lazy_static::lazy_static; -use near_crypto::{KeyType, PublicKey}; use shadow_rs::shadow; use std::str::FromStr; @@ -409,7 +409,6 @@ pub async fn run(args: Cli) -> anyhow::Result<()> { command::silo::remove_entry_from_whitelist(client, kind, entry).await?; } Command::SetKeyManager { account_id } => { - // command::set_key_manager(client, account_id.map(|a| a.parse().unwrap())).await?; command::set_key_manager(client, account_id).await?; } Command::AddRelayerKey { From d4c11abeac84b088eacd04a0af568cae91bb94a5 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 26 Jul 2023 18:04:03 +0100 Subject: [PATCH 6/8] chore: add new functions to the test script --- scripts/simple.sh | 61 +++++++++++++++++++++++++++++++++------------- src/client/near.rs | 1 - 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/scripts/simple.sh b/scripts/simple.sh index f95137b..2bf7da1 100755 --- a/scripts/simple.sh +++ b/scripts/simple.sh @@ -2,8 +2,8 @@ export NEARCORE_HOME="/tmp/localnet" -AURORA_PREV_VERSION="2.9.1" -AURORA_LAST_VERSION="2.9.2" +AURORA_PREV_VERSION="2.9.3" +AURORA_LAST_VERSION="2.10.0" EVM_CODE=$(cat docs/res/HelloWorld.hex) ABI_PATH="docs/res/HelloWorld.abi" ENGINE_PREV_WASM_URL="https://github.com/aurora-is-near/aurora-engine/releases/download/$AURORA_PREV_VERSION/aurora-mainnet.wasm" @@ -14,8 +14,11 @@ XCC_ROUTER_WASM_PATH="/tmp/aurora-factory-mainnet.wasm" USER_BASE_BIN=$(python3 -m site --user-base)/bin NODE_KEY_PATH=$NEARCORE_HOME/node0/validator_key.json AURORA_KEY_PATH=$NEARCORE_HOME/node0/aurora_key.json +MANAGER_KEY_PATH=$NEARCORE_HOME/node0/manager_key.json +RELAYER_KEY_PATH=$NEARCORE_HOME/node0/relayer_key.json AURORA_SECRET_KEY=27cb3ddbd18037b38d7fb9ae3433a9d6f5cd554a4ba5768c8a15053f688ee167 ENGINE_ACCOUNT=aurora.node0 +MANAGER_ACCOUNT=key-manager.aurora.node0 export PATH="$PATH:$USER_BASE_BIN:$HOME/.cargo/bin" @@ -90,15 +93,52 @@ aurora-cli --engine $ENGINE_ACCOUNT init \ --ft-metadata-path docs/res/ft_metadata.json || error_exit sleep 2 -# Deploy Hello World EVM code. -aurora-cli --engine $ENGINE_ACCOUNT deploy --code $EVM_CODE --aurora-secret-key $AURORA_SECRET_KEY || error_exit +# Upgrading Aurora EVM to 2.10.0. +version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) +assert_eq "$version" $AURORA_PREV_VERSION +echo "$version" +curl -sL $ENGINE_LAST_WASM_URL -o $ENGINE_WASM_PATH || error_exit +aurora-cli --engine $ENGINE_ACCOUNT stage-upgrade $ENGINE_WASM_PATH || error_exit +sleep 2 +aurora-cli --engine $ENGINE_ACCOUNT deploy-upgrade || error_exit +sleep 1 +version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) +assert_eq "$version" $AURORA_LAST_VERSION +echo "$version" + +# Create account id for key manager +aurora-cli create-account --account $MANAGER_ACCOUNT --balance 10 > $MANAGER_KEY_PATH || error_exit +sleep 1 + +# Set key manager +aurora-cli --engine $ENGINE_ACCOUNT set-key-manager $MANAGER_ACCOUNT || error_exit +sleep 1 + +# Create new keys for relayer +aurora-cli generate-near-key $ENGINE_ACCOUNT ed25519 > $RELAYER_KEY_PATH || error_exit +relayer_public_key="$(jq -r .public_key < $RELAYER_KEY_PATH)" + +# Add relayer key by key manager +export NEAR_KEY_PATH=$MANAGER_KEY_PATH +aurora-cli --engine $ENGINE_ACCOUNT add-relayer-key --public-key "$relayer_public_key" --allowance "0.5" || error_exit +sleep 1 + +# Deploy Hello World EVM code with relayer key. +export NEAR_KEY_PATH=$RELAYER_KEY_PATH +aurora-cli --engine $ENGINE_ACCOUNT deploy --code "$EVM_CODE" --aurora-secret-key $AURORA_SECRET_KEY || error_exit sleep 1 result=$(aurora-cli --engine $ENGINE_ACCOUNT view-call -a 0xa3078bf607d2e859dca0b1a13878ec2e607f30de -f greet \ --abi-path $ABI_PATH || error_exit) assert_eq "$result" "Hello, World!" sleep 1 +# Remove relayer key +export NEAR_KEY_PATH=$MANAGER_KEY_PATH +aurora-cli --engine $ENGINE_ACCOUNT remove-relayer-key "$relayer_public_key" || error_exit +sleep 1 + # Deploy Counter EVM code. +export NEAR_KEY_PATH=$AURORA_KEY_PATH EVM_CODE=$(cat docs/res/Counter.hex) ABI_PATH=docs/res/Counter.abi aurora-cli --engine $ENGINE_ACCOUNT deploy --code $EVM_CODE --abi-path $ABI_PATH --args '{"init_value":"5"}' \ @@ -127,9 +167,6 @@ sleep 1 # Check read operations. aurora-cli --engine $ENGINE_ACCOUNT get-chain-id || error_exit -version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) -assert_eq "$version" $AURORA_PREV_VERSION -echo "$version" aurora-cli --engine $ENGINE_ACCOUNT get-owner || error_exit aurora-cli --engine $ENGINE_ACCOUNT get-bridge-prover || error_exit aurora-cli --engine $ENGINE_ACCOUNT get-balance 0x04b678962787ccd195a8e324d4c6bc4d5727f82b || error_exit @@ -142,16 +179,6 @@ assert_eq "$block_hash" "0xd31857e9ce14083a7a74092b71f9ac48b8c0d4988ad40074182c1 aurora-cli --engine $ENGINE_ACCOUNT register-relayer 0xf644ad75e048eaeb28844dd75bd384984e8cd508 || error_exit sleep 1 -# Upgrading Aurora EVM to 2.9.0. -curl -sL $ENGINE_LAST_WASM_URL -o $ENGINE_WASM_PATH || error_exit -aurora-cli --engine $ENGINE_ACCOUNT stage-upgrade $ENGINE_WASM_PATH || error_exit -sleep 2 -aurora-cli --engine $ENGINE_ACCOUNT deploy-upgrade || error_exit -sleep 1 -version=$(aurora-cli --engine $ENGINE_ACCOUNT get-version || error_exit) -assert_eq "$version" $AURORA_LAST_VERSION -echo "$version" - # Set a new owner. The functionality has not been released yet. aurora-cli --engine $ENGINE_ACCOUNT set-owner node0 || error_exit sleep 1 diff --git a/src/client/near.rs b/src/client/near.rs index 692cf14..1b943c0 100644 --- a/src/client/near.rs +++ b/src/client/near.rs @@ -44,7 +44,6 @@ impl NearClient { ); let client = reqwest::Client::builder() .timeout(std::time::Duration::from_secs(TIMEOUT)) - .connect_timeout(std::time::Duration::from_secs(TIMEOUT)) .default_headers(headers) .build() .map(JsonRpcClient::with) From 0d94880ea4c16e19809b0697af84f84c895e7772 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Fri, 18 Aug 2023 11:07:18 +0200 Subject: [PATCH 7/8] chore: use self-hosted runners for cli tests --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 997cde1..deaff55 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -10,7 +10,7 @@ on: jobs: shell_tests: name: Tests ${{ matrix.interface }} CLI - runs-on: ubuntu-latest + runs-on: [self-hosted, heavy] strategy: matrix: interface: [ Advanced, Simple, Silo ] From e8d2970481d4076b0f5daea3d180391f4d390b34 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Fri, 18 Aug 2023 11:15:36 +0200 Subject: [PATCH 8/8] chore: fix imports --- Cargo.lock | 22 +++++----------------- Cargo.toml | 8 ++++---- src/cli/advanced/near.rs | 6 +++--- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c750f0..80bec6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,17 +246,16 @@ dependencies = [ [[package]] name = "aurora-engine-modexp" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=silo-2.10.2#72ecee76617c3aa73625daf333c5b0aaf8b13a13" dependencies = [ "hex", - "ibig", "num", ] [[package]] name = "aurora-engine-precompiles" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=silo-2.10.2#72ecee76617c3aa73625daf333c5b0aaf8b13a13" dependencies = [ "aurora-engine-modexp", "aurora-engine-sdk", @@ -275,7 +274,7 @@ dependencies = [ [[package]] name = "aurora-engine-sdk" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=silo-2.10.2#72ecee76617c3aa73625daf333c5b0aaf8b13a13" dependencies = [ "aurora-engine-types", "base64 0.21.2", @@ -286,7 +285,7 @@ dependencies = [ [[package]] name = "aurora-engine-transactions" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=silo-2.10.2#72ecee76617c3aa73625daf333c5b0aaf8b13a13" dependencies = [ "aurora-engine-precompiles", "aurora-engine-sdk", @@ -298,7 +297,7 @@ dependencies = [ [[package]] name = "aurora-engine-types" version = "1.0.0" -source = "git+https://github.com/aurora-is-near/aurora-engine.git?branch=feat/aleksuss/silo#41aa01baffaddc3930b9542c7987b953f962459e" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=silo-2.10.2#72ecee76617c3aa73625daf333c5b0aaf8b13a13" dependencies = [ "base64 0.21.2", "borsh 0.10.3", @@ -1469,17 +1468,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ibig" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fcc7f316b2c079dde77564a1360639c1a956a23fa96122732e416cb10717bb" -dependencies = [ - "cfg-if", - "num-traits", - "static_assertions", -] - [[package]] name = "ident_case" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index b59552d..0569e3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,10 +19,10 @@ simple = [] advanced = [] [dependencies] -aurora-engine-precompiles = { git = "https://github.com/aurora-is-near/aurora-engine.git", branch = "feat/aleksuss/silo", features = ["std"] } -aurora-engine-sdk = { git = "https://github.com/aurora-is-near/aurora-engine.git", branch = "feat/aleksuss/silo", features = ["std"] } -aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", branch = "feat/aleksuss/silo", features = ["std"] } -aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", branch = "feat/aleksuss/silo", features = ["std", "impl-serde"] } +aurora-engine-precompiles = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "silo-2.10.2", features = ["std"] } +aurora-engine-sdk = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "silo-2.10.2", features = ["std"] } +aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "silo-2.10.2", features = ["std"] } +aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "silo-2.10.2", features = ["std", "impl-serde"] } anyhow = "1" bs58 = "0.5" diff --git a/src/cli/advanced/near.rs b/src/cli/advanced/near.rs index b62e56b..305d788 100644 --- a/src/cli/advanced/near.rs +++ b/src/cli/advanced/near.rs @@ -3,10 +3,10 @@ use crate::{ utils, }; use aurora_engine_types::borsh::{BorshDeserialize, BorshSerialize}; -use aurora_engine_types::parameters::connector::InitCallArgs; +use aurora_engine_types::parameters::connector::{InitCallArgs, PauseEthConnectorCallArgs}; use aurora_engine_types::parameters::engine::{ - DeployErc20TokenArgs, GetStorageAtArgs, NewCallArgs, NewCallArgsV2, PauseEthConnectorCallArgs, - SubmitResult, TransactionStatus, + DeployErc20TokenArgs, GetStorageAtArgs, NewCallArgs, NewCallArgsV2, SubmitResult, + TransactionStatus, }; use aurora_engine_types::{ account_id::AccountId,