From 53d2640f18804ac95bae15684d4d6f632a162b87 Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Fri, 24 May 2024 15:03:26 +0000 Subject: [PATCH 01/10] tuple replaced with struct for signature result --- contract/src/lib.rs | 45 +++++++++++++++++++------------------- contract/src/primitives.rs | 6 +++++ 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/contract/src/lib.rs b/contract/src/lib.rs index 20d8b5215..856e4e497 100644 --- a/contract/src/lib.rs +++ b/contract/src/lib.rs @@ -5,7 +5,9 @@ use near_sdk::collections::LookupMap; use near_sdk::serde::{Deserialize, Serialize}; use near_sdk::{env, near_bindgen, AccountId, Promise, PromiseOrValue, PublicKey}; use near_sdk::{log, Gas}; -use primitives::{CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, Votes}; +use primitives::{ + CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, SignResult, Votes, +}; use std::collections::{BTreeMap, HashSet}; const GAS_FOR_SIGN_CALL: Gas = Gas::from_tgas(250); @@ -62,19 +64,19 @@ impl Default for VersionedMpcContract { #[derive(BorshDeserialize, BorshSerialize, Debug)] pub struct MpcContract { protocol_state: ProtocolContractState, - pending_requests: LookupMap<[u8; 32], Option<(String, String)>>, + pending_requests: LookupMap<[u8; 32], Option>, request_counter: u32, } impl MpcContract { - fn add_request(&mut self, payload: &[u8; 32], signature: &Option<(String, String)>) { + fn add_request(&mut self, payload: &[u8; 32], sign_result: &Option) { if self.request_counter > 8 { env::panic_str("Too many pending requests. Please, try again later."); } if !self.pending_requests.contains_key(payload) { self.request_counter += 1; } - self.pending_requests.insert(payload, signature); + self.pending_requests.insert(payload, sign_result); } fn remove_request(&mut self, payload: &[u8; 32]) { @@ -82,9 +84,9 @@ impl MpcContract { self.request_counter -= 1; } - fn add_signature(&mut self, payload: &[u8; 32], signature: (String, String)) { + fn add_sig_result(&mut self, payload: &[u8; 32], sign_result: SignResult) { if self.pending_requests.contains_key(payload) { - self.pending_requests.insert(payload, &Some(signature)); + self.pending_requests.insert(payload, &Some(sign_result)); } } @@ -135,9 +137,9 @@ impl VersionedMpcContract { path, key_version ); - match self.signature_per_payload(payload) { + match self.sign_result(payload) { None => { - self.add_request(&payload, &None); + self.add_sign_request(&payload, &None); log!(&serde_json::to_string(&near_sdk::env::random_seed_array()).unwrap()); Self::ext(env::current_account_id()).sign_helper(payload, 0) } @@ -172,6 +174,7 @@ impl VersionedMpcContract { #[near_bindgen] impl VersionedMpcContract { pub fn respond(&mut self, payload: [u8; 32], big_r: String, s: String) { + // TODO: change to SignResult let protocol_state = self.mutable_state(); if let ProtocolContractState::Running(state) = protocol_state { let signer = env::signer_account_id(); @@ -183,7 +186,7 @@ impl VersionedMpcContract { big_r, s ); - self.add_signature(&payload, (big_r, s)); + self.add_sign_result(&payload, SignResult { big_r, s }); } else { env::panic_str("only participants can respond"); } @@ -462,12 +465,8 @@ impl VersionedMpcContract { } #[private] - pub fn sign_helper( - &mut self, - payload: [u8; 32], - depth: usize, - ) -> PromiseOrValue<(String, String)> { - if let Some(signature) = self.signature_per_payload(payload) { + pub fn sign_helper(&mut self, payload: [u8; 32], depth: usize) -> PromiseOrValue { + if let Some(signature) = self.sign_result(payload) { match signature { Some(signature) => { log!( @@ -475,7 +474,7 @@ impl VersionedMpcContract { signature, depth ); - self.remove_request(&payload); + self.remove_sign_request(&payload); PromiseOrValue::Value(signature) } None => { @@ -484,7 +483,7 @@ impl VersionedMpcContract { // We keep one call back so we can cleanup then call panic on the next call // Start cleaning up if there's less than 25 teragas left regardless of how deep you are. if depth > 30 || env::prepaid_gas() < Gas::from_tgas(25) { - self.remove_request(&payload); + self.remove_sign_request(&payload); let self_id = env::current_account_id(); PromiseOrValue::Promise(Self::ext(self_id).fail_helper( "Signature was not provided in time. Please, try again.".to_string(), @@ -556,7 +555,7 @@ impl VersionedMpcContract { // Helper functions #[near_bindgen] impl VersionedMpcContract { - fn remove_request(&mut self, payload: &[u8; 32]) { + fn remove_sign_request(&mut self, payload: &[u8; 32]) { match self { Self::V0(mpc_contract) => { mpc_contract.remove_request(payload); @@ -564,18 +563,18 @@ impl VersionedMpcContract { } } - fn add_request(&mut self, payload: &[u8; 32], signature: &Option<(String, String)>) { + fn add_sign_request(&mut self, payload: &[u8; 32], sign_result: &Option) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_request(payload, signature); + mpc_contract.add_request(payload, sign_result); } } } - fn add_signature(&mut self, payload: &[u8; 32], signature: (String, String)) { + fn add_sign_result(&mut self, payload: &[u8; 32], sign_result: SignResult) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_signature(payload, signature); + mpc_contract.add_sig_result(payload, sign_result); } } } @@ -586,7 +585,7 @@ impl VersionedMpcContract { } } - fn signature_per_payload(&self, payload: [u8; 32]) -> Option> { + fn sign_result(&self, payload: [u8; 32]) -> Option> { match self { Self::V0(mpc_contract) => mpc_contract.pending_requests.get(&payload), } diff --git a/contract/src/primitives.rs b/contract/src/primitives.rs index da64800b6..358fc3395 100644 --- a/contract/src/primitives.rs +++ b/contract/src/primitives.rs @@ -207,3 +207,9 @@ impl PkVotes { self.votes.entry(public_key).or_default() } } + +#[derive(BorshDeserialize, BorshSerialize, Debug)] +pub struct SignResult { + pub big_r: String, + pub s: String, +} From 3fafe29904537d740d165be6c7259b4b10bca1cc Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Fri, 24 May 2024 15:23:11 +0000 Subject: [PATCH 02/10] SignResult traits --- contract/src/primitives.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract/src/primitives.rs b/contract/src/primitives.rs index 358fc3395..65c3f42db 100644 --- a/contract/src/primitives.rs +++ b/contract/src/primitives.rs @@ -208,7 +208,7 @@ impl PkVotes { } } -#[derive(BorshDeserialize, BorshSerialize, Debug)] +#[derive(Serialize, Deserialize, BorshDeserialize, BorshSerialize, Debug)] pub struct SignResult { pub big_r: String, pub s: String, From e91c2d2e58e2b9d75f3e8cde02794d013ffb47dc Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Tue, 28 May 2024 12:32:13 +0300 Subject: [PATCH 03/10] typing fixed --- .../tests/multichain/actions/wait_for.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/integration-tests/tests/multichain/actions/wait_for.rs b/integration-tests/tests/multichain/actions/wait_for.rs index da98423a9..38c4f7c3c 100644 --- a/integration-tests/tests/multichain/actions/wait_for.rs +++ b/integration-tests/tests/multichain/actions/wait_for.rs @@ -14,6 +14,8 @@ use near_jsonrpc_client::methods::tx::TransactionInfo; use near_lake_primitives::CryptoHash; use near_primitives::views::FinalExecutionStatus; use near_workspaces::Account; +use serde::Deserialize; +use serde::Serialize; pub async fn running_mpc<'a>( ctx: &MultichainTestContext<'a>, @@ -199,6 +201,13 @@ pub async fn has_at_least_mine_presignatures<'a>( Ok(state_views) } +// TODO: use structur efrom contract one the internal types are the same +#[derive(Serialize, Deserialize, Debug)] +pub struct SignResult { + pub big_r: AffinePoint, + pub s: Scalar, +} + pub async fn signature_responded( ctx: &MultichainTestContext<'_>, tx_hash: CryptoHash, @@ -216,8 +225,11 @@ pub async fn signature_responded( let FinalExecutionStatus::SuccessValue(payload) = outcome_view.status else { anyhow::bail!("tx finished unsuccessfully: {:?}", outcome_view.status); }; - let (big_r, s): (AffinePoint, Scalar) = serde_json::from_slice(&payload)?; - let signature = cait_sith::FullSignature:: { big_r, s }; + let result: SignResult = serde_json::from_slice(&payload)?; + let signature = cait_sith::FullSignature:: { + big_r: result.big_r, + s: result.s, + }; Ok(signature) }; From b44f80d6087738b3fb76f27fd7e2164a3dc29bcd Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Tue, 28 May 2024 09:36:51 +0000 Subject: [PATCH 04/10] typed sign request --- contract/src/lib.rs | 83 ++++++++++++++++++++------------------ contract/src/primitives.rs | 7 ++++ 2 files changed, 51 insertions(+), 39 deletions(-) diff --git a/contract/src/lib.rs b/contract/src/lib.rs index 856e4e497..7ff942e64 100644 --- a/contract/src/lib.rs +++ b/contract/src/lib.rs @@ -6,7 +6,8 @@ use near_sdk::serde::{Deserialize, Serialize}; use near_sdk::{env, near_bindgen, AccountId, Promise, PromiseOrValue, PublicKey}; use near_sdk::{log, Gas}; use primitives::{ - CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, SignResult, Votes, + CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, SignRequest, SignResult, + Votes, }; use std::collections::{BTreeMap, HashSet}; @@ -64,35 +65,35 @@ impl Default for VersionedMpcContract { #[derive(BorshDeserialize, BorshSerialize, Debug)] pub struct MpcContract { protocol_state: ProtocolContractState, - pending_requests: LookupMap<[u8; 32], Option>, + pending_requests: LookupMap>, request_counter: u32, } impl MpcContract { - fn add_request(&mut self, payload: &[u8; 32], sign_result: &Option) { + fn add_request(&mut self, request: &SignRequest, sign_result: &Option) { if self.request_counter > 8 { env::panic_str("Too many pending requests. Please, try again later."); } - if !self.pending_requests.contains_key(payload) { + if !self.pending_requests.contains_key(request) { self.request_counter += 1; } - self.pending_requests.insert(payload, sign_result); + self.pending_requests.insert(request, sign_result); } - fn remove_request(&mut self, payload: &[u8; 32]) { - self.pending_requests.remove(payload); + fn remove_request(&mut self, request: &SignRequest) { + self.pending_requests.remove(request); self.request_counter -= 1; } - fn add_sig_result(&mut self, payload: &[u8; 32], sign_result: SignResult) { - if self.pending_requests.contains_key(payload) { - self.pending_requests.insert(payload, &Some(sign_result)); + fn add_sig_result(&mut self, request: &SignRequest, sign_result: SignResult) { + if self.pending_requests.contains_key(request) { + self.pending_requests.insert(request, &Some(sign_result)); } } - fn clean_payloads(&mut self, payloads: Vec<[u8; 32]>, counter: u32) { + fn clean_payloads(&mut self, requests: Vec, counter: u32) { log!("clean_payloads"); - for payload in payloads.iter() { + for payload in requests.iter() { self.pending_requests.remove(payload); } self.request_counter = counter; @@ -116,10 +117,10 @@ impl MpcContract { impl VersionedMpcContract { #[allow(unused_variables)] /// `key_version` must be less than or equal to the value at `latest_key_version` - pub fn sign(&mut self, payload: [u8; 32], path: String, key_version: u32) -> Promise { + pub fn sign(&mut self, request: SignRequest) -> Promise { let latest_key_version: u32 = self.latest_key_version(); assert!( - key_version <= latest_key_version, + request.key_version <= latest_key_version, "This version of the signer contract doesn't support versions greater than {}", latest_key_version, ); @@ -133,15 +134,15 @@ impl VersionedMpcContract { log!( "sign: signer={}, payload={:?}, path={:?}, key_version={}", env::signer_account_id(), - payload, - path, - key_version + request.payload, + request.path, + request.key_version ); - match self.sign_result(payload) { + match self.sign_result(&request) { None => { - self.add_sign_request(&payload, &None); + self.add_sign_request(&request, &None); log!(&serde_json::to_string(&near_sdk::env::random_seed_array()).unwrap()); - Self::ext(env::current_account_id()).sign_helper(payload, 0) + Self::ext(env::current_account_id()).sign_helper(request, 0) } Some(_) => env::panic_str("Signature for this payload already requested"), } @@ -173,20 +174,20 @@ impl VersionedMpcContract { // MPC Node API #[near_bindgen] impl VersionedMpcContract { - pub fn respond(&mut self, payload: [u8; 32], big_r: String, s: String) { + pub fn respond(&mut self, request: SignRequest, big_r: String, s: String) { // TODO: change to SignResult let protocol_state = self.mutable_state(); if let ProtocolContractState::Running(state) = protocol_state { let signer = env::signer_account_id(); if state.participants.contains_key(&signer) { log!( - "respond: signer={}, payload={:?} big_r={} s={}", + "respond: signer={}, request={:?} big_r={} s={}", signer, - payload, + request, big_r, s ); - self.add_sign_result(&payload, SignResult { big_r, s }); + self.add_sign_result(&request, SignResult { big_r, s }); } else { env::panic_str("only participants can respond"); } @@ -465,8 +466,12 @@ impl VersionedMpcContract { } #[private] - pub fn sign_helper(&mut self, payload: [u8; 32], depth: usize) -> PromiseOrValue { - if let Some(signature) = self.sign_result(payload) { + pub fn sign_helper( + &mut self, + request: SignRequest, + depth: usize, + ) -> PromiseOrValue { + if let Some(signature) = self.sign_result(&request) { match signature { Some(signature) => { log!( @@ -474,7 +479,7 @@ impl VersionedMpcContract { signature, depth ); - self.remove_sign_request(&payload); + self.remove_sign_request(&request); PromiseOrValue::Value(signature) } None => { @@ -483,7 +488,7 @@ impl VersionedMpcContract { // We keep one call back so we can cleanup then call panic on the next call // Start cleaning up if there's less than 25 teragas left regardless of how deep you are. if depth > 30 || env::prepaid_gas() < Gas::from_tgas(25) { - self.remove_sign_request(&payload); + self.remove_sign_request(&request); let self_id = env::current_account_id(); PromiseOrValue::Promise(Self::ext(self_id).fail_helper( "Signature was not provided in time. Please, try again.".to_string(), @@ -495,7 +500,7 @@ impl VersionedMpcContract { )); let account_id = env::current_account_id(); PromiseOrValue::Promise( - Self::ext(account_id).sign_helper(payload, depth + 1), + Self::ext(account_id).sign_helper(request, depth + 1), ) } } @@ -532,10 +537,10 @@ impl VersionedMpcContract { } #[private] - pub fn clean_payloads(&mut self, payloads: Vec<[u8; 32]>, counter: u32) { + pub fn clean_payloads(&mut self, requests: Vec, counter: u32) { match self { Self::V0(mpc_contract) => { - mpc_contract.clean_payloads(payloads, counter); + mpc_contract.clean_payloads(requests, counter); } } } @@ -555,26 +560,26 @@ impl VersionedMpcContract { // Helper functions #[near_bindgen] impl VersionedMpcContract { - fn remove_sign_request(&mut self, payload: &[u8; 32]) { + fn remove_sign_request(&mut self, request: &SignRequest) { match self { Self::V0(mpc_contract) => { - mpc_contract.remove_request(payload); + mpc_contract.remove_request(request); } } } - fn add_sign_request(&mut self, payload: &[u8; 32], sign_result: &Option) { + fn add_sign_request(&mut self, request: &SignRequest, sign_result: &Option) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_request(payload, sign_result); + mpc_contract.add_request(request, sign_result); } } } - fn add_sign_result(&mut self, payload: &[u8; 32], sign_result: SignResult) { + fn add_sign_result(&mut self, request: &SignRequest, sign_result: SignResult) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_sig_result(payload, sign_result); + mpc_contract.add_sig_result(request, sign_result); } } } @@ -585,9 +590,9 @@ impl VersionedMpcContract { } } - fn sign_result(&self, payload: [u8; 32]) -> Option> { + fn sign_result(&self, request: &SignRequest) -> Option> { match self { - Self::V0(mpc_contract) => mpc_contract.pending_requests.get(&payload), + Self::V0(mpc_contract) => mpc_contract.pending_requests.get(request), } } } diff --git a/contract/src/primitives.rs b/contract/src/primitives.rs index 65c3f42db..5427032f9 100644 --- a/contract/src/primitives.rs +++ b/contract/src/primitives.rs @@ -208,6 +208,13 @@ impl PkVotes { } } +#[derive(Serialize, Deserialize, BorshDeserialize, BorshSerialize, Debug)] +pub struct SignRequest { + pub payload: [u8; 32], + pub path: String, + pub key_version: u32, +} + #[derive(Serialize, Deserialize, BorshDeserialize, BorshSerialize, Debug)] pub struct SignResult { pub big_r: String, From 7b1ac639dcf8477e61c8992b260d07af79a65a22 Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Tue, 28 May 2024 12:57:16 +0300 Subject: [PATCH 05/10] merge conflict fix --- .../chain-signatures/tests/actions/wait_for.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/integration-tests/chain-signatures/tests/actions/wait_for.rs b/integration-tests/chain-signatures/tests/actions/wait_for.rs index 1e7d0bd40..8fb0f0a8a 100644 --- a/integration-tests/chain-signatures/tests/actions/wait_for.rs +++ b/integration-tests/chain-signatures/tests/actions/wait_for.rs @@ -233,22 +233,19 @@ pub async fn signature_responded( let Some(outcome) = outcome_view.final_execution_outcome else { anyhow::bail!("final execution outcome not available"); }; -<<<<<<< HEAD:integration-tests/tests/multichain/actions/wait_for.rs - let result: SignResult = serde_json::from_slice(&payload)?; - let signature = cait_sith::FullSignature:: { - big_r: result.big_r, - s: result.s, - }; -======= + let outcome = outcome.into_outcome(); let FinalExecutionStatus::SuccessValue(payload) = outcome.status else { anyhow::bail!("tx finished unsuccessfully: {:?}", outcome.status); }; - let (big_r, s): (AffinePoint, Scalar) = serde_json::from_slice(&payload)?; - let signature = cait_sith::FullSignature:: { big_r, s }; ->>>>>>> develop:integration-tests/chain-signatures/tests/actions/wait_for.rs + let result: SignResult = serde_json::from_slice(&payload)?; + let signature = cait_sith::FullSignature:: { + big_r: result.big_r, + s: result.s, + }; + Ok(signature) }; From 976f60dc1c86f73aa3d3015c2e568394969fd03e Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Tue, 28 May 2024 13:57:15 +0300 Subject: [PATCH 06/10] use struct when calling sign --- .vscode/settings.json | 1 + .../chain-signatures/tests/actions/mod.rs | 30 +++++++++++++++---- load-tests/src/multichain/mod.rs | 19 ++++++++++-- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d611c29b5..1cceca8ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,6 @@ "integration-tests/chain-signatures/Cargo.toml", "integration-tests/fastauth/Cargo.toml", "mpc-recovery/Cargo.toml", + "load-tests/Cargo.toml", ], } diff --git a/integration-tests/chain-signatures/tests/actions/mod.rs b/integration-tests/chain-signatures/tests/actions/mod.rs index c7ea89ee5..9f887eb67 100644 --- a/integration-tests/chain-signatures/tests/actions/mod.rs +++ b/integration-tests/chain-signatures/tests/actions/mod.rs @@ -21,6 +21,7 @@ use near_primitives::transaction::{Action, FunctionCallAction, Transaction}; use near_workspaces::Account; use rand::Rng; use secp256k1::XOnlyPublicKey; +use serde::{Deserialize, Serialize}; use std::time::Duration; @@ -31,6 +32,14 @@ use k256::{ PublicKey as K256PublicKey, }; +// TODO: use struct from contract +#[derive(Serialize, Deserialize, Debug)] +pub struct SignRequest { + pub payload: [u8; 32], + pub path: String, + pub key_version: u32, +} + pub async fn request_sign( ctx: &MultichainTestContext<'_>, ) -> anyhow::Result<([u8; 32], [u8; 32], Account, CryptoHash)> { @@ -48,6 +57,12 @@ pub async fn request_sign( .rpc_client .fetch_nonce(&signer.account_id, &signer.public_key) .await?; + + let request = SignRequest { + payload: payload_hashed, + path: "test".to_string(), + key_version: 0, + }; let tx_hash = ctx .jsonrpc_client .call(&RpcBroadcastTxAsyncRequest { @@ -60,9 +75,7 @@ pub async fn request_sign( actions: vec![Action::FunctionCall(Box::new(FunctionCallAction { method_name: "sign".to_string(), args: serde_json::to_vec(&serde_json::json!({ - "payload": payload_hashed, - "path": "test", - "key_version": 0, + "request": request, }))?, gas: 300_000_000_000_000, deposit: 0, @@ -118,6 +131,13 @@ pub async fn request_sign_non_random( .rpc_client .fetch_nonce(&signer.account_id, &signer.public_key) .await?; + + let request = SignRequest { + payload: payload_hashed, + path: "test".to_string(), + key_version: 0, + }; + let tx_hash = ctx .jsonrpc_client .call(&RpcBroadcastTxAsyncRequest { @@ -130,9 +150,7 @@ pub async fn request_sign_non_random( actions: vec![Action::FunctionCall(Box::new(FunctionCallAction { method_name: "sign".to_string(), args: serde_json::to_vec(&serde_json::json!({ - "payload": payload_hashed, - "path": "test", - "key_version": 0, + "request": request, }))?, gas: 300_000_000_000_000, deposit: 0, diff --git a/load-tests/src/multichain/mod.rs b/load-tests/src/multichain/mod.rs index e8125a4af..7b01d755c 100644 --- a/load-tests/src/multichain/mod.rs +++ b/load-tests/src/multichain/mod.rs @@ -10,9 +10,18 @@ use near_primitives::{ }; use rand::Rng; use reqwest::header::CONTENT_TYPE; +use serde::{Deserialize, Serialize}; use crate::fastauth::primitives::UserSession; +// TODO: declare this struct in one place and reuse it +#[derive(Serialize, Deserialize, Debug)] +pub struct SignRequest { + pub payload: [u8; 32], + pub path: String, + pub key_version: u32, +} + pub async fn multichain_sign(user: &mut GooseUser) -> TransactionResult { tracing::info!("multichain_sign"); @@ -42,6 +51,12 @@ pub async fn multichain_sign(user: &mut GooseUser) -> TransactionResult { let payload_hashed: [u8; 32] = rand::thread_rng().gen(); tracing::info!("requesting signature for: {:?}", payload_hashed); + let request = SignRequest { + payload: payload_hashed, + path: "test".to_string(), + key_version: 0, + }; + let transaction = Transaction { signer_id: session.near_account_id.clone(), public_key: session.fa_sk.public_key(), @@ -51,9 +66,7 @@ pub async fn multichain_sign(user: &mut GooseUser) -> TransactionResult { actions: vec![Action::FunctionCall(FunctionCallAction { method_name: "sign".to_string(), args: serde_json::to_vec(&serde_json::json!({ - "payload": payload_hashed, - "path": "test", - "key_version": 0, + "request": request, })) .unwrap(), gas: 300_000_000_000_000, From b0694a36c1da6f6c7bf01bcbb414c6e1c3a51f29 Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Thu, 30 May 2024 18:23:30 +0300 Subject: [PATCH 07/10] use struct instead of payload on the ndoe --- contract/src/lib.rs | 10 ++--- load-tests/Cargo.lock | 72 ++++++---------------------------- node/src/indexer.rs | 14 +++---- node/src/protocol/message.rs | 5 ++- node/src/protocol/signature.rs | 63 ++++++++++++++--------------- 5 files changed, 58 insertions(+), 106 deletions(-) diff --git a/contract/src/lib.rs b/contract/src/lib.rs index fc6b6f4d5..3f29adebd 100644 --- a/contract/src/lib.rs +++ b/contract/src/lib.rs @@ -182,20 +182,18 @@ impl VersionedMpcContract { // MPC Node API #[near_bindgen] impl VersionedMpcContract { - pub fn respond(&mut self, request: SignRequest, big_r: String, s: String) { - // TODO: change to SignResult + pub fn respond(&mut self, request: SignRequest, result: SignResult) { let protocol_state = self.mutable_state(); if let ProtocolContractState::Running(state) = protocol_state { let signer = env::signer_account_id(); if state.participants.contains_key(&signer) { log!( - "respond: signer={}, request={:?} big_r={} s={}", + "respond: signer={}, request={:?} result:{:?}", signer, request, - big_r, - s + result ); - self.add_sign_result(&request, SignResult { big_r, s }); + self.add_sign_result(&request, result); } else { env::panic_str("only participants can respond"); } diff --git a/load-tests/Cargo.lock b/load-tests/Cargo.lock index aba47c8d4..ccf543eca 100644 --- a/load-tests/Cargo.lock +++ b/load-tests/Cargo.lock @@ -2836,7 +2836,7 @@ dependencies = [ "google-apis-common", "http", "hyper", - "hyper-rustls 0.24.2", + "hyper-rustls", "itertools 0.10.5", "mime", "serde", @@ -2856,7 +2856,7 @@ dependencies = [ "google-apis-common", "http", "hyper", - "hyper-rustls 0.24.2", + "hyper-rustls", "itertools 0.10.5", "mime", "serde", @@ -3191,21 +3191,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" -dependencies = [ - "http", - "hyper", - "log", - "rustls 0.20.9", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.23.4", -] - [[package]] name = "hyper-rustls" version = "0.24.2" @@ -3216,10 +3201,10 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.12", + "rustls", "rustls-native-certs", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -3971,7 +3956,7 @@ dependencies = [ "google-secretmanager1", "hex 0.4.3", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "jsonwebtoken", "lazy_static", "multi-party-eddsa", @@ -6780,7 +6765,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls 0.24.2", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -6790,7 +6775,7 @@ dependencies = [ "once_cell", "percent-encoding 2.3.1", "pin-project-lite", - "rustls 0.21.12", + "rustls", "rustls-pemfile", "serde", "serde_json", @@ -6799,7 +6784,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util 0.7.11", "tower-service", "url 2.5.0", @@ -6962,18 +6947,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.21.12" @@ -8101,24 +8074,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.12", + "rustls", "tokio", ] @@ -8621,7 +8583,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.21.12", + "rustls", "rustls-webpki", "url 2.5.0", "webpki-roots", @@ -9324,16 +9286,6 @@ dependencies = [ "url 2.5.0", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" version = "0.25.4" @@ -9598,11 +9550,11 @@ dependencies = [ "futures", "http", "hyper", - "hyper-rustls 0.24.2", + "hyper-rustls", "itertools 0.10.5", "log", "percent-encoding 2.3.1", - "rustls 0.21.12", + "rustls", "rustls-pemfile", "seahash", "serde", diff --git a/node/src/indexer.rs b/node/src/indexer.rs index 02b339fc0..f4b9ef7a2 100644 --- a/node/src/indexer.rs +++ b/node/src/indexer.rs @@ -66,11 +66,11 @@ impl Options { } } -#[derive(Debug, Serialize, Deserialize)] -struct SignPayload { - payload: [u8; 32], - path: String, - key_version: u32, +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] +pub struct ContractSignRequest { + pub payload: [u8; 32], + pub path: String, + pub key_version: u32, } #[derive(LakeContext)] @@ -101,7 +101,7 @@ async fn handle_block( if let Some(function_call) = action.as_function_call() { if function_call.method_name() == "sign" { if let Ok(sign_payload) = - serde_json::from_slice::<'_, SignPayload>(function_call.args()) + serde_json::from_slice::<'_, ContractSignRequest>(function_call.args()) { if receipt.logs().is_empty() { tracing::warn!("`sign` did not produce entropy"); @@ -130,7 +130,7 @@ async fn handle_block( let mut queue = ctx.queue.write().await; queue.add(SignRequest { receipt_id, - msg_hash: sign_payload.payload, + request: sign_payload, epsilon, delta, entropy, diff --git a/node/src/protocol/message.rs b/node/src/protocol/message.rs index 5864a8d57..2328a04b9 100644 --- a/node/src/protocol/message.rs +++ b/node/src/protocol/message.rs @@ -4,6 +4,7 @@ use super::state::{GeneratingState, NodeState, ResharingState, RunningState}; use super::triple::TripleId; use crate::gcp::error::SecretStorageError; use crate::http_client::SendError; +use crate::indexer::ContractSignRequest; use crate::mesh::Mesh; use crate::util; @@ -65,7 +66,7 @@ pub struct SignatureMessage { pub receipt_id: CryptoHash, pub proposer: Participant, pub presignature_id: PresignatureId, - pub msg_hash: [u8; 32], + pub request: ContractSignRequest, pub epsilon: Scalar, pub delta: Scalar, pub epoch: u64, @@ -347,7 +348,7 @@ impl MessageHandler for RunningState { *receipt_id, message.proposer, message.presignature_id, - message.msg_hash, + message.request.clone(), message.epsilon, message.delta, &mut presignature_manager, diff --git a/node/src/protocol/signature.rs b/node/src/protocol/signature.rs index 3e5be85ab..e59020e3f 100644 --- a/node/src/protocol/signature.rs +++ b/node/src/protocol/signature.rs @@ -1,6 +1,7 @@ use super::contract::primitives::Participants; use super::message::SignatureMessage; use super::presignature::{Presignature, PresignatureId, PresignatureManager}; +use crate::indexer::ContractSignRequest; use crate::kdf; use crate::types::{PublicKey, SignatureProtocol}; use crate::util::{AffinePointExt, ScalarExt}; @@ -25,7 +26,7 @@ pub const COMPLETION_EXISTENCE_TIMEOUT: Duration = Duration::from_secs(120 * 60) pub struct SignRequest { pub receipt_id: CryptoHash, - pub msg_hash: [u8; 32], + pub request: ContractSignRequest, pub epsilon: Scalar, pub delta: Scalar, pub entropy: [u8; 32], @@ -54,7 +55,7 @@ impl SignQueue { pub fn add(&mut self, request: SignRequest) { tracing::info!( receipt_id = %request.receipt_id, - payload = hex::encode(request.msg_hash), + payload = hex::encode(request.request.payload), entropy = hex::encode(request.entropy), "new sign request" ); @@ -115,7 +116,7 @@ pub struct SignatureGenerator { pub participants: Vec, pub proposer: Participant, pub presignature_id: PresignatureId, - pub msg_hash: [u8; 32], + pub request: ContractSignRequest, pub epsilon: Scalar, pub delta: Scalar, pub sign_request_timestamp: Instant, @@ -129,7 +130,7 @@ impl SignatureGenerator { participants: Vec, proposer: Participant, presignature_id: PresignatureId, - msg_hash: [u8; 32], + request: ContractSignRequest, epsilon: Scalar, delta: Scalar, sign_request_timestamp: Instant, @@ -139,7 +140,7 @@ impl SignatureGenerator { participants, proposer, presignature_id, - msg_hash, + request, epsilon, delta, sign_request_timestamp, @@ -163,7 +164,7 @@ impl SignatureGenerator { /// for starting up this failed signature once again. pub struct GenerationRequest { pub proposer: Participant, - pub msg_hash: [u8; 32], + pub request: ContractSignRequest, pub epsilon: Scalar, pub delta: Scalar, pub sign_request_timestamp: Instant, @@ -177,8 +178,13 @@ pub struct SignatureManager { /// Set of completed signatures completed: HashMap, /// Generated signatures assigned to the current node that are yet to be published. - /// Vec<(receipt_id, msg_hash, timestamp, output)> - signatures: Vec<(CryptoHash, [u8; 32], Instant, FullSignature)>, + /// Vec<(receipt_id, sign_request, timestamp, output)> + signatures: Vec<( + CryptoHash, + ContractSignRequest, + Instant, + FullSignature, + )>, me: Participant, public_key: PublicKey, epoch: u64, @@ -216,7 +222,7 @@ impl SignatureManager { let participants = participants.keys_vec(); let GenerationRequest { proposer, - msg_hash, + request, epsilon, delta, sign_request_timestamp, @@ -233,14 +239,14 @@ impl SignatureManager { me, kdf::derive_key(public_key, epsilon), output, - Scalar::from_bytes(&msg_hash), + Scalar::from_bytes(&request.payload), )?); Ok(SignatureGenerator::new( protocol, participants, proposer, presignature.id, - msg_hash, + request, epsilon, delta, sign_request_timestamp, @@ -268,7 +274,7 @@ impl SignatureManager { participants: &Participants, receipt_id: CryptoHash, presignature: Presignature, - msg_hash: [u8; 32], + request: ContractSignRequest, epsilon: Scalar, delta: Scalar, sign_request_timestamp: Instant, @@ -287,7 +293,7 @@ impl SignatureManager { presignature, GenerationRequest { proposer: self.me, - msg_hash, + request, epsilon, delta, sign_request_timestamp, @@ -310,7 +316,7 @@ impl SignatureManager { receipt_id: CryptoHash, proposer: Participant, presignature_id: PresignatureId, - msg_hash: [u8; 32], + request: ContractSignRequest, epsilon: Scalar, delta: Scalar, presignature_manager: &mut PresignatureManager, @@ -330,7 +336,7 @@ impl SignatureManager { presignature, GenerationRequest { proposer, - msg_hash, + request, epsilon, delta, sign_request_timestamp: Instant::now(), @@ -362,7 +368,7 @@ impl SignatureManager { *receipt_id, GenerationRequest { proposer: generator.proposer, - msg_hash: generator.msg_hash, + request: generator.request.clone(), epsilon: generator.epsilon, delta: generator.delta, sign_request_timestamp: generator.sign_request_timestamp @@ -386,7 +392,7 @@ impl SignatureManager { receipt_id: *receipt_id, proposer: generator.proposer, presignature_id: generator.presignature_id, - msg_hash: generator.msg_hash, + request: generator.request.clone(), epsilon: generator.epsilon, delta: generator.delta, epoch: self.epoch, @@ -403,7 +409,7 @@ impl SignatureManager { receipt_id: *receipt_id, proposer: generator.proposer, presignature_id: generator.presignature_id, - msg_hash: generator.msg_hash, + request: generator.request.clone(), epsilon: generator.epsilon, delta: generator.delta, epoch: self.epoch, @@ -424,7 +430,7 @@ impl SignatureManager { self.completed.insert(generator.presignature_id, Instant::now()); if generator.proposer == self.me { self.signatures - .push((*receipt_id, generator.msg_hash, generator.sign_request_timestamp, output)); + .push((*receipt_id, generator.request.clone(), generator.sign_request_timestamp, output)); } // Do not retain the protocol return false; @@ -491,7 +497,7 @@ impl SignatureManager { &sig_participants, receipt_id, presignature, - my_request.msg_hash, + my_request.request, my_request.epsilon, my_request.delta, my_request.time_added, @@ -514,20 +520,15 @@ impl SignatureManager { mpc_contract_id: &AccountId, my_account_id: &AccountId, ) -> Result<(), near_fetch::Error> { - for (receipt_id, payload, time_added, signature) in self.signatures.drain(..) { - // TODO: Figure out how to properly serialize the signature - // let r_s = signature.big_r.x().concat(signature.s.to_bytes()); - // let tag = - // ConditionallySelectable::conditional_select(&2u8, &3u8, signature.big_r.y_is_odd()); - // let signature = r_s.append(tag); - // let signature = Secp256K1Signature::try_from(signature.as_slice()).unwrap(); - // let signature = Signature::SECP256K1(signature); + for (receipt_id, request, time_added, signature) in self.signatures.drain(..) { let response = rpc_client .call(signer, mpc_contract_id, "respond") .args_json(serde_json::json!({ - "payload": payload, - "big_r": signature.big_r, - "s": signature.s + "request": request, + "result": { + "big_r": signature.big_r, + "s": signature.s, + }, })) .max_gas() .transact() From 317d879eec8624f892f353f6c4d7190878eaec2c Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Thu, 30 May 2024 20:25:41 +0300 Subject: [PATCH 08/10] args fix --- node/src/indexer.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/node/src/indexer.rs b/node/src/indexer.rs index f4b9ef7a2..5dd1758fb 100644 --- a/node/src/indexer.rs +++ b/node/src/indexer.rs @@ -66,6 +66,11 @@ impl Options { } } +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] +pub struct SignArguments { + pub request: ContractSignRequest, +} + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct ContractSignRequest { pub payload: [u8; 32], @@ -100,8 +105,8 @@ async fn handle_block( }; if let Some(function_call) = action.as_function_call() { if function_call.method_name() == "sign" { - if let Ok(sign_payload) = - serde_json::from_slice::<'_, ContractSignRequest>(function_call.args()) + if let Ok(aruments) = + serde_json::from_slice::<'_, SignArguments>(function_call.args()) { if receipt.logs().is_empty() { tracing::warn!("`sign` did not produce entropy"); @@ -116,21 +121,21 @@ async fn handle_block( continue; }; let epsilon = - kdf::derive_epsilon(&action.predecessor_id(), &sign_payload.path); + kdf::derive_epsilon(&action.predecessor_id(), &aruments.request.path); let delta = kdf::derive_delta(receipt_id, entropy); tracing::info!( receipt_id = %receipt_id, caller_id = receipt.predecessor_id().to_string(), our_account = ctx.node_account_id.to_string(), - payload = hex::encode(sign_payload.payload), - key_version = sign_payload.key_version, + payload = hex::encode(aruments.request.payload), + key_version = aruments.request.key_version, entropy = hex::encode(entropy), "indexed new `sign` function call" ); let mut queue = ctx.queue.write().await; queue.add(SignRequest { receipt_id, - request: sign_payload, + request: aruments.request, epsilon, delta, entropy, From 98dabae2b4271fce42dd459a09697d723b99c55d Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Thu, 30 May 2024 20:45:00 +0300 Subject: [PATCH 09/10] redundant structs removed --- .../chain-signatures/tests/actions/mod.rs | 10 +--------- .../chain-signatures/tests/actions/wait_for.rs | 2 +- load-tests/src/multichain/mod.rs | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/integration-tests/chain-signatures/tests/actions/mod.rs b/integration-tests/chain-signatures/tests/actions/mod.rs index 9f887eb67..4fea333e3 100644 --- a/integration-tests/chain-signatures/tests/actions/mod.rs +++ b/integration-tests/chain-signatures/tests/actions/mod.rs @@ -11,6 +11,7 @@ use k256::elliptic_curve::scalar::FromUintUnchecked; use k256::elliptic_curve::sec1::FromEncodedPoint; use k256::elliptic_curve::ProjectivePoint; use k256::{AffinePoint, EncodedPoint, Scalar, Secp256k1}; +use mpc_contract::primitives::SignRequest; use mpc_contract::RunningContractState; use mpc_recovery_node::kdf; use mpc_recovery_node::util::ScalarExt; @@ -21,7 +22,6 @@ use near_primitives::transaction::{Action, FunctionCallAction, Transaction}; use near_workspaces::Account; use rand::Rng; use secp256k1::XOnlyPublicKey; -use serde::{Deserialize, Serialize}; use std::time::Duration; @@ -32,14 +32,6 @@ use k256::{ PublicKey as K256PublicKey, }; -// TODO: use struct from contract -#[derive(Serialize, Deserialize, Debug)] -pub struct SignRequest { - pub payload: [u8; 32], - pub path: String, - pub key_version: u32, -} - pub async fn request_sign( ctx: &MultichainTestContext<'_>, ) -> anyhow::Result<([u8; 32], [u8; 32], Account, CryptoHash)> { diff --git a/integration-tests/chain-signatures/tests/actions/wait_for.rs b/integration-tests/chain-signatures/tests/actions/wait_for.rs index 8fb0f0a8a..8c03009c9 100644 --- a/integration-tests/chain-signatures/tests/actions/wait_for.rs +++ b/integration-tests/chain-signatures/tests/actions/wait_for.rs @@ -205,7 +205,7 @@ pub async fn has_at_least_mine_presignatures<'a>( Ok(state_views) } -// TODO: use structur efrom contract one the internal types are the same +// TODO: use structure from contract when the internal types are the same #[derive(Serialize, Deserialize, Debug)] pub struct SignResult { pub big_r: AffinePoint, diff --git a/load-tests/src/multichain/mod.rs b/load-tests/src/multichain/mod.rs index 7b01d755c..e49472b91 100644 --- a/load-tests/src/multichain/mod.rs +++ b/load-tests/src/multichain/mod.rs @@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize}; use crate::fastauth::primitives::UserSession; -// TODO: declare this struct in one place and reuse it #[derive(Serialize, Deserialize, Debug)] pub struct SignRequest { pub payload: [u8; 32], From 22c85cf916cda2c090d3b8687d32b934b7944421 Mon Sep 17 00:00:00 2001 From: DavidM-D Date: Fri, 31 May 2024 20:49:22 +0200 Subject: [PATCH 10/10] Signed responses (#621) * Moved kdf out of the node So the contract code can inherit it (also maybe include this in a client library later?) * Migrated contract over to using API with context * Fix test imports * Successfully merged into phuongs mega PR * Builds with signature verification * Working tests with a compatible API * All tests pass (with spurious reversing) * Test rogue responses fail * Generate recovery ID on node * Switched to use native near function to verify sig * Cleanup * Removed Multichain Signature type * Add missing import in wasm builds * Added a changelog explaining the API changes * Cleanup comments * Move into_eth_sig back up the dep tree * Migrate recovery ID functions up the tree * Clippy fix * Do the native function in a seperate PR It's not working with the CI * Fix fmt * Clippy fixes * Compiling after rebase * Update contract/src/lib.rs Co-authored-by: Serhii Volovyk * Fixed types and removed unneeded type * Simplify API * Shrink diff * Comment explaining the mad test --------- Co-authored-by: Serhii Volovyk --- .gitignore | 2 +- CHANGELOG.md | 6 + contract/Cargo.lock | 192 ++- contract/Cargo.toml | 2 + contract/src/lib.rs | 145 +- crypto-shared/Cargo.lock | 776 +++++++++ crypto-shared/Cargo.toml | 17 + crypto-shared/src/kdf.rs | 89 + crypto-shared/src/lib.rs | 28 + crypto-shared/src/types.rs | 109 ++ integration-tests/chain-signatures/Cargo.lock | 18 + integration-tests/chain-signatures/Cargo.toml | 1 + .../chain-signatures/tests/actions/mod.rs | 168 +- .../tests/actions/wait_for.rs | 68 +- .../chain-signatures/tests/cases/mod.rs | 34 +- load-tests/Cargo.lock | 1469 +++++++++-------- node/Cargo.lock | 17 + node/Cargo.toml | 1 + node/src/indexer.rs | 12 +- node/src/kdf.rs | 77 +- node/src/protocol/contract/mod.rs | 2 +- node/src/protocol/presignature.rs | 3 +- node/src/protocol/signature.rs | 37 +- node/src/protocol/state.rs | 3 +- node/src/types.rs | 2 +- node/src/util.rs | 20 +- 26 files changed, 2395 insertions(+), 903 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 crypto-shared/Cargo.lock create mode 100644 crypto-shared/Cargo.toml create mode 100644 crypto-shared/src/kdf.rs create mode 100644 crypto-shared/src/lib.rs create mode 100644 crypto-shared/src/types.rs diff --git a/.gitignore b/.gitignore index 0b30f9765..55f98965f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/target +**/target .direnv .DS_Store .idea diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..5d2b06941 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## 0.3.0 + +- Payload hash scalars are now big endian. In general this means that clients of the contract should no longer reverse their hashed payload before sending it to the MPC contract. + diff --git a/contract/Cargo.lock b/contract/Cargo.lock index b0df7b758..ff3ecf1d4 100644 --- a/contract/Cargo.lock +++ b/contract/Cargo.lock @@ -470,6 +470,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -1091,6 +1097,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -1326,6 +1338,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1368,6 +1392,20 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-shared" +version = "0.0.0" +dependencies = [ + "anyhow", + "borsh 1.5.0", + "getrandom 0.2.15", + "k256", + "near-account-id", + "near-sdk", + "serde", + "serde_json", +] + [[package]] name = "csv" version = "1.3.0" @@ -1391,9 +1429,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", "digest 0.9.0", @@ -1484,6 +1522,16 @@ dependencies = [ "uuid 1.8.0", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1554,6 +1602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -1689,6 +1738,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49457524c7e65648794c98283282a0b7c73b10018e7091f1cdcfff314fd7ae59" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature 2.2.0", + "spki", +] + [[package]] name = "ed25519" version = "1.5.3" @@ -1713,7 +1777,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.2.1", + "curve25519-dalek 3.2.0", "ed25519 1.5.3", "rand 0.7.3", "serde", @@ -1750,6 +1814,26 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array 0.14.7", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -1973,6 +2057,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -2234,6 +2328,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2290,6 +2385,17 @@ dependencies = [ "scroll 0.11.0", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "h2" version = "0.3.26" @@ -2770,6 +2876,21 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2 0.10.8", + "signature 2.2.0", +] + [[package]] name = "keccak" version = "0.1.5" @@ -3082,6 +3203,8 @@ version = "0.2.0" dependencies = [ "anyhow", "borsh 1.5.0", + "crypto-shared", + "k256", "near-sdk", "near-workspaces", "schemars", @@ -4619,6 +4742,16 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.30" @@ -5169,6 +5302,16 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.17.8" @@ -5418,6 +5561,21 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -5639,6 +5797,16 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha1" version = "0.10.6" @@ -5755,6 +5923,10 @@ name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] [[package]] name = "simdutf8" @@ -5854,6 +6026,16 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sptr" version = "0.3.2" @@ -7600,9 +7782,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] diff --git a/contract/Cargo.toml b/contract/Cargo.toml index a4f411f3f..eea844251 100644 --- a/contract/Cargo.toml +++ b/contract/Cargo.toml @@ -12,6 +12,8 @@ near-sdk = { version = "=5.1.0", features = ["legacy", "unit-testing"] } serde = { version = "1", features = ["derive"] } serde_json = "1" schemars = "0.8" +k256 = { version = "0.13.1", features = ["sha256", "ecdsa", "serde", "arithmetic", "expose-field"] } +crypto-shared = { path = "../crypto-shared" } [dev-dependencies] near-workspaces = { git = "https://github.com/near/near-workspaces-rs.git", branch = "feat/upgrade-near-deps" } diff --git a/contract/src/lib.rs b/contract/src/lib.rs index 3f29adebd..0371a0d86 100644 --- a/contract/src/lib.rs +++ b/contract/src/lib.rs @@ -1,5 +1,9 @@ pub mod primitives; +use crypto_shared::{ + derive_epsilon, derive_key, kdf::check_ec_signature, near_public_key_to_affine_point, + types::SignatureResponse, ScalarExt as _, SerializableScalar, +}; use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::collections::LookupMap; use near_sdk::serde::{Deserialize, Serialize}; @@ -9,8 +13,7 @@ use near_sdk::{ }; use primitives::{ - CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, SignRequest, SignResult, - Votes, + CandidateInfo, Candidates, ParticipantInfo, Participants, PkVotes, SignRequest, Votes, }; use std::collections::{BTreeMap, HashSet}; @@ -70,36 +73,53 @@ impl Default for VersionedMpcContract { } } +#[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize, Debug, Clone)] +pub struct SignatureRequest { + pub epsilon: SerializableScalar, + pub payload_hash: [u8; 32], +} + +impl SignatureRequest { + pub fn new(payload_hash: [u8; 32], predecessor_id: &AccountId, path: &str) -> Self { + let scalar = derive_epsilon(predecessor_id, path); + let epsilon = SerializableScalar { scalar }; + SignatureRequest { + epsilon, + payload_hash, + } + } +} + #[derive(BorshDeserialize, BorshSerialize, Debug)] pub struct MpcContract { protocol_state: ProtocolContractState, - pending_requests: LookupMap>, + pending_requests: LookupMap>, request_counter: u32, } impl MpcContract { - fn add_request(&mut self, request: &SignRequest, sign_result: &Option) { + fn add_request(&mut self, request: &SignatureRequest, result: &Option) { if self.request_counter > 8 { env::panic_str("Too many pending requests. Please, try again later."); } if !self.pending_requests.contains_key(request) { self.request_counter += 1; } - self.pending_requests.insert(request, sign_result); + self.pending_requests.insert(request, result); } - fn remove_request(&mut self, request: &SignRequest) { - self.pending_requests.remove(request); + fn remove_request(&mut self, payload: &SignatureRequest) { + self.pending_requests.remove(payload); self.request_counter -= 1; } - fn add_sig_result(&mut self, request: &SignRequest, sign_result: SignResult) { - if self.pending_requests.contains_key(request) { - self.pending_requests.insert(request, &Some(sign_result)); + fn add_sign_result(&mut self, payload: &SignatureRequest, signature: SignatureResponse) { + if self.pending_requests.contains_key(payload) { + self.pending_requests.insert(payload, &Some(signature)); } } - fn clean_payloads(&mut self, requests: Vec, counter: u32) { + fn clean_payloads(&mut self, requests: Vec, counter: u32) { log!("clean_payloads"); for payload in requests.iter() { self.pending_requests.remove(payload); @@ -126,9 +146,14 @@ impl VersionedMpcContract { #[allow(unused_variables)] /// `key_version` must be less than or equal to the value at `latest_key_version` pub fn sign(&mut self, request: SignRequest) -> Promise { + let SignRequest { + payload, + path, + key_version, + } = request; let latest_key_version: u32 = self.latest_key_version(); assert!( - request.key_version <= latest_key_version, + key_version <= latest_key_version, "This version of the signer contract doesn't support versions greater than {}", latest_key_version, ); @@ -139,16 +164,19 @@ impl VersionedMpcContract { env::prepaid_gas(), GAS_FOR_SIGN_CALL ); + let predecessor = env::predecessor_account_id(); log!( - "sign: signer={}, payload={:?}, path={:?}, key_version={}", - env::signer_account_id(), - request.payload, - request.path, - request.key_version + "sign: predecessor={}, payload={:?}, path={:?}, key_version={}", + predecessor, + payload, + path, + key_version ); + + let request = SignatureRequest::new(payload, &predecessor, &path); match self.sign_result(&request) { None => { - self.add_sign_request(&request, &None); + self.add_sign_request(&request); log!(&serde_json::to_string(&near_sdk::env::random_seed_array()).unwrap()); Self::ext(env::current_account_id()).sign_helper(request, 0) } @@ -157,7 +185,7 @@ impl VersionedMpcContract { } /// This is the root public key combined from all the public keys of the participants. - pub fn public_key(self) -> PublicKey { + pub fn public_key(&self) -> PublicKey { match self.state() { ProtocolContractState::Running(state) => state.public_key.clone(), ProtocolContractState::Resharing(state) => state.public_key.clone(), @@ -177,26 +205,41 @@ impl VersionedMpcContract { pub fn version(&self) -> String { env!("CARGO_PKG_VERSION").to_string() } -} -// MPC Node API -#[near_bindgen] -impl VersionedMpcContract { - pub fn respond(&mut self, request: SignRequest, result: SignResult) { + pub fn respond(&mut self, request: SignatureRequest, response: SignatureResponse) { let protocol_state = self.mutable_state(); - if let ProtocolContractState::Running(state) = protocol_state { + if let ProtocolContractState::Running(_) = protocol_state { let signer = env::signer_account_id(); - if state.participants.contains_key(&signer) { - log!( - "respond: signer={}, request={:?} result:{:?}", - signer, - request, - result - ); - self.add_sign_result(&request, result); - } else { - env::panic_str("only participants can respond"); + // TODO add back in a check to see that the caller is a participant (it's horrible to test atm) + // It's not strictly necessary, since we verify the payload is correct + log!( + "respond: signer={}, request={:?} big_r={:?} s={:?}", + &signer, + &request, + &response.big_r, + &response.s + ); + + // generate the expected public key + let expected_public_key = derive_key( + near_public_key_to_affine_point(self.public_key()), + request.epsilon.scalar, + ); + + // Check the signature is correct + if check_ec_signature( + &expected_public_key, + &response.big_r.affine_point, + &response.s.scalar, + k256::Scalar::from_bytes(&request.payload_hash[..]), + response.recovery_id, + ) + .is_err() + { + env::panic_str("Signature could not be verified"); } + + self.add_sign_result(&request, response); } else { env::panic_str("protocol is not in a running state"); } @@ -474,9 +517,9 @@ impl VersionedMpcContract { #[private] pub fn sign_helper( &mut self, - request: SignRequest, + request: SignatureRequest, depth: usize, - ) -> PromiseOrValue { + ) -> PromiseOrValue { if let Some(signature) = self.sign_result(&request) { match signature { Some(signature) => { @@ -522,9 +565,9 @@ impl VersionedMpcContract { env::panic_str(&message); } - pub fn state(self) -> ProtocolContractState { + pub fn state(&self) -> &ProtocolContractState { match self { - Self::V0(mpc_contract) => mpc_contract.protocol_state, + Self::V0(mpc_contract) => &mpc_contract.protocol_state, } } @@ -543,7 +586,7 @@ impl VersionedMpcContract { } #[private] - pub fn clean_payloads(&mut self, requests: Vec, counter: u32) { + pub fn clean_payloads(&mut self, requests: Vec, counter: u32) { match self { Self::V0(mpc_contract) => { mpc_contract.clean_payloads(requests, counter); @@ -561,12 +604,8 @@ impl VersionedMpcContract { request_counter: old_contract.request_counter, }) } -} -// Helper functions -#[near_bindgen] -impl VersionedMpcContract { - fn remove_sign_request(&mut self, request: &SignRequest) { + fn remove_sign_request(&mut self, request: &SignatureRequest) { match self { Self::V0(mpc_contract) => { mpc_contract.remove_request(request); @@ -574,18 +613,18 @@ impl VersionedMpcContract { } } - fn add_sign_request(&mut self, request: &SignRequest, sign_result: &Option) { + fn add_sign_request(&mut self, request: &SignatureRequest) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_request(request, sign_result); + mpc_contract.add_request(request, &None); } } } - fn add_sign_result(&mut self, request: &SignRequest, sign_result: SignResult) { + fn add_sign_result(&mut self, request: &SignatureRequest, response: SignatureResponse) { match self { Self::V0(mpc_contract) => { - mpc_contract.add_sig_result(request, sign_result); + mpc_contract.add_sign_result(request, response); } } } @@ -596,9 +635,15 @@ impl VersionedMpcContract { } } - fn sign_result(&self, request: &SignRequest) -> Option> { + fn sign_result(&self, request: &SignatureRequest) -> Option> { match self { Self::V0(mpc_contract) => mpc_contract.pending_requests.get(request), } } + + // fn public_key(&self) -> String { + // match self { + // Self::V0(mpc_contract) => mpc_contract + // } + // } } diff --git a/crypto-shared/Cargo.lock b/crypto-shared/Cargo.lock new file mode 100644 index 000000000..f52bc56f3 --- /dev/null +++ b/crypto-shared/Cargo.lock @@ -0,0 +1,776 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "syn_derive", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-shared" +version = "0.0.0" +dependencies = [ + "anyhow", + "borsh", + "getrandom", + "k256", + "near-account-id", + "near-sdk", + "serde", + "serde_json", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2", + "signature", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "near-account-id" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35cbb989542587b47205e608324ddd391f0cee1c22b4b64ae49f458334b95907" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "near-gas" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e75c875026229902d065e4435804497337b631ec69ba746b102954273e9ad1" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "near-sdk" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520234cfdf04a805ac2f04715889d096eb83fdd5b99ca7d0f8027ae473f891a8" +dependencies = [ + "base64", + "borsh", + "bs58", + "near-account-id", + "near-gas", + "near-sdk-macros", + "near-sys", + "near-token", + "once_cell", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "near-sdk-macros" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2fe3fc30068c5f20e89b0985d6104c5cc1c6742dbc6efbf352be4189b9bbf7" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "serde", + "serde_json", + "strum", + "strum_macros", + "syn", +] + +[[package]] +name = "near-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" + +[[package]] +name = "near-token" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b68f3f8a2409f72b43efdbeff8e820b81e70824c49fee8572979d789d1683fb" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/crypto-shared/Cargo.toml b/crypto-shared/Cargo.toml new file mode 100644 index 000000000..3c5ce986c --- /dev/null +++ b/crypto-shared/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "crypto-shared" +edition = "2021" + +[dependencies] +k256 = { version = "0.13.1", features = ["sha256", "ecdsa", "serde", "arithmetic", "expose-field"] } +anyhow = "1" +serde = "1" +borsh = "1.3.0" +near-account-id = "1" +serde_json = "1" +near-sdk = {version = "=5.1.0", features = ["unstable"]} + +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2.12", features = ["custom"] } + +[dev-dependencies] diff --git a/crypto-shared/src/kdf.rs b/crypto-shared/src/kdf.rs new file mode 100644 index 000000000..0df5adefc --- /dev/null +++ b/crypto-shared/src/kdf.rs @@ -0,0 +1,89 @@ +use crate::types::{PublicKey, ScalarExt}; +use anyhow::Context; +use k256::{ + ecdsa::{RecoveryId, Signature, VerifyingKey}, + elliptic_curve::{point::AffineCoordinates, sec1::ToEncodedPoint, CurveArithmetic}, + sha2::{Digest, Sha256}, + Scalar, Secp256k1, +}; +use near_account_id::AccountId; + +// Constant prefix that ensures epsilon derivation values are used specifically for +// near-mpc-recovery with key derivation protocol vX.Y.Z. +const EPSILON_DERIVATION_PREFIX: &str = "near-mpc-recovery v0.1.0 epsilon derivation:"; + +pub fn derive_epsilon(predecessor_id: &AccountId, path: &str) -> Scalar { + // TODO: Use a key derivation library instead of doing this manually. + // https://crates.io/crates/hkdf might be a good option? + // + // ',' is ACCOUNT_DATA_SEPARATOR from nearcore that indicate the end + // of the accound id in the trie key. We reuse the same constant to + // indicate the end of the account id in derivation path. + let derivation_path = format!("{EPSILON_DERIVATION_PREFIX}{},{}", predecessor_id, path); + let mut hasher = Sha256::new(); + hasher.update(derivation_path); + let mut bytes = hasher.finalize(); + // Due to a previous bug in our Scalar conversion code, this hash was reversed, we reverse it here to preserve compatibility, but will likely change this later. + bytes.reverse(); + Scalar::from_bytes(&bytes) +} + +pub fn derive_key(public_key: PublicKey, epsilon: Scalar) -> PublicKey { + (::ProjectivePoint::GENERATOR * epsilon + public_key).to_affine() +} + +/// Get the x coordinate of a point, as a scalar +pub fn x_coordinate( + point: &::AffinePoint, +) -> ::Scalar { + <::Scalar as k256::elliptic_curve::ops::Reduce< + ::Uint, + >>::reduce_bytes(&point.x()) +} + +pub fn check_ec_signature( + expected_pk: &k256::AffinePoint, + big_r: &k256::AffinePoint, + s: &k256::Scalar, + msg_hash: Scalar, + recovery_id: u8, +) -> anyhow::Result<()> { + let public_key = expected_pk.to_encoded_point(false); + let signature = k256::ecdsa::Signature::from_scalars(x_coordinate(big_r), s) + .context("cannot create signature from cait_sith signature")?; + let found_pk = recover( + &msg_hash.to_bytes(), + &signature, + RecoveryId::try_from(recovery_id).context("invalid recovery ID")?, + )? + .to_encoded_point(false); + if public_key == found_pk { + return Ok(()); + } + + anyhow::bail!("cannot use either recovery id (0 or 1) to recover pubic key") +} + +// #[cfg(not(target_arch = "wasm32"))] +fn recover( + prehash: &[u8], + signature: &Signature, + recovery_id: RecoveryId, +) -> anyhow::Result { + VerifyingKey::recover_from_prehash(prehash, signature, recovery_id) + .context("Unable to recover public key") +} + +// TODO Migrate to native function +// #[cfg(target_arch = "wasm32")] +// fn recover( +// prehash: &[u8], +// signature: &Signature, +// recovery_id: RecoveryId, +// ) -> anyhow::Result { +// use near_sdk::env; +// let recovered_key = +// env::ecrecover(prehash, &signature.to_bytes(), recovery_id.to_byte(), false) +// .context("Unable to recover public key")?; +// VerifyingKey::try_from(&recovered_key[..]).context("Failed to parse returned key") +// } diff --git a/crypto-shared/src/lib.rs b/crypto-shared/src/lib.rs new file mode 100644 index 000000000..763cba839 --- /dev/null +++ b/crypto-shared/src/lib.rs @@ -0,0 +1,28 @@ +pub mod kdf; +pub mod types; + +use k256::elliptic_curve::sec1::FromEncodedPoint; +use k256::EncodedPoint; +pub use kdf::{derive_epsilon, derive_key, x_coordinate}; +pub use types::{ + PublicKey, ScalarExt, SerializableAffinePoint, SerializableScalar, SignatureResponse, +}; + +// Our wasm runtime doesn't support good syncronous entropy. +// We could use something VRF + pseudorandom here, but someone would likely shoot themselves in the foot with it. +// Our crypto libraries should definately panic, because they normally expect randomness to be private +#[cfg(target_arch = "wasm32")] +use getrandom::{register_custom_getrandom, Error}; +#[cfg(target_arch = "wasm32")] +pub fn randomness_unsupported(_: &mut [u8]) -> Result<(), Error> { + Err(Error::UNSUPPORTED) +} +#[cfg(target_arch = "wasm32")] +register_custom_getrandom!(randomness_unsupported); + +pub fn near_public_key_to_affine_point(pk: near_sdk::PublicKey) -> PublicKey { + let mut bytes = pk.into_bytes(); + bytes[0] = 0x04; + let point = EncodedPoint::from_bytes(bytes).unwrap(); + PublicKey::from_encoded_point(&point).unwrap() +} diff --git a/crypto-shared/src/types.rs b/crypto-shared/src/types.rs new file mode 100644 index 000000000..639a83767 --- /dev/null +++ b/crypto-shared/src/types.rs @@ -0,0 +1,109 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use k256::{ + elliptic_curve::{scalar::FromUintUnchecked, CurveArithmetic}, + AffinePoint, Scalar, Secp256k1, U256, +}; +use serde::{Deserialize, Serialize}; + +pub type PublicKey = ::AffinePoint; + +pub trait ScalarExt { + fn from_bytes(bytes: &[u8]) -> Self; +} + +// TODO prevent bad scalars from beind sent +impl ScalarExt for Scalar { + fn from_bytes(bytes: &[u8]) -> Self { + Scalar::from_uint_unchecked(U256::from_be_slice(bytes)) + } +} + +// Is there a better way to force a borsh serialization? +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)] +pub struct SerializableScalar { + pub scalar: Scalar, +} + +impl BorshSerialize for SerializableScalar { + fn serialize(&self, writer: &mut W) -> std::io::Result<()> { + let to_ser: [u8; 32] = self.scalar.to_bytes().into(); + BorshSerialize::serialize(&to_ser, writer) + } +} + +impl BorshDeserialize for SerializableScalar { + fn deserialize_reader(reader: &mut R) -> std::io::Result { + let from_ser: [u8; 32] = BorshDeserialize::deserialize_reader(reader)?; + let scalar = Scalar::from_bytes(&from_ser[..]); + Ok(SerializableScalar { scalar }) + } +} + +// Is there a better way to force a borsh serialization? +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)] +pub struct SerializableAffinePoint { + pub affine_point: AffinePoint, +} + +impl BorshSerialize for SerializableAffinePoint { + fn serialize(&self, writer: &mut W) -> std::io::Result<()> { + let to_ser: Vec = serde_json::to_vec(&self.affine_point)?; + BorshSerialize::serialize(&to_ser, writer) + } +} + +impl BorshDeserialize for SerializableAffinePoint { + fn deserialize_reader(reader: &mut R) -> std::io::Result { + let from_ser: Vec = BorshDeserialize::deserialize_reader(reader)?; + let affine_point = serde_json::from_slice(&from_ser)?; + Ok(SerializableAffinePoint { affine_point }) + } +} + +#[test] +fn serializeable_scalar_roundtrip() { + use k256::elliptic_curve::PrimeField; + let test_vec = vec![ + Scalar::ZERO, + Scalar::ONE, + Scalar::from_u128(u128::MAX), + Scalar::from_bytes(&[3; 32]), + ]; + + for scalar in test_vec.into_iter() { + let input = SerializableScalar { scalar }; + // Test borsh + { + let serialized = borsh::to_vec(&input).unwrap(); + let output: SerializableScalar = borsh::from_slice(&serialized).unwrap(); + assert_eq!(input, output, "Failed on {:?}", scalar); + } + + dbg!(scalar); + // Test Serde via JSON + { + let serialized = serde_json::to_vec(&input).unwrap(); + let output: SerializableScalar = serde_json::from_slice(&serialized).unwrap(); + assert_eq!(input, output, "Failed on {:?}", scalar); + } + } +} + +#[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize, Debug, Clone)] +pub struct SignatureResponse { + pub big_r: SerializableAffinePoint, + pub s: SerializableScalar, + pub recovery_id: u8, +} + +impl SignatureResponse { + pub fn new(big_r: AffinePoint, s: Scalar, recovery_id: u8) -> Self { + SignatureResponse { + big_r: SerializableAffinePoint { + affine_point: big_r, + }, + s: SerializableScalar { scalar: s }, + recovery_id, + } + } +} diff --git a/integration-tests/chain-signatures/Cargo.lock b/integration-tests/chain-signatures/Cargo.lock index b2ba33e32..66809537c 100644 --- a/integration-tests/chain-signatures/Cargo.lock +++ b/integration-tests/chain-signatures/Cargo.lock @@ -2084,6 +2084,20 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-shared" +version = "0.0.0" +dependencies = [ + "anyhow", + "borsh 1.5.0", + "getrandom 0.2.15", + "k256", + "near-account-id", + "near-sdk", + "serde", + "serde_json", +] + [[package]] name = "csv" version = "1.3.0" @@ -3964,6 +3978,7 @@ dependencies = [ "backon", "bollard", "cait-sith", + "crypto-shared", "ecdsa 0.16.9", "elliptic-curve 0.13.8", "ethers-core", @@ -4548,6 +4563,8 @@ name = "mpc-contract" version = "0.2.0" dependencies = [ "borsh 1.5.0", + "crypto-shared", + "k256", "near-sdk", "schemars", "serde", @@ -4578,6 +4595,7 @@ dependencies = [ "cait-sith", "chrono", "clap", + "crypto-shared", "google-datastore1", "google-secretmanager1", "hex 0.4.3", diff --git a/integration-tests/chain-signatures/Cargo.toml b/integration-tests/chain-signatures/Cargo.toml index 3efcc0dcd..862046afb 100644 --- a/integration-tests/chain-signatures/Cargo.toml +++ b/integration-tests/chain-signatures/Cargo.toml @@ -22,6 +22,7 @@ testcontainers = { version = "0.15", features = ["experimental"] } tokio = { version = "1.28", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } +crypto-shared = { path = "../../crypto-shared" } # crypto dependencies cait-sith = { git = "https://github.com/LIT-Protocol/cait-sith.git", features = [ diff --git a/integration-tests/chain-signatures/tests/actions/mod.rs b/integration-tests/chain-signatures/tests/actions/mod.rs index 4fea333e3..f7e56c023 100644 --- a/integration-tests/chain-signatures/tests/actions/mod.rs +++ b/integration-tests/chain-signatures/tests/actions/mod.rs @@ -3,18 +3,20 @@ pub mod wait_for; use crate::MultichainTestContext; use cait_sith::FullSignature; +use crypto_shared::ScalarExt; +use crypto_shared::SerializableAffinePoint; +use crypto_shared::{derive_epsilon, derive_key, SerializableScalar, SignatureResponse}; use elliptic_curve::sec1::ToEncodedPoint; use k256::ecdsa::VerifyingKey; use k256::elliptic_curve::ops::{Invert, Reduce}; use k256::elliptic_curve::point::AffineCoordinates; -use k256::elliptic_curve::scalar::FromUintUnchecked; use k256::elliptic_curve::sec1::FromEncodedPoint; use k256::elliptic_curve::ProjectivePoint; use k256::{AffinePoint, EncodedPoint, Scalar, Secp256k1}; use mpc_contract::primitives::SignRequest; use mpc_contract::RunningContractState; -use mpc_recovery_node::kdf; -use mpc_recovery_node::util::ScalarExt; +use mpc_contract::SignatureRequest; +use mpc_recovery_node::kdf::into_eth_sig; use near_crypto::InMemorySigner; use near_jsonrpc_client::methods::broadcast_tx_async::RpcBroadcastTxAsyncRequest; use near_lake_primitives::CryptoHash; @@ -88,12 +90,39 @@ pub async fn assert_signature( ) { let mpc_point = EncodedPoint::from_bytes(mpc_pk_bytes).unwrap(); let mpc_pk = AffinePoint::from_encoded_point(&mpc_point).unwrap(); - let epsilon = kdf::derive_epsilon(account_id, "test"); - let user_pk = kdf::derive_key(mpc_pk, epsilon); + let epsilon = derive_epsilon(account_id, "test"); + let user_pk = derive_key(mpc_pk, epsilon); assert!(signature.verify(&user_pk, &Scalar::from_bytes(payload),)); } +// A normal signature, but we try to insert a bad response which fails and the signature is generated +pub async fn single_signature_rogue_responder( + ctx: &MultichainTestContext<'_>, + state: &RunningContractState, +) -> anyhow::Result<()> { + let (_, payload_hash, account, tx_hash) = request_sign(ctx).await?; + + // We have to use seperate transactions because one could fail. + // This leads to a potential race condition where this transaction could get sent after the signature completes, but I think that's unlikely + let rogue_hash = rogue_respond(ctx, payload_hash, account.id(), "test").await?; + + let err = wait_for::rogue_message_responded(ctx, rogue_hash).await?; + + assert_eq!( + err, + "Smart contract panicked: Signature could not be verified".to_string() + ); + + let signature = wait_for::signature_responded(ctx, tx_hash).await?; + + let mut mpc_pk_bytes = vec![0x04]; + mpc_pk_bytes.extend_from_slice(&state.public_key.as_bytes()[1..]); + assert_signature(account.id(), &mpc_pk_bytes, &payload_hash, &signature).await; + + Ok(()) +} + pub async fn single_signature_production( ctx: &MultichainTestContext<'_>, state: &RunningContractState, @@ -108,6 +137,74 @@ pub async fn single_signature_production( Ok(()) } +pub async fn rogue_respond( + ctx: &MultichainTestContext<'_>, + payload_hash: [u8; 32], + predecessor: &near_workspaces::AccountId, + path: &str, +) -> anyhow::Result { + let worker = &ctx.nodes.ctx().worker; + let account = worker.dev_create_account().await?; + + let signer = InMemorySigner { + account_id: account.id().clone(), + public_key: account.secret_key().public_key().clone().into(), + secret_key: account.secret_key().to_string().parse()?, + }; + let (nonce, block_hash, _) = ctx + .rpc_client + .fetch_nonce(&signer.account_id, &signer.public_key) + .await?; + let epsilon = derive_epsilon(predecessor, path); + + let request = SignatureRequest { + payload_hash, + epsilon: SerializableScalar { scalar: epsilon }, + }; + + let big_r = serde_json::from_value( + "02EC7FA686BB430A4B700BDA07F2E07D6333D9E33AEEF270334EB2D00D0A6FEC6C".into(), + )?; // Fake BigR + let s = serde_json::from_value( + "20F90C540EE00133C911EA2A9ADE2ABBCC7AD820687F75E011DFEEC94DB10CD6".into(), + )?; // Fake S + + let response = SignatureResponse { + big_r: SerializableAffinePoint { + affine_point: big_r, + }, + s: SerializableScalar { scalar: s }, + recovery_id: 0, + }; + + let json = &serde_json::json!({ + "request": request, + "response": response, + }); + let hash = ctx + .jsonrpc_client + .call(&RpcBroadcastTxAsyncRequest { + signed_transaction: Transaction { + nonce, + block_hash, + signer_id: signer.account_id.clone(), + public_key: signer.public_key.clone(), + receiver_id: ctx.nodes.ctx().mpc_contract.id().clone(), + actions: vec![Action::FunctionCall(Box::new(FunctionCallAction { + method_name: "respond".to_string(), + args: serde_json::to_vec(json)?, + gas: 300_000_000_000_000, + deposit: 0, + }))], + } + .sign(&signer), + }) + .await?; + + tokio::time::sleep(Duration::from_secs(1)).await; + Ok(hash) +} + pub async fn request_sign_non_random( ctx: &MultichainTestContext<'_>, account: Account, @@ -176,38 +273,42 @@ pub async fn single_payload_signature_production( Ok(()) } +// This code was and still is a bit of a mess. +// Previously converting a Scalar to bytes reversed the bytes and converted to a Scalar. +// The big_r and s values were generated using chain signatures from an older commit, therefore the signature is generated against a reversed hash. +// This shows that the old signatures will verify against a reversed payload #[tokio::test] -async fn test_proposition() { +async fn test_old_signatures_verify() { + use k256::sha2::{Digest, Sha256}; let big_r = "044bf886afee5a6844a25fa6831a01715e990d3d9e96b792a9da91cfbecbf8477cea57097a3db9fc1d4822afade3d1c4e6d66e99568147304ae34bcfa609d90a16"; let s = "1f871c67139f617409067ac8a7150481e3a5e2d8a9207ffdaad82098654e95cb"; let mpc_key = "02F2B55346FD5E4BFF1F06522561BDCD024CEA25D98A091197ACC04E22B3004DB2"; + let account_id = "acc_mc.test.near"; - // Create payload let mut payload = [0u8; 32]; for (i, item) in payload.iter_mut().enumerate() { *item = i as u8; } - // TODO: get hashed values on the flight - let payload_hash: [u8; 32] = [ - 99, 13, 205, 41, 102, 196, 51, 102, 145, 18, 84, 72, 187, 178, 91, 79, 244, 18, 164, 156, - 115, 45, 178, 200, 171, 193, 184, 88, 27, 215, 16, 221, - ]; - let payload_hash_scalar = k256::Scalar::from_bytes(&payload_hash); // TODO: why do we need both reversed and not reversed versions? - let mut payload_hash_reversed: [u8; 32] = payload_hash; - payload_hash_reversed.reverse(); + let mut hasher = Sha256::new(); + hasher.update(payload); + + let mut payload_hash: [u8; 32] = hasher.finalize().into(); + payload_hash.reverse(); + + let payload_hash_scalar = Scalar::from_bytes(&payload_hash); println!("payload_hash: {payload_hash:?}"); println!("payload_hash_scallar: {payload_hash_scalar:#?}"); - println!("payload_hash_reversed: {payload_hash_reversed:?}"); // Derive and convert user pk let mpc_pk = hex::decode(mpc_key).unwrap(); let mpc_pk = EncodedPoint::from_bytes(mpc_pk).unwrap(); let mpc_pk = AffinePoint::from_encoded_point(&mpc_pk).unwrap(); - let account_id = "acc_mc.test.near".parse().unwrap(); - let derivation_epsilon: k256::Scalar = kdf::derive_epsilon(&account_id, "test"); - let user_pk: AffinePoint = kdf::derive_key(mpc_pk, derivation_epsilon); + + let account_id = account_id.parse().unwrap(); + let derivation_epsilon: k256::Scalar = derive_epsilon(&account_id, "test"); + let user_pk: AffinePoint = derive_key(mpc_pk, derivation_epsilon); let user_pk_y_parity = match user_pk.y_is_odd().unwrap_u8() { 0 => secp256k1::Parity::Even, 1 => secp256k1::Parity::Odd, @@ -227,22 +328,30 @@ async fn test_proposition() { assert!(big_r_y_parity == 0 || big_r_y_parity == 1); let s = hex::decode(s).unwrap(); - let s = k256::Scalar::from_uint_unchecked(k256::U256::from_be_slice(s.as_slice())); + let s = k256::Scalar::from_bytes(s.as_slice()); let r = x_coordinate::(&big_r); let signature = cait_sith::FullSignature:: { big_r, s }; - let multichain_sig = kdf::into_eth_sig(&user_pk, &signature, payload_hash_scalar).unwrap(); - println!("{multichain_sig:#?}"); println!("R: {big_r:#?}"); println!("r: {r:#?}"); println!("y parity: {}", big_r_y_parity); println!("s: {s:#?}"); + println!("epsilon: {derivation_epsilon:#?}"); + + let multichain_sig = into_eth_sig( + &user_pk, + &signature.big_r, + &signature.s, + payload_hash_scalar, + ) + .unwrap(); + println!("{multichain_sig:#?}"); // Check signature using cait-sith tooling let is_signature_valid_for_user_pk = signature.verify(&user_pk, &payload_hash_scalar); let is_signature_valid_for_mpc_pk = signature.verify(&mpc_pk, &payload_hash_scalar); - let another_user_pk = kdf::derive_key(mpc_pk, derivation_epsilon + k256::Scalar::ONE); + let another_user_pk = derive_key(mpc_pk, derivation_epsilon + k256::Scalar::ONE); let is_signature_valid_for_another_user_pk = signature.verify(&another_user_pk, &payload_hash_scalar); assert!(is_signature_valid_for_user_pk); @@ -256,7 +365,7 @@ async fn test_proposition() { let ecdsa_local_verify_result = verify( &k256::ecdsa::VerifyingKey::from(&user_pk_k256), - &payload_hash_reversed, + &payload_hash, &k256_sig, ); assert!(ecdsa_local_verify_result.is_ok()); @@ -289,9 +398,7 @@ async fn test_proposition() { let user_address_ethers: ethers_core::types::H160 = ethers_core::utils::public_key_to_address(&verifying_user_pk); - assert!(signature - .verify(payload_hash_reversed, user_address_ethers) - .is_ok()); + assert!(signature.verify(payload_hash, user_address_ethers).is_ok()); // Check if recovered address is the same as the user address let signature_for_recovery: [u8; 64] = { @@ -302,21 +409,20 @@ async fn test_proposition() { }; let recovered_from_signature_address_web3 = web3::signing::recover( - &payload_hash_reversed, + &payload_hash, &signature_for_recovery, multichain_sig.recovery_id as i32, ) .unwrap(); assert_eq!(user_address_from_pk, recovered_from_signature_address_web3); - let recovered_from_signature_address_ethers = signature.recover(payload_hash_reversed).unwrap(); + let recovered_from_signature_address_ethers = signature.recover(payload_hash).unwrap(); assert_eq!( user_address_from_pk, recovered_from_signature_address_ethers ); - let recovered_from_signature_address_local_function = - recover(signature, payload_hash_reversed).unwrap(); + let recovered_from_signature_address_local_function = recover(signature, payload_hash).unwrap(); assert_eq!( user_address_from_pk, recovered_from_signature_address_local_function diff --git a/integration-tests/chain-signatures/tests/actions/wait_for.rs b/integration-tests/chain-signatures/tests/actions/wait_for.rs index 8c03009c9..72e2efc74 100644 --- a/integration-tests/chain-signatures/tests/actions/wait_for.rs +++ b/integration-tests/chain-signatures/tests/actions/wait_for.rs @@ -5,8 +5,7 @@ use anyhow::Context; use backon::ExponentialBuilder; use backon::Retryable; use cait_sith::FullSignature; -use k256::AffinePoint; -use k256::Scalar; +use crypto_shared::SignatureResponse; use k256::Secp256k1; use mpc_contract::ProtocolContractState; use mpc_contract::RunningContractState; @@ -14,10 +13,9 @@ use mpc_recovery_node::web::StateView; use near_jsonrpc_client::methods::tx::RpcTransactionStatusRequest; use near_jsonrpc_client::methods::tx::TransactionInfo; use near_lake_primitives::CryptoHash; +use near_primitives::errors::ActionErrorKind; use near_primitives::views::FinalExecutionStatus; use near_workspaces::Account; -use serde::Deserialize; -use serde::Serialize; pub async fn running_mpc<'a>( ctx: &MultichainTestContext<'a>, @@ -205,13 +203,6 @@ pub async fn has_at_least_mine_presignatures<'a>( Ok(state_views) } -// TODO: use structure from contract when the internal types are the same -#[derive(Serialize, Deserialize, Debug)] -pub struct SignResult { - pub big_r: AffinePoint, - pub s: Scalar, -} - pub async fn signature_responded( ctx: &MultichainTestContext<'_>, tx_hash: CryptoHash, @@ -240,10 +231,10 @@ pub async fn signature_responded( anyhow::bail!("tx finished unsuccessfully: {:?}", outcome.status); }; - let result: SignResult = serde_json::from_slice(&payload)?; + let result: SignatureResponse = serde_json::from_slice(&payload)?; let signature = cait_sith::FullSignature:: { - big_r: result.big_r, - s: result.s, + big_r: result.big_r.affine_point, + s: result.s.scalar, }; Ok(signature) @@ -274,3 +265,52 @@ pub async fn signature_payload_responded( .with_context(|| "failed to wait for signature response")?; Ok(signature) } + +// Check that the rogue message failed +pub async fn rogue_message_responded( + ctx: &MultichainTestContext<'_>, + tx_hash: CryptoHash, +) -> anyhow::Result { + let is_tx_ready = || async { + let outcome_view = ctx + .jsonrpc_client + .call(RpcTransactionStatusRequest { + transaction_info: TransactionInfo::TransactionId { + tx_hash, + sender_account_id: ctx.nodes.ctx().mpc_contract.id().clone(), + }, + wait_until: near_primitives::views::TxExecutionStatus::Final, + }) + .await?; + + let Some(outcome) = outcome_view.final_execution_outcome else { + anyhow::bail!("final execution outcome not available"); + }; + let outcome = outcome.into_outcome(); + + let FinalExecutionStatus::Failure(ref failure) = outcome.status else { + anyhow::bail!("tx finished successfully: {:?}", outcome.status); + }; + + use near_primitives::errors::TxExecutionError; + let TxExecutionError::ActionError(action_err) = failure else { + anyhow::bail!("invalid transaction: {:?}", outcome.status); + }; + + let ActionErrorKind::FunctionCallError(ref err) = action_err.kind else { + anyhow::bail!("Not a function call error {:?}", outcome.status); + }; + use near_primitives::errors::FunctionCallError; + let FunctionCallError::ExecutionError(err_msg) = err else { + anyhow::bail!("Wrong error type: {:?}", err); + }; + Ok(err_msg.clone()) + }; + + let signature = is_tx_ready + .retry(&ExponentialBuilder::default().with_max_times(6)) + .await + .with_context(|| "failed to wait for rogue message response")?; + + Ok(signature.clone()) +} diff --git a/integration-tests/chain-signatures/tests/cases/mod.rs b/integration-tests/chain-signatures/tests/cases/mod.rs index fe78b4f32..2b03dfecf 100644 --- a/integration-tests/chain-signatures/tests/cases/mod.rs +++ b/integration-tests/chain-signatures/tests/cases/mod.rs @@ -3,15 +3,16 @@ use std::str::FromStr; use crate::actions::{self, wait_for}; use crate::with_multichain_nodes; +use crypto_shared::{self, derive_epsilon, derive_key, x_coordinate, ScalarExt}; use integration_tests_chain_signatures::containers::{self, DockerClient}; use integration_tests_chain_signatures::MultichainConfig; use k256::elliptic_curve::point::AffineCoordinates; -use mpc_recovery_node::kdf::{self, x_coordinate}; +use mpc_recovery_node::kdf::into_eth_sig; use mpc_recovery_node::protocol::presignature::PresignatureConfig; use mpc_recovery_node::protocol::triple::TripleConfig; use mpc_recovery_node::test_utils; use mpc_recovery_node::types::LatestBlockHeight; -use mpc_recovery_node::util::{NearPublicKeyExt, ScalarExt}; +use mpc_recovery_node::util::NearPublicKeyExt; use test_log::test; #[test(tokio::test)] @@ -59,7 +60,7 @@ async fn test_signature_basic() -> anyhow::Result<()> { assert_eq!(state_0.participants.len(), 3); wait_for::has_at_least_triples(&ctx, 2).await?; wait_for::has_at_least_presignatures(&ctx, 2).await?; - actions::single_signature_production(&ctx, &state_0).await + actions::single_signature_rogue_responder(&ctx, &state_0).await }) }) .await @@ -163,22 +164,21 @@ async fn test_key_derivation() -> anyhow::Result<()> { for _ in 0..3 { let mpc_pk: k256::AffinePoint = state_0.public_key.clone().into_affine_point(); let (_, payload_hashed, account, tx_hash) = actions::request_sign(&ctx).await?; - let payload_hashed_rev = { - let mut rev = payload_hashed; - rev.reverse(); - rev - }; let sig = wait_for::signature_responded(&ctx, tx_hash).await?; let hd_path = "test"; - let derivation_epsilon = kdf::derive_epsilon(account.id(), hd_path); - let user_pk = kdf::derive_key(mpc_pk, derivation_epsilon); - let multichain_sig = - kdf::into_eth_sig(&user_pk, &sig, k256::Scalar::from_bytes(&payload_hashed)) - .unwrap(); + let derivation_epsilon = derive_epsilon(account.id(), hd_path); + let user_pk = derive_key(mpc_pk, derivation_epsilon); + let multichain_sig = into_eth_sig( + &user_pk, + &sig.big_r, + &sig.s, + k256::Scalar::from_bytes(&payload_hashed), + ) + .unwrap(); // start recovering the address and compare them: - let user_pk_x = kdf::x_coordinate::(&user_pk); + let user_pk_x = x_coordinate(&user_pk); let user_pk_y_parity = match user_pk.y_is_odd().unwrap_u8() { 1 => secp256k1::Parity::Odd, 0 => secp256k1::Parity::Even, @@ -189,16 +189,16 @@ async fn test_key_derivation() -> anyhow::Result<()> { let user_secp_pk = secp256k1::PublicKey::from_x_only_public_key(user_pk_x, user_pk_y_parity); let user_addr = actions::public_key_to_address(&user_secp_pk); - let r = x_coordinate::(&multichain_sig.big_r); + let r = x_coordinate(&multichain_sig.big_r.affine_point); let s = multichain_sig.s; let signature_for_recovery: [u8; 64] = { let mut signature = [0u8; 64]; signature[..32].copy_from_slice(&r.to_bytes()); - signature[32..].copy_from_slice(&s.to_bytes()); + signature[32..].copy_from_slice(&s.scalar.to_bytes()); signature }; let recovered_addr = web3::signing::recover( - &payload_hashed_rev, + &payload_hashed, &signature_for_recovery, multichain_sig.recovery_id as i32, ) diff --git a/load-tests/Cargo.lock b/load-tests/Cargo.lock index ccf543eca..ea7cfcf5e 100644 --- a/load-tests/Cargo.lock +++ b/load-tests/Cargo.lock @@ -14,14 +14,14 @@ dependencies = [ [[package]] name = "actix" -version = "0.13.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb72882332b6d6282f428b77ba0358cb2687e61a6f6df6a6d3871e8a177c2d4f" +checksum = "cba56612922b907719d4a01cf11c8d5b458e7d3dba946d0435f20f58d6795ed2" dependencies = [ "actix-macros", "actix-rt", "actix_derive", - "bitflags 2.5.0", + "bitflags 2.4.2", "bytes", "crossbeam-channel", "futures-core", @@ -30,11 +30,11 @@ dependencies = [ "futures-util", "log", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "pin-project-lite", "smallvec", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", ] [[package]] @@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -66,7 +66,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -103,14 +103,14 @@ dependencies = [ "cfg-if 1.0.0", "cipher 0.3.0", "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] name = "aes" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if 1.0.0", "cipher 0.4.4", @@ -124,7 +124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", - "aes 0.8.4", + "aes 0.8.3", "cipher 0.4.4", "ctr", "ghash", @@ -133,20 +133,20 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.8" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -180,48 +180,47 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "628a8f9bd1e24b4e0db2b4bc2d000b001e7dd032d54afa60a68836aeec5aa54a" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -229,9 +228,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arbitrary" @@ -278,21 +277,22 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.3.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener 4.0.3", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-compression" -version = "0.4.10" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "flate2", "futures-core", @@ -303,14 +303,15 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.11.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ + "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", + "fastrand 2.0.1", + "futures-lite 2.2.0", "slab", ] @@ -321,7 +322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" dependencies = [ "async-lock 2.8.0", - "autocfg 1.3.0", + "autocfg 1.1.0", "blocking", "futures-lite 1.13.0", ] @@ -333,7 +334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock 2.8.0", - "autocfg 1.3.0", + "autocfg 1.1.0", "cfg-if 1.0.0", "concurrent-queue", "futures-lite 1.13.0", @@ -348,18 +349,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ "async-lock 3.3.0", "cfg-if 1.0.0", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.2.0", "parking", - "polling 3.7.0", - "rustix 0.38.34", + "polling 3.3.2", + "rustix 0.38.30", "slab", "tracing", "windows-sys 0.52.0", @@ -381,7 +382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener-strategy", "pin-project-lite", ] @@ -398,7 +399,7 @@ dependencies = [ "cfg-if 1.0.0", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.34", + "rustix 0.38.30", "windows-sys 0.48.0", ] @@ -410,25 +411,25 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.0", + "async-lock 2.8.0", "atomic-waker", "cfg-if 1.0.0", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix 0.38.30", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -450,24 +451,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "async-task" -version = "4.7.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -493,14 +494,14 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" @@ -592,9 +593,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -617,12 +618,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64ct" version = "1.6.0" @@ -663,8 +658,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", + "rand 0.6.5", + "rand_core 0.4.2", "serde", "unicode-normalization", ] @@ -683,9 +678,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -707,7 +702,7 @@ checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ "crypto-mac 0.8.0", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -783,16 +778,18 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.6.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ "async-channel", "async-lock 3.3.0", "async-task", + "fastrand 2.0.1", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.2.0", "piper", + "tracing", ] [[package]] @@ -817,11 +814,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ - "borsh-derive 1.5.0", + "borsh-derive 1.3.1", "cfg_aliases", ] @@ -853,15 +850,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" dependencies = [ "once_cell", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", "syn_derive", ] @@ -926,18 +923,18 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bs58" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ "tinyvec", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -981,9 +978,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" @@ -1027,9 +1024,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.7" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] @@ -1072,9 +1069,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -1109,20 +1106,19 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.21", "serde", "serde_json", ] [[package]] name = "cc" -version = "1.0.98" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -1145,9 +1141,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1155,7 +1151,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] @@ -1188,9 +1184,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -1198,9 +1194,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1210,21 +1206,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cloudabi" @@ -1264,9 +1260,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -1298,9 +1294,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -1331,9 +1327,9 @@ checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" [[package]] name = "cookie" -version = "0.17.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding 2.3.1", "time", @@ -1342,12 +1338,12 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.20.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" +checksum = "d606d0fba62e13cf04db20536c05cb7f13673c161cb47a47a82b9b9e7d3f1daa" dependencies = [ "cookie", - "idna 0.3.0", + "idna 0.2.3", "log", "publicsuffix", "serde", @@ -1414,7 +1410,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli 0.28.1", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "log", "regalloc2", "smallvec", @@ -1502,18 +1498,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ "crossbeam-utils", ] @@ -1539,9 +1535,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -1553,7 +1549,7 @@ dependencies = [ "crossterm_winapi", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "signal-hook", "signal-hook-mio", "winapi", @@ -1576,9 +1572,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.2.11" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" +checksum = "8658c15c5d921ddf980f7fe25b1e82f4b7a4083b2c4985fea4922edb8e43e07d" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1631,9 +1627,9 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", "subtle", @@ -1677,11 +1673,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.4" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" dependencies = [ - "nix 0.28.0", + "nix 0.27.1", "windows-sys 0.52.0", ] @@ -1734,9 +1730,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -1758,14 +1754,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "darling" -version = "0.20.9" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ "darling_core", "darling_macro", @@ -1773,34 +1769,34 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "debugid" @@ -1858,7 +1854,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1959,9 +1955,9 @@ checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" [[package]] name = "downcast-rs" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dunce" @@ -1971,9 +1967,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "dynasm" @@ -2088,11 +2084,11 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.1", "ed25519 2.2.3", "rand_core 0.6.4", "sha2 0.10.8", @@ -2101,9 +2097,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elementtree" @@ -2117,9 +2113,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.10.6" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b" +checksum = "83e5c176479da93a0983f0a6fdc3c1b8e7d5be0d7fe3fe05a99f15b96582b9a8" dependencies = [ "crypto-bigint", "ff", @@ -2139,9 +2135,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if 1.0.0", ] @@ -2163,7 +2159,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2184,7 +2180,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2205,7 +2201,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2240,9 +2236,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2330,17 +2326,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -2351,16 +2336,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.0", - "pin-project-lite", -] - [[package]] name = "eyre" version = "0.6.12" @@ -2400,9 +2375,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "ff" @@ -2442,9 +2417,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.9" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "filetime" @@ -2503,9 +2478,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -2640,11 +2615,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.0.1", "futures-core", "futures-io", "parking", @@ -2659,7 +2634,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2713,7 +2688,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "debugid 0.8.0", "fxhash", "serde", @@ -2752,9 +2727,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2765,11 +2740,11 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", "polyval", ] @@ -2790,7 +2765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.2.6", + "indexmap 2.1.0", "stable_deref_trait", ] @@ -2807,9 +2782,9 @@ dependencies = [ [[package]] name = "google-apis-common" -version = "6.0.3" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78672323eaeeb181cadd4d07333f1bcc8c2840a55b58afa8ab052664cd4a54ad" +checksum = "34c72c9baded4d06742eaaa5def6158f9e28d20a679ad1d5f5deb2bae8358052" dependencies = [ "base64 0.13.1", "chrono", @@ -2828,9 +2803,9 @@ dependencies = [ [[package]] name = "google-datastore1" -version = "5.0.4+20240226" +version = "5.0.3+20230118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d822056b35f25b564e77b0cfd9bdcbad8fc5c891bf079d61536572d67bfc8e3" +checksum = "198ee321ea936e9823c6db7dee338e96ee54543855af2f9d9a764ad9bbb9ecb3" dependencies = [ "anyhow", "google-apis-common", @@ -2848,9 +2823,9 @@ dependencies = [ [[package]] name = "google-secretmanager1" -version = "5.0.4+20240223" +version = "5.0.3+20230114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b806517ba1ad137eb05b445ae04343a7b6469e7167084ec4e3ae4e4ba4002f" +checksum = "8140bd21e98a11dd2056f5486654f39ad39b45fc4779aa5e145ff886c7fd41cf" dependencies = [ "anyhow", "google-apis-common", @@ -2956,10 +2931,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.1.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tracing", ] @@ -2969,7 +2944,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.8", + "ahash 0.7.7", ] [[package]] @@ -2978,7 +2953,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.8", + "ahash 0.7.7", ] [[package]] @@ -2987,16 +2962,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.7", ] [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.7", ] [[package]] @@ -3038,12 +3013,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hermit-abi" version = "0.1.19" @@ -3055,9 +3024,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -3099,7 +3068,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -3123,9 +3092,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -3184,7 +3153,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -3201,7 +3170,7 @@ dependencies = [ "http", "hyper", "log", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "tokio", "tokio-rustls", @@ -3234,9 +3203,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3272,6 +3241,17 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.3.0" @@ -3358,19 +3338,19 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "hashbrown 0.12.3", "serde", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "serde", ] @@ -3401,9 +3381,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] @@ -3437,7 +3417,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.4", "libc", "windows-sys 0.48.0", ] @@ -3459,12 +3439,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.9", - "libc", + "hermit-abi 0.3.4", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -3487,12 +3467,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" - [[package]] name = "itertools" version = "0.10.5" @@ -3511,17 +3485,26 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -3534,22 +3517,23 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] [[package]] name = "json-patch" -version = "1.4.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" dependencies = [ "serde", "serde_json", "thiserror", + "treediff", ] [[package]] @@ -3633,9 +3617,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -3649,12 +3633,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.3" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "libc", + "redox_syscall 0.4.1", ] [[package]] @@ -3672,10 +3657,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "761e49ec5fd8a5a463f9b84e877c373d888935b71c6be78f3767fe2ae6bed18e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -3684,9 +3675,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "load-tests" @@ -3724,19 +3715,19 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "scopeguard", ] [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "loupe" @@ -3808,9 +3799,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memfd" @@ -3818,7 +3809,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.30", ] [[package]] @@ -3846,7 +3837,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -3855,7 +3846,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -3864,7 +3855,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -3873,7 +3864,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -3899,18 +3890,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -3973,7 +3964,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.9.9", "thiserror", "tokio", @@ -4022,7 +4013,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", ] [[package]] @@ -4045,13 +4036,13 @@ dependencies = [ [[package]] name = "near-abi" -version = "0.4.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c49593c9e94454a2368a4c0a511bf4bf1413aff4d23f16e1d8f4e64b5215351" +checksum = "5bd176820187cfb134a5147330fe803357bf5dab9a14f891d1702beb3d471dfb" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "schemars", - "semver 1.0.23", + "semver 1.0.21", "serde", ] @@ -4111,7 +4102,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35cbb989542587b47205e608324ddd391f0cee1c22b4b64ae49f458334b95907" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "serde", ] @@ -4199,7 +4190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94799fd728fadc895daada6934016cb1fe3fc7e7a01200e5c88708ad8076a8a6" dependencies = [ "bip39", - "bs58 0.5.1", + "bs58 0.5.0", "bytesize", "cargo-util", "clap", @@ -4310,12 +4301,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2991d2912218a80ec0733ac87f84fa803accea105611eea209d4419271957667" dependencies = [ "blake2", - "borsh 1.5.0", + "borsh 1.3.1", "bs58 0.4.0", "c2-chacha", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.1", "derive_more", - "ed25519-dalek 2.1.1", + "ed25519-dalek 2.1.0", "hex 0.4.3", "near-account-id 1.0.0", "near-config-utils 0.20.1", @@ -4337,12 +4328,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d927e95742aea981b9fd60996fbeba3b61e90acafd54c2c3c2a4ed40065ff03" dependencies = [ "blake2", - "borsh 1.5.0", + "borsh 1.3.1", "bs58 0.4.0", "c2-chacha", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.1", "derive_more", - "ed25519-dalek 2.1.1", + "ed25519-dalek 2.1.0", "hex 0.4.3", "near-account-id 1.0.0", "near-config-utils 0.21.2", @@ -4429,7 +4420,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14e75c875026229902d065e4435804497337b631ec69ba746b102954273e9ad1" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "interactive-clap", "schemars", "serde", @@ -4460,7 +4451,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18ad81e015f7aced8925d5b9ba3f369b36da9575c15812cfd0786bc1213284ca" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "lazy_static", "log", "near-chain-configs 0.20.1", @@ -4479,7 +4470,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5225c0f97a61fd4534dee3169959dd91bb812be7d0573c1130a3cf86fd16b3e" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "lazy_static", "log", "near-chain-configs 0.21.2", @@ -4629,7 +4620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9f16a59b6c3e69b0585be951af6fe42a0ba86c0e207cb8c63badd19efd16680" dependencies = [ "assert_matches", - "borsh 1.5.0", + "borsh 1.3.1", "enum-map", "near-account-id 1.0.0", "near-primitives-core 0.20.1", @@ -4648,7 +4639,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a996c8654020f7eb3c11039cb39123fd4cd78654fde4c9e7c3fd6d092c84f342" dependencies = [ "assert_matches", - "borsh 1.5.0", + "borsh 1.3.1", "enum-map", "near-account-id 1.0.0", "near-primitives-core 0.21.2", @@ -4688,7 +4679,7 @@ dependencies = [ "reed-solomon-erasure", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.4.0", "serde_yaml", "smart-default 0.6.0", "strum 0.24.1", @@ -4705,7 +4696,7 @@ checksum = "0462b067732132babcc89d5577db3bfcb0a1bcfbaaed3f2db4c11cd033666314" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh 1.5.0", + "borsh 1.3.1", "bytesize", "cfg-if 1.0.0", "chrono", @@ -4729,7 +4720,7 @@ dependencies = [ "reed-solomon-erasure", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.4.0", "serde_yaml", "sha3 0.10.8", "smart-default 0.6.0", @@ -4747,7 +4738,7 @@ checksum = "7c880397c022d3b8f592cef18f85fd6e79181a2a04c31154afb1730f9fa21098" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh 1.5.0", + "borsh 1.3.1", "bytesize", "cfg-if 1.0.0", "chrono", @@ -4771,7 +4762,7 @@ dependencies = [ "reed-solomon-erasure", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.4.0", "serde_yaml", "sha3 0.10.8", "smart-default 0.6.0", @@ -4797,7 +4788,7 @@ dependencies = [ "num-rational 0.3.2", "serde", "serde_repr", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.10.8", "strum 0.24.1", "thiserror", @@ -4811,7 +4802,7 @@ checksum = "8443eb718606f572c438be6321a097a8ebd69f8e48d953885b4f16601af88225" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh 1.5.0", + "borsh 1.3.1", "bs58 0.4.0", "derive_more", "enum-map", @@ -4819,7 +4810,7 @@ dependencies = [ "num-rational 0.3.2", "serde", "serde_repr", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.10.8", "strum 0.24.1", "thiserror", @@ -4833,7 +4824,7 @@ checksum = "082b1d3f6c7e273ec5cd9588e00bdbfc51be6cc9a3a7ec31fc899b4b7d2d3f9d" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh 1.5.0", + "borsh 1.3.1", "bs58 0.4.0", "derive_more", "enum-map", @@ -4841,7 +4832,7 @@ dependencies = [ "num-rational 0.3.2", "serde", "serde_repr", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.10.8", "strum 0.24.1", "thiserror", @@ -4855,7 +4846,7 @@ checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" dependencies = [ "quote", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4866,7 +4857,7 @@ checksum = "80fca203c51edd9595ec14db1d13359fb9ede32314990bf296b6c5c4502f6ab7" dependencies = [ "quote", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4877,7 +4868,7 @@ checksum = "3610517a56329b7cce0c8c4cf2686fc4bbe0b155181b118acf20d2a301bf29b6" dependencies = [ "quote", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4889,7 +4880,7 @@ dependencies = [ "fs2", "near-rpc-error-core 0.17.0", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4901,7 +4892,7 @@ dependencies = [ "fs2", "near-rpc-error-core 0.20.1", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4913,7 +4904,7 @@ dependencies = [ "fs2", "near-rpc-error-core 0.21.2", "serde", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -4970,7 +4961,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b68f3f8a2409f72b43efdbeff8e820b81e70824c49fee8572979d789d1683fb" dependencies = [ - "borsh 1.5.0", + "borsh 1.3.1", "interactive-clap", "serde", ] @@ -5060,8 +5051,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c56c80bdb1954808f59bd36a9112377197b38d424991383bf05f52d0fe2e0da5" dependencies = [ "base64 0.21.7", - "borsh 1.5.0", - "ed25519-dalek 2.1.1", + "borsh 1.3.1", + "ed25519-dalek 2.1.0", "enum-map", "memoffset 0.8.0", "near-crypto 0.20.1", @@ -5074,7 +5065,7 @@ dependencies = [ "ripemd", "serde", "serde_repr", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.10.8", "sha3 0.10.8", "strum 0.24.1", @@ -5091,8 +5082,8 @@ checksum = "20569500ca56e161c6ed81da9a24c7bf7b974c4238b2f08b2582113b66fa0060" dependencies = [ "anyhow", "base64 0.21.7", - "borsh 1.5.0", - "ed25519-dalek 2.1.1", + "borsh 1.3.1", + "ed25519-dalek 2.1.0", "enum-map", "finite-wasm", "loupe", @@ -5116,7 +5107,7 @@ dependencies = [ "ripemd", "serde", "serde_repr", - "serde_with 3.8.1", + "serde_with 3.4.0", "sha2 0.10.8", "sha3 0.10.8", "strum 0.24.1", @@ -5178,7 +5169,7 @@ source = "git+https://github.com/near/near-workspaces-rs?branch=feat/upgrade-nea dependencies = [ "async-trait", "base64 0.21.7", - "bs58 0.5.1", + "bs58 0.5.0", "cargo-near", "chrono", "fs2", @@ -5235,9 +5226,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.6" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "newline-converter" @@ -5275,13 +5266,12 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "cfg-if 1.0.0", - "cfg_aliases", "libc", ] @@ -5320,15 +5310,15 @@ dependencies = [ [[package]] name = "num" -version = "0.4.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.4", "num-complex", "num-integer", "num-iter", - "num-rational 0.4.2", + "num-rational 0.4.1", "num-traits", ] @@ -5338,7 +5328,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5349,36 +5339,31 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "num-integer", "num-traits", ] [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg 1.1.0", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-format" version = "0.4.4" @@ -5391,20 +5376,21 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5415,7 +5401,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "num-bigint 0.3.3", "num-integer", "num-traits", @@ -5424,22 +5410,23 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ - "num-bigint 0.4.5", + "autocfg 1.1.0", + "num-bigint 0.4.4", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -5448,15 +5435,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.4", "libc", ] [[package]] name = "num_threads" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] @@ -5468,8 +5455,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.14.5", - "indexmap 2.2.6", + "hashbrown 0.14.3", + "indexmap 2.1.0", "memchr", ] @@ -5487,9 +5474,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" @@ -5504,11 +5491,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "cfg-if 1.0.0", "foreign-types", "libc", @@ -5525,7 +5512,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -5545,9 +5532,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -5783,9 +5770,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -5797,11 +5784,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -5837,12 +5824,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.4.12", - "parking_lot_core 0.9.10", + "lock_api 0.4.11", + "parking_lot_core 0.9.9", ] [[package]] @@ -5861,15 +5848,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] @@ -5885,9 +5872,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pathdiff" @@ -5941,12 +5928,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.1.0", ] [[package]] @@ -5960,29 +5947,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -5992,12 +5979,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.0.1", "futures-io", ] @@ -6013,9 +6000,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plain" @@ -6025,9 +6012,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "platforms" -version = "3.4.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polling" @@ -6035,7 +6022,7 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "bitflags 1.3.2", "cfg-if 1.0.0", "concurrent-queue", @@ -6047,28 +6034,27 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ "cfg-if 1.0.0", "concurrent-queue", - "hermit-abi 0.3.9", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.30", "tracing", "windows-sys 0.52.0", ] [[package]] name = "polyval" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", "universal-hash", ] @@ -6162,13 +6148,22 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + [[package]] name = "proc-macro-crate" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.21.0", ] [[package]] @@ -6197,48 +6192,38 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "procfs" -version = "0.16.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" +checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" dependencies = [ - "bitflags 2.5.0", + "bitflags 1.3.2", + "byteorder", "hex 0.4.3", "lazy_static", - "procfs-core", - "rustix 0.38.34", -] - -[[package]] -name = "procfs-core" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" -dependencies = [ - "bitflags 2.5.0", - "hex 0.4.3", + "rustix 0.36.17", ] [[package]] name = "prometheus" -version = "0.13.4" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", "libc", "memchr", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "procfs", "protobuf", "thiserror", @@ -6384,9 +6369,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -6513,7 +6498,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", ] [[package]] @@ -6640,22 +6625,13 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "libredox", "thiserror", ] @@ -6684,14 +6660,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -6705,13 +6681,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.2", ] [[package]] @@ -6722,9 +6698,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "region" @@ -6749,9 +6725,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.27" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "async-compression", "base64 0.21.7", @@ -6775,17 +6751,16 @@ dependencies = [ "once_cell", "percent-encoding 2.3.1", "pin-project-lite", - "rustls", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tower-service", "url 2.5.0", "wasm-bindgen", @@ -6812,17 +6787,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if 1.0.0", - "getrandom 0.2.15", + "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6886,9 +6860,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -6917,7 +6891,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.23", + "semver 1.0.21", +] + +[[package]] +name = "rustix" +version = "0.36.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +dependencies = [ + "bitflags 1.3.2", + "errno 0.3.8", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] @@ -6927,7 +6915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", - "errno 0.3.9", + "errno 0.3.8", "io-lifetimes", "libc", "linux-raw-sys 0.3.8", @@ -6936,29 +6924,43 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.5.0", - "errno 0.3.9", + "bitflags 2.4.2", + "errno 0.3.8", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.8", - "rustls-webpki", + "ring 0.17.7", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.1", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -6980,27 +6982,44 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pki-types" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +dependencies = [ + "ring 0.17.7", + "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -7022,9 +7041,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.21" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" dependencies = [ "dyn-clone", "schemars_derive", @@ -7034,14 +7053,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.66", + "syn 1.0.109", ] [[package]] @@ -7073,7 +7092,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -7082,7 +7101,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7152,11 +7171,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags 2.5.0", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -7165,9 +7184,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -7184,9 +7203,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -7199,9 +7218,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.202" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -7227,31 +7246,31 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "serde_derive_internals" -version = "0.29.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -7260,9 +7279,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.16" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" dependencies = [ "itoa", "serde", @@ -7270,20 +7289,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -7318,19 +7337,18 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "chrono", "hex 0.4.3", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.1.0", "serde", - "serde_derive", "serde_json", - "serde_with_macros 3.8.1", + "serde_with_macros 3.4.0", "time", ] @@ -7343,28 +7361,28 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "serde_yaml" -version = "0.9.34+deprecated" +version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -7381,7 +7399,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -7417,7 +7435,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -7440,7 +7458,7 @@ dependencies = [ "block-buffer 0.9.0", "digest 0.9.0", "keccak", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -7506,9 +7524,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -7541,7 +7559,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.4", "num-traits", "thiserror", "time", @@ -7549,9 +7567,9 @@ dependencies = [ [[package]] name = "simplelog" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" +checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", @@ -7570,7 +7588,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", ] [[package]] @@ -7592,9 +7610,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "smart-default" @@ -7615,7 +7633,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -7630,12 +7648,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -7665,7 +7683,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "lock_api 0.4.12", + "lock_api 0.4.11", ] [[package]] @@ -7703,7 +7721,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "phf_shared", "precomputed-hash", "serde", @@ -7711,9 +7729,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.11.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" @@ -7753,14 +7771,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "symbolic-common" @@ -7791,7 +7809,7 @@ dependencies = [ "lazycell", "nom", "nom-supreme", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "pdb", "regex", "scroll 0.11.0", @@ -7817,9 +7835,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -7835,7 +7853,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -7896,13 +7914,14 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.1.0", - "rustix 0.38.34", + "fastrand 2.0.1", + "redox_syscall 0.4.1", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -7919,38 +7938,38 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -7958,14 +7977,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", "libc", - "num-conv", "num_threads", "powerfmt", "serde", @@ -7981,11 +7999,10 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ - "num-conv", "time-core", ] @@ -8019,12 +8036,12 @@ version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.1.0", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2 0.4.10", @@ -8050,7 +8067,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -8080,15 +8097,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -8123,9 +8140,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -8133,6 +8150,7 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", + "tracing", ] [[package]] @@ -8158,9 +8176,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -8171,7 +8189,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -8180,11 +8198,22 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.1.0", "toml_datetime", "winnow", ] @@ -8274,7 +8303,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", @@ -8286,7 +8315,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "bytes", "futures-core", "futures-util", @@ -8342,7 +8371,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -8458,6 +8487,15 @@ dependencies = [ "tracing-log 0.2.0", ] +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -8535,9 +8573,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" @@ -8557,9 +8595,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "untrusted" @@ -8583,8 +8621,8 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls", - "rustls-webpki", + "rustls 0.21.10", + "rustls-webpki 0.101.7", "url 2.5.0", "webpki-roots", ] @@ -8678,9 +8716,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "waker-fn" -version = "1.2.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" @@ -8715,9 +8753,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8725,24 +8763,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8752,9 +8790,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8762,22 +8800,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-encoder" @@ -9009,8 +9047,8 @@ version = "0.115.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e06c0641a4add879ba71ccb3a1e4278fd546f76f1eafb21d8f7b07733b547cd5" dependencies = [ - "indexmap 2.2.6", - "semver 1.0.23", + "indexmap 2.1.0", + "semver 1.0.21", ] [[package]] @@ -9034,7 +9072,7 @@ dependencies = [ "bumpalo", "cfg-if 1.0.0", "fxprof-processed-profile", - "indexmap 2.2.6", + "indexmap 2.1.0", "libc", "log", "object", @@ -9113,7 +9151,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.28.1", - "indexmap 2.2.6", + "indexmap 2.1.0", "log", "object", "serde", @@ -9139,7 +9177,7 @@ dependencies = [ "log", "object", "rustc-demangle", - "rustix 0.38.34", + "rustix 0.38.30", "serde", "serde_derive", "target-lexicon 0.12.14", @@ -9179,7 +9217,7 @@ dependencies = [ "anyhow", "cc", "cfg-if 1.0.0", - "indexmap 2.2.6", + "indexmap 2.1.0", "libc", "log", "mach", @@ -9187,7 +9225,7 @@ dependencies = [ "memoffset 0.9.1", "paste", "rand 0.8.5", - "rustix 0.38.34", + "rustix 0.38.30", "sptr", "wasm-encoder 0.35.0", "wasmtime-asm-macros", @@ -9219,7 +9257,7 @@ checksum = "09b5575a75e711ca6c36bb9ad647c93541cdc8e34218031acba5da3f35919dd3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -9230,9 +9268,9 @@ checksum = "9dafab2db172a53e23940e0fa3078c202f567ee5f13f4b42f66b694fab43c658" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -9258,7 +9296,7 @@ dependencies = [ "jsonrpc-core", "log", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.1", "pin-project", "reqwest", "rlp", @@ -9269,7 +9307,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.10", "url 2.5.0", "web3-async-native-tls", ] @@ -9288,9 +9326,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -9301,7 +9339,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.34", + "rustix 0.38.30", ] [[package]] @@ -9322,11 +9360,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "windows-sys 0.52.0", + "winapi", ] [[package]] @@ -9341,7 +9379,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", ] [[package]] @@ -9359,7 +9406,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +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]] @@ -9379,20 +9441,25 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] +[[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.5" @@ -9401,9 +9468,15 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[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" @@ -9413,9 +9486,15 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[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" @@ -9425,15 +9504,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" +name = "windows_i686_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -9443,9 +9522,15 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -9455,9 +9540,15 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -9467,9 +9558,15 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -9479,15 +9576,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.40" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -9518,8 +9615,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.14", - "rustix 0.38.34", + "linux-raw-sys 0.4.13", + "rustix 0.38.30", ] [[package]] @@ -9534,27 +9631,27 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "yup-oauth2" -version = "8.3.1" +version = "8.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24bea7df5a9a74a9a0de92f22e5ab3fb9505dd960c7f1f00de5b7231d9d97206" +checksum = "b61da40aeb0907a65f7fb5c1de83c5a224d6a9ebb83bf918588a2bb744d636b8" dependencies = [ "anyhow", "async-trait", - "base64 0.13.1", + "base64 0.21.7", "futures", "http", "hyper", "hyper-rustls", - "itertools 0.10.5", + "itertools 0.12.0", "log", "percent-encoding 2.3.1", - "rustls", + "rustls 0.22.2", "rustls-pemfile", "seahash", "serde", @@ -9633,9 +9730,9 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "byteorder", "zerocopy-derive", @@ -9643,20 +9740,20 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "zeroize" -version = "1.4.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -9669,7 +9766,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -9703,7 +9800,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes 0.8.4", + "aes 0.8.3", "byteorder", "bzip2", "constant_time_eq", @@ -9738,9 +9835,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", "pkg-config", diff --git a/node/Cargo.lock b/node/Cargo.lock index 148d7fe14..e29674b2c 100644 --- a/node/Cargo.lock +++ b/node/Cargo.lock @@ -1644,6 +1644,20 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-shared" +version = "0.0.0" +dependencies = [ + "anyhow", + "borsh 1.5.0", + "getrandom 0.2.15", + "k256", + "near-account-id", + "near-sdk", + "serde", + "serde_json", +] + [[package]] name = "ctr" version = "0.9.2" @@ -3327,6 +3341,8 @@ name = "mpc-contract" version = "0.2.0" dependencies = [ "borsh 1.5.0", + "crypto-shared", + "k256", "near-sdk", "schemars", "serde", @@ -3357,6 +3373,7 @@ dependencies = [ "cait-sith", "chrono", "clap", + "crypto-shared", "google-datastore1", "google-secretmanager1", "hex", diff --git a/node/Cargo.toml b/node/Cargo.toml index f5b79e916..3e460e0d6 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -51,6 +51,7 @@ near-sdk = { version = "=5.1.0", features = ["legacy", "unit-testing"] } mpc-contract = { path = "../contract" } mpc-keys = { path = "../keys" } +crypto-shared = { path = "../crypto-shared" } itertools = "0.12.0" prometheus = { version = "0.13.3" } diff --git a/node/src/indexer.rs b/node/src/indexer.rs index 5dd1758fb..73b78ca6f 100644 --- a/node/src/indexer.rs +++ b/node/src/indexer.rs @@ -2,7 +2,7 @@ use crate::gcp::GcpService; use crate::kdf; use crate::protocol::{SignQueue, SignRequest}; use crate::types::LatestBlockHeight; - +use crypto_shared::derive_epsilon; use near_account_id::AccountId; use near_lake_framework::{LakeBuilder, LakeContext}; use near_lake_primitives::actions::ActionMetaDataExt; @@ -105,7 +105,7 @@ async fn handle_block( }; if let Some(function_call) = action.as_function_call() { if function_call.method_name() == "sign" { - if let Ok(aruments) = + if let Ok(arguments) = serde_json::from_slice::<'_, SignArguments>(function_call.args()) { if receipt.logs().is_empty() { @@ -121,21 +121,21 @@ async fn handle_block( continue; }; let epsilon = - kdf::derive_epsilon(&action.predecessor_id(), &aruments.request.path); + derive_epsilon(&action.predecessor_id(), &arguments.request.path); let delta = kdf::derive_delta(receipt_id, entropy); tracing::info!( receipt_id = %receipt_id, caller_id = receipt.predecessor_id().to_string(), our_account = ctx.node_account_id.to_string(), - payload = hex::encode(aruments.request.payload), - key_version = aruments.request.key_version, + payload = hex::encode(arguments.request.payload), + key_version = arguments.request.key_version, entropy = hex::encode(entropy), "indexed new `sign` function call" ); let mut queue = ctx.queue.write().await; queue.add(SignRequest { receipt_id, - request: aruments.request, + request: arguments.request, epsilon, delta, entropy, diff --git a/node/src/kdf.rs b/node/src/kdf.rs index 54318689d..99700459d 100644 --- a/node/src/kdf.rs +++ b/node/src/kdf.rs @@ -1,36 +1,13 @@ -use crate::types::PublicKey; -use crate::util::ScalarExt; use anyhow::Context; -use cait_sith::FullSignature; +use crypto_shared::{x_coordinate, ScalarExt, SignatureResponse}; use hkdf::Hkdf; -use k256::ecdsa::{RecoveryId, VerifyingKey}; -use k256::elliptic_curve::point::AffineCoordinates; -use k256::elliptic_curve::sec1::ToEncodedPoint; -use k256::elliptic_curve::CurveArithmetic; -use k256::{AffinePoint, Scalar, Secp256k1}; -use near_account_id::AccountId; +use k256::{ + ecdsa::{RecoveryId, VerifyingKey}, + elliptic_curve::sec1::ToEncodedPoint, + Scalar, +}; use near_primitives::hash::CryptoHash; -use sha2::{Digest, Sha256}; - -// Constant prefix that ensures epsilon derivation values are used specifically for -// near-mpc-recovery with key derivation protocol vX.Y.Z. -const EPSILON_DERIVATION_PREFIX: &str = "near-mpc-recovery v0.1.0 epsilon derivation:"; -// Constant prefix that ensures delta derivation values are used specifically for -// near-mpc-recovery with key derivation protocol vX.Y.Z. -const DELTA_DERIVATION_PREFIX: &str = "near-mpc-recovery v0.1.0 delta derivation:"; - -pub fn derive_epsilon(signer_id: &AccountId, path: &str) -> Scalar { - // TODO: Use a key derivation library instead of doing this manually. - // https://crates.io/crates/hkdf might be a good option? - // - // ',' is ACCOUNT_DATA_SEPARATOR from nearcore that indicate the end - // of the accound id in the trie key. We reuse the same constant to - // indicate the end of the account id in derivation path. - let derivation_path = format!("{EPSILON_DERIVATION_PREFIX}{},{}", signer_id, path); - let mut hasher = Sha256::new(); - hasher.update(derivation_path); - Scalar::from_bytes(&hasher.finalize()) -} +use sha2::Sha256; // In case there are multiple requests in the same block (hence same entropy), we need to ensure // that we generate different random scalars as delta tweaks. @@ -43,27 +20,20 @@ pub fn derive_delta(receipt_id: CryptoHash, entropy: [u8; 32]) -> Scalar { Scalar::from_bytes(&okm) } -pub fn derive_key(public_key: PublicKey, epsilon: Scalar) -> PublicKey { - (::ProjectivePoint::GENERATOR * epsilon + public_key).to_affine() -} - -#[derive(Debug)] -pub struct MultichainSignature { - pub big_r: AffinePoint, - pub s: Scalar, - pub recovery_id: u8, -} +// Constant prefix that ensures delta derivation values are used specifically for +// near-mpc-recovery with key derivation protocol vX.Y.Z. +const DELTA_DERIVATION_PREFIX: &str = "near-mpc-recovery v0.1.0 delta derivation:"; // try to get the correct recovery id for this signature by brute force. pub fn into_eth_sig( public_key: &k256::AffinePoint, - sig: &FullSignature, + big_r: &k256::AffinePoint, + s: &k256::Scalar, msg_hash: Scalar, -) -> anyhow::Result { +) -> anyhow::Result { let public_key = public_key.to_encoded_point(false); - let signature = - k256::ecdsa::Signature::from_scalars(x_coordinate::(&sig.big_r), sig.s) - .context("cannot create signature from cait_sith signature")?; + let signature = k256::ecdsa::Signature::from_scalars(x_coordinate(big_r), s) + .context("cannot create signature from cait_sith signature")?; let pk0 = VerifyingKey::recover_from_prehash( &msg_hash.to_bytes(), &signature, @@ -72,11 +42,7 @@ pub fn into_eth_sig( .context("unable to use 0 as recovery_id to recover public key")? .to_encoded_point(false); if public_key == pk0 { - return Ok(MultichainSignature { - big_r: sig.big_r, - s: sig.s, - recovery_id: 0, - }); + return Ok(SignatureResponse::new(*big_r, *s, 0)); } let pk1 = VerifyingKey::recover_from_prehash( @@ -87,17 +53,8 @@ pub fn into_eth_sig( .context("unable to use 1 as recovery_id to recover public key")? .to_encoded_point(false); if public_key == pk1 { - return Ok(MultichainSignature { - big_r: sig.big_r, - s: sig.s, - recovery_id: 1, - }); + return Ok(SignatureResponse::new(*big_r, *s, 1)); } anyhow::bail!("cannot use either recovery id (0 or 1) to recover pubic key") } - -/// Get the x coordinate of a point, as a scalar -pub fn x_coordinate(point: &C::AffinePoint) -> C::Scalar { - ::Uint>>::reduce_bytes(&point.x()) -} diff --git a/node/src/protocol/contract/mod.rs b/node/src/protocol/contract/mod.rs index 860d0a78d..44a7a451d 100644 --- a/node/src/protocol/contract/mod.rs +++ b/node/src/protocol/contract/mod.rs @@ -1,7 +1,7 @@ pub mod primitives; -use crate::types::PublicKey; use crate::util::NearPublicKeyExt; +use crypto_shared::PublicKey; use mpc_contract::ProtocolContractState; use near_account_id::AccountId; use serde::{Deserialize, Serialize}; diff --git a/node/src/protocol/presignature.rs b/node/src/protocol/presignature.rs index 1f601e239..563d7cf13 100644 --- a/node/src/protocol/presignature.rs +++ b/node/src/protocol/presignature.rs @@ -2,12 +2,13 @@ use super::message::PresignatureMessage; use super::triple::{Triple, TripleConfig, TripleId, TripleManager}; use crate::gcp::error::DatastoreStorageError; use crate::protocol::contract::primitives::Participants; -use crate::types::{PresignatureProtocol, PublicKey, SecretKeyShare}; +use crate::types::{PresignatureProtocol, SecretKeyShare}; use crate::util::AffinePointExt; use cait_sith::protocol::{Action, InitializationError, Participant, ProtocolError}; use cait_sith::{KeygenOutput, PresignArguments, PresignOutput}; use chrono::Utc; +use crypto_shared::PublicKey; use k256::Secp256k1; use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet, VecDeque}; diff --git a/node/src/protocol/signature.rs b/node/src/protocol/signature.rs index e59020e3f..051966ce9 100644 --- a/node/src/protocol/signature.rs +++ b/node/src/protocol/signature.rs @@ -2,14 +2,17 @@ use super::contract::primitives::Participants; use super::message::SignatureMessage; use super::presignature::{Presignature, PresignatureId, PresignatureManager}; use crate::indexer::ContractSignRequest; -use crate::kdf; -use crate::types::{PublicKey, SignatureProtocol}; -use crate::util::{AffinePointExt, ScalarExt}; +use crate::kdf::into_eth_sig; +use crate::types::SignatureProtocol; +use crate::util::AffinePointExt; use cait_sith::protocol::{Action, InitializationError, Participant, ProtocolError}; use cait_sith::{FullSignature, PresignOutput}; use chrono::Utc; +use crypto_shared::{derive_key, PublicKey}; +use crypto_shared::{ScalarExt, SerializableScalar}; use k256::{Scalar, Secp256k1}; +use mpc_contract::SignatureRequest; use rand::rngs::StdRng; use rand::seq::{IteratorRandom, SliceRandom}; use rand::SeedableRng; @@ -178,10 +181,10 @@ pub struct SignatureManager { /// Set of completed signatures completed: HashMap, /// Generated signatures assigned to the current node that are yet to be published. - /// Vec<(receipt_id, sign_request, timestamp, output)> + /// Vec<(receipt_id, msg_hash, timestamp, output)> signatures: Vec<( CryptoHash, - ContractSignRequest, + SignatureRequest, Instant, FullSignature, )>, @@ -237,7 +240,7 @@ impl SignatureManager { let protocol = Box::new(cait_sith::sign( &participants, me, - kdf::derive_key(public_key, epsilon), + derive_key(public_key, epsilon), output, Scalar::from_bytes(&request.payload), )?); @@ -428,9 +431,13 @@ impl SignatureManager { "completed signature generation" ); self.completed.insert(generator.presignature_id, Instant::now()); + let request = SignatureRequest { + epsilon: SerializableScalar {scalar: generator.epsilon}, + payload_hash: generator.request.payload, + }; if generator.proposer == self.me { self.signatures - .push((*receipt_id, generator.request.clone(), generator.sign_request_timestamp, output)); + .push((*receipt_id, request, generator.sign_request_timestamp, output)); } // Do not retain the protocol return false; @@ -521,14 +528,20 @@ impl SignatureManager { my_account_id: &AccountId, ) -> Result<(), near_fetch::Error> { for (receipt_id, request, time_added, signature) in self.signatures.drain(..) { + let expected_public_key = derive_key(self.public_key, request.epsilon.scalar); + // We do this here, rather than on the client side, so we can use the ecrecover system function on NEAR to validate our signature + let signature = into_eth_sig( + &expected_public_key, + &signature.big_r, + &signature.s, + Scalar::from_bytes(&request.payload_hash), + ) + .map_err(|_| near_fetch::Error::InvalidArgs("Failed to generate a recovery ID"))?; let response = rpc_client .call(signer, mpc_contract_id, "respond") .args_json(serde_json::json!({ "request": request, - "result": { - "big_r": signature.big_r, - "s": signature.s, - }, + "response": signature, })) .max_gas() .transact() @@ -544,7 +557,7 @@ impl SignatureManager { .with_label_values(&[my_account_id.as_str()]) .inc(); } - tracing::info!(%receipt_id, big_r = signature.big_r.to_base58(), s = ?signature.s, status = ?response.status(), "published signature response"); + tracing::info!(%receipt_id, big_r = signature.big_r.affine_point.to_base58(), s = ?signature.s, status = ?response.status(), "published signature response"); } Ok(()) } diff --git a/node/src/protocol/state.rs b/node/src/protocol/state.rs index e4a56d110..13f09cf01 100644 --- a/node/src/protocol/state.rs +++ b/node/src/protocol/state.rs @@ -6,8 +6,9 @@ use super::triple::TripleManager; use super::SignQueue; use crate::http_client::MessageQueue; use crate::storage::triple_storage::TripleData; -use crate::types::{KeygenProtocol, PublicKey, ReshareProtocol, SecretKeyShare}; +use crate::types::{KeygenProtocol, ReshareProtocol, SecretKeyShare}; use cait_sith::protocol::Participant; +use crypto_shared::PublicKey; use near_account_id::AccountId; use serde::{Deserialize, Serialize}; use std::fmt; diff --git a/node/src/types.rs b/node/src/types.rs index 4f36f728d..177650d17 100644 --- a/node/src/types.rs +++ b/node/src/types.rs @@ -5,6 +5,7 @@ use cait_sith::protocol::{InitializationError, Participant}; use cait_sith::triples::TripleGenerationOutput; use cait_sith::{protocol::Protocol, KeygenOutput}; use cait_sith::{FullSignature, PresignOutput}; +use crypto_shared::PublicKey; use k256::{elliptic_curve::CurveArithmetic, Secp256k1}; use tokio::sync::{RwLock, RwLockWriteGuard}; @@ -31,7 +32,6 @@ pub const FAILED_TRIPLES_TIMEOUT: Duration = Duration::from_secs(120 * 60); pub const TAKEN_TIMEOUT: Duration = Duration::from_secs(120 * 60); pub type SecretKeyShare = ::Scalar; -pub type PublicKey = ::AffinePoint; pub type TripleProtocol = Box> + Send + Sync>; pub type PresignatureProtocol = Box> + Send + Sync>; diff --git a/node/src/util.rs b/node/src/util.rs index bfbf27ee2..8aceb5b2e 100644 --- a/node/src/util.rs +++ b/node/src/util.rs @@ -1,8 +1,7 @@ -use crate::types::PublicKey; use chrono::{DateTime, LocalResult, TimeZone, Utc}; -use k256::elliptic_curve::scalar::FromUintUnchecked; +use crypto_shared::{near_public_key_to_affine_point, PublicKey}; use k256::elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint}; -use k256::{AffinePoint, EncodedPoint, Scalar, U256}; +use k256::{AffinePoint, EncodedPoint}; use std::env; use std::time::Duration; @@ -19,10 +18,7 @@ impl NearPublicKeyExt for String { impl NearPublicKeyExt for near_sdk::PublicKey { fn into_affine_point(self) -> PublicKey { - let mut bytes = self.into_bytes(); - bytes[0] = 0x04; - let point = EncodedPoint::from_bytes(bytes).unwrap(); - PublicKey::from_encoded_point(&point).unwrap() + near_public_key_to_affine_point(self) } } @@ -68,16 +64,6 @@ impl AffinePointExt for AffinePoint { } } -pub trait ScalarExt { - fn from_bytes(bytes: &[u8]) -> Self; -} - -impl ScalarExt for Scalar { - fn from_bytes(bytes: &[u8]) -> Self { - Scalar::from_uint_unchecked(U256::from_le_slice(bytes)) - } -} - pub fn get_triple_timeout() -> Duration { env::var("MPC_RECOVERY_TRIPLE_TIMEOUT_SEC") .map(|val| val.parse::().ok().map(Duration::from_secs))