From 24177fac262fd403cc198f107ac21ffb67b5d85e Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Mon, 4 Nov 2024 18:12:14 +0700 Subject: [PATCH 01/40] feat: hardcoded identity transfers in strategy tests --- .../tests/strategy_tests/main.rs | 7 +- .../tests/strategy_tests/strategy.rs | 14 ++- .../tests/strategy_tests/voting_tests.rs | 90 +++++++++++-------- packages/strategy-tests/src/lib.rs | 71 ++++++++++----- packages/strategy-tests/src/operations.rs | 19 +++- packages/strategy-tests/src/transitions.rs | 2 +- 6 files changed, 137 insertions(+), 66 deletions(-) diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index 2312241cc64..f2122d627ef 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -2602,7 +2602,10 @@ mod tests { &simple_signer, &mut rng, platform_version, - ); + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let strategy = NetworkStrategy { strategy: Strategy { @@ -3910,7 +3913,7 @@ mod tests { strategy: Strategy { start_contracts: vec![], operations: vec![Operation { - op_type: OperationType::IdentityTransfer, + op_type: OperationType::IdentityTransfer(None), frequency: Frequency { times_per_block_range: 1..3, chance_per_block: None, diff --git a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs index 667b8468688..4d1a7ccb624 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs @@ -41,7 +41,7 @@ use drive_abci::rpc::core::MockCoreRPCLike; use rand::prelude::{IteratorRandom, SliceRandom, StdRng}; use rand::Rng; use strategy_tests::Strategy; -use strategy_tests::transitions::{create_state_transitions_for_identities, create_state_transitions_for_identities_and_proofs, instant_asset_lock_proof_fixture, instant_asset_lock_proof_fixture_with_dynamic_range}; +use strategy_tests::transitions::{create_state_transitions_for_identities, create_state_transitions_for_identities_and_proofs, instant_asset_lock_proof_fixture_with_dynamic_range}; use std::borrow::Cow; use std::collections::{BTreeMap, HashMap, HashSet}; use std::ops::RangeInclusive; @@ -405,7 +405,15 @@ impl NetworkStrategy { state_transitions.append(&mut new_transitions); } if !self.strategy.start_identities.hard_coded.is_empty() { - state_transitions.extend(self.strategy.start_identities.hard_coded.clone()); + state_transitions.extend( + self.strategy.start_identities.hard_coded.iter().filter_map( + |(identity, transition)| { + transition.as_ref().map(|create_transition| { + (identity.clone(), create_transition.clone()) + }) + }, + ), + ); } } let frequency = &self.strategy.identity_inserts.frequency; @@ -1196,7 +1204,7 @@ impl NetworkStrategy { operations.push(state_transition); } } - OperationType::IdentityTransfer if current_identities.len() > 1 => { + OperationType::IdentityTransfer(_) if current_identities.len() > 1 => { let identities_clone = current_identities.clone(); // Sender is the first in the list, which should be loaded_identity diff --git a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs index e14f8d7b1b0..2264a4cd5fb 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs @@ -79,13 +79,17 @@ mod tests { simple_signer.add_keys(keys1); - let start_identities = create_state_transitions_for_identities( - vec![identity1], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let dpns_contract = platform .drive @@ -363,13 +367,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let dpns_contract = platform .drive @@ -635,13 +643,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let dpns_contract = platform .drive @@ -988,13 +1000,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let dpns_contract = platform .drive @@ -1353,13 +1369,17 @@ mod tests { simple_signer.add_keys(keys2); - let start_identities = create_state_transitions_for_identities( - vec![identity1, identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![identity1, identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .iter() + .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .collect(); let dpns_contract = platform .drive diff --git a/packages/strategy-tests/src/lib.rs b/packages/strategy-tests/src/lib.rs index 61395d99f2a..65e8a51f851 100644 --- a/packages/strategy-tests/src/lib.rs +++ b/packages/strategy-tests/src/lib.rs @@ -44,6 +44,7 @@ use platform_version::TryFromPlatformVersioned; use rand::prelude::StdRng; use rand::seq::{IteratorRandom, SliceRandom}; use rand::Rng; +use transitions::create_identity_credit_transfer_transition; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::ops::RangeInclusive; use bincode::{Decode, Encode}; @@ -146,7 +147,7 @@ pub struct StartIdentities { pub keys_per_identity: u8, pub starting_balances: u64, // starting balance in duffs pub extra_keys: KeyMaps, - pub hard_coded: Vec<(Identity, StateTransition)>, + pub hard_coded: Vec<(Identity, Option)>, } /// Identities to register on the first block of the strategy @@ -1287,38 +1288,66 @@ impl Strategy { } // Generate state transition for identity transfer operation - OperationType::IdentityTransfer if current_identities.len() > 1 => { + OperationType::IdentityTransfer(identity_transfer_info) => { for _ in 0..count { - let identities_count = current_identities.len(); - if identities_count == 0 { - break; - } + if let Some(transfer_info) = identity_transfer_info { + let sender = self + .start_identities + .hard_coded + .iter() + .find(|(identity, _)| identity.id() == transfer_info.from) + .expect( + "Expected to find sender identity in hardcoded start identities", + ); + let recipient = self + .start_identities + .hard_coded + .iter() + .find(|(identity, _)| identity.id() == transfer_info.to) + .expect( + "Expected to find recipient identity in hardcoded start identities", + ); + + let state_transition = create_identity_credit_transfer_transition( + &sender.0, + &recipient.0, + identity_nonce_counter, + signer, // Does this mean the loaded identity must be the sender since we're signing with it? + transfer_info.amount, + ); + operations.push(state_transition); + } else if current_identities.len() > 1 { + let identities_count = current_identities.len(); + if identities_count == 0 { + break; + } - // Select a random identity from the current_identities for the sender - let random_index_sender = rng.gen_range(0..identities_count); + // Select a random identity from the current_identities for the sender + let random_index_sender = rng.gen_range(0..identities_count); - // Clone current_identities to a Vec for manipulation - let mut unused_identities: Vec<_> = - current_identities.iter().cloned().collect(); - unused_identities.remove(random_index_sender); // Remove the sender - let unused_identities_count = unused_identities.len(); + // Clone current_identities to a Vec for manipulation + let mut unused_identities: Vec<_> = + current_identities.iter().cloned().collect(); + unused_identities.remove(random_index_sender); // Remove the sender + let unused_identities_count = unused_identities.len(); - // Select a random identity from the remaining ones for the recipient - let random_index_recipient = rng.gen_range(0..unused_identities_count); - let recipient = &unused_identities[random_index_recipient]; + // Select a random identity from the remaining ones for the recipient + let random_index_recipient = + rng.gen_range(0..unused_identities_count); + let recipient = &unused_identities[random_index_recipient]; - // Use the sender index on the original slice - let sender = &mut current_identities[random_index_sender]; + // Use the sender index on the original slice + let sender = &mut current_identities[random_index_sender]; - let state_transition = - crate::transitions::create_identity_credit_transfer_transition( + let state_transition = create_identity_credit_transfer_transition( sender, recipient, identity_nonce_counter, signer, 300000, ); - operations.push(state_transition); + operations.push(state_transition); + } } } diff --git a/packages/strategy-tests/src/operations.rs b/packages/strategy-tests/src/operations.rs index 675e9968433..d35fc9f5036 100644 --- a/packages/strategy-tests/src/operations.rs +++ b/packages/strategy-tests/src/operations.rs @@ -497,6 +497,13 @@ impl VoteAction { pub type AmountRange = RangeInclusive; +#[derive(Clone, Debug, PartialEq, Encode, Decode)] +pub struct IdentityTransferInfo { + pub from: Identifier, + pub to: Identifier, + pub amount: Credits, +} + #[derive(Clone, Debug, PartialEq)] pub enum OperationType { Document(DocumentOp), @@ -505,7 +512,7 @@ pub enum OperationType { IdentityWithdrawal(AmountRange), ContractCreate(RandomDocumentTypeParameters, DocumentTypeCount), ContractUpdate(DataContractUpdateOp), - IdentityTransfer, + IdentityTransfer(Option), ResourceVote(ResourceVoteOp), } @@ -517,7 +524,7 @@ enum OperationTypeInSerializationFormat { IdentityWithdrawal(AmountRange), ContractCreate(RandomDocumentTypeParameters, DocumentTypeCount), ContractUpdate(Vec), - IdentityTransfer, + IdentityTransfer(Option), ResourceVote(ResourceVoteOpSerializable), } @@ -563,7 +570,9 @@ impl PlatformSerializableWithPlatformVersion for OperationType { contract_op_in_serialization_format, ) } - OperationType::IdentityTransfer => OperationTypeInSerializationFormat::IdentityTransfer, + OperationType::IdentityTransfer(identity_transfer_info) => { + OperationTypeInSerializationFormat::IdentityTransfer(identity_transfer_info) + } OperationType::ResourceVote(resource_vote_op) => { let vote_op_in_serialization_format = resource_vote_op.try_into_platform_versioned(platform_version)?; @@ -626,7 +635,9 @@ impl PlatformDeserializableWithPotentialValidationFromVersionedStructure for Ope )?; OperationType::ContractUpdate(update_op) } - OperationTypeInSerializationFormat::IdentityTransfer => OperationType::IdentityTransfer, + OperationTypeInSerializationFormat::IdentityTransfer(identity_transfer_info) => { + OperationType::IdentityTransfer(identity_transfer_info) + } OperationTypeInSerializationFormat::ResourceVote(resource_vote_op) => { let vote_op = resource_vote_op.try_into_platform_versioned(platform_version)?; OperationType::ResourceVote(vote_op) diff --git a/packages/strategy-tests/src/transitions.rs b/packages/strategy-tests/src/transitions.rs index 85d03eb333d..c77b51e2903 100644 --- a/packages/strategy-tests/src/transitions.rs +++ b/packages/strategy-tests/src/transitions.rs @@ -802,7 +802,7 @@ pub fn create_identity_withdrawal_transition_with_output_address( /// - If the sender's identity does not have a suitable authentication key available for signing. /// - If there's an error during the signing process. pub fn create_identity_credit_transfer_transition( - identity: &mut Identity, + identity: &Identity, recipient: &Identity, identity_nonce_counter: &mut BTreeMap, signer: &mut SimpleSigner, From dacc6dbd04b6c4f9593c7c8ab128ac1f5a094e4f Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 4 Nov 2024 18:30:19 +0700 Subject: [PATCH 02/40] fix(drive): uncommitted state if db transaction fails (#2305) --- .../src/abci/handler/finalize_block.rs | 26 +++++++++- .../rs-drive-abci/src/abci/handler/info.rs | 52 ++++++++++++++++--- .../src/abci/handler/prepare_proposal.rs | 43 +++++++++++++++ .../src/abci/handler/process_proposal.rs | 43 +++++++++++++++ 4 files changed, 157 insertions(+), 7 deletions(-) diff --git a/packages/rs-drive-abci/src/abci/handler/finalize_block.rs b/packages/rs-drive-abci/src/abci/handler/finalize_block.rs index 9653391c7d5..852f85cc6b8 100644 --- a/packages/rs-drive-abci/src/abci/handler/finalize_block.rs +++ b/packages/rs-drive-abci/src/abci/handler/finalize_block.rs @@ -5,6 +5,7 @@ use crate::execution::types::block_execution_context::v0::BlockExecutionContextV use crate::platform_types::cleaned_abci_messages::finalized_block_cleaned_request::v0::FinalizeBlockCleanedRequest; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use std::sync::atomic::Ordering; use tenderdash_abci::proto::abci as proto; @@ -66,7 +67,30 @@ where )); } - app.commit_transaction(platform_version)?; + let result = app.commit_transaction(platform_version); + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + if app.platform().config.network == Network::Dash + && config.abci.chain_id == "evo1" + && block_height < 33000 + { + // Old behavior on mainnet below block 33000 + result?; + } else { + // In case if transaction commit failed we still have caches in memory that + // corresponds to the data that we weren't able to commit. + // The simplified solution is to restart the Drive, so all caches + // will be restored from the disk and try to process this block again. + // TODO: We need a better handling of the transaction is busy error with retry logic. + result.expect("commit transaction"); + } app.platform() .committed_block_height_guard diff --git a/packages/rs-drive-abci/src/abci/handler/info.rs b/packages/rs-drive-abci/src/abci/handler/info.rs index dbb85018913..9ac9d316267 100644 --- a/packages/rs-drive-abci/src/abci/handler/info.rs +++ b/packages/rs-drive-abci/src/abci/handler/info.rs @@ -3,6 +3,7 @@ use crate::abci::AbciError; use crate::error::Error; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use dpp::version::DESIRED_PLATFORM_VERSION; use tenderdash_abci::proto::abci as proto; @@ -21,19 +22,58 @@ where let platform_state = app.platform().state.load(); - let state_app_hash = platform_state + let last_block_height = platform_state.last_committed_block_height() as i64; + + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state .last_committed_block_app_hash() - .map(|app_hash| app_hash.to_vec()) .unwrap_or_default(); + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(config.network == Network::Dash + && config.abci.chain_id == "evo1" + && last_block_height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let desired_protocol_version = DESIRED_PLATFORM_VERSION.protocol_version; let response = proto::ResponseInfo { data: "".to_string(), app_version: desired_protocol_version as u64, - last_block_height: platform_state.last_committed_block_height() as i64, + last_block_height, version: env!("CARGO_PKG_VERSION").to_string(), - last_block_app_hash: state_app_hash.clone(), + last_block_app_hash: platform_state_app_hash.to_vec(), }; tracing::debug!( @@ -41,8 +81,8 @@ where software_version = env!("CARGO_PKG_VERSION"), block_version = request.block_version, p2p_version = request.p2p_version, - app_hash = hex::encode(state_app_hash), - height = platform_state.last_committed_block_height(), + app_hash = hex::encode(platform_state_app_hash), + last_block_height, "Handshake with consensus engine", ); diff --git a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs index 18252d0d451..61f58a01960 100644 --- a/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs +++ b/packages/rs-drive-abci/src/abci/handler/prepare_proposal.rs @@ -11,6 +11,7 @@ use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; use crate::rpc::core::CoreRPCLike; use dpp::dashcore::hashes::Hash; +use dpp::dashcore::Network; use dpp::version::TryIntoPlatformVersioned; use drive::grovedb_storage::Error::RocksDBError; use tenderdash_abci::proto::abci as proto; @@ -35,6 +36,48 @@ where let platform_state = app.platform().state.load(); + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state + .last_committed_block_app_hash() + .unwrap_or_default(); + + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(config.network == Network::Dash + && config.abci.chain_id == "evo1" + && request.height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let last_committed_core_height = platform_state.last_committed_core_height(); let starting_platform_version = platform_state.current_platform_version()?; diff --git a/packages/rs-drive-abci/src/abci/handler/process_proposal.rs b/packages/rs-drive-abci/src/abci/handler/process_proposal.rs index 5bf547e14a7..d40567d3db2 100644 --- a/packages/rs-drive-abci/src/abci/handler/process_proposal.rs +++ b/packages/rs-drive-abci/src/abci/handler/process_proposal.rs @@ -12,6 +12,7 @@ use crate::platform_types::block_execution_outcome; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; use crate::rpc::core::CoreRPCLike; +use dpp::dashcore::Network; use dpp::version::TryIntoPlatformVersioned; use drive::grovedb_storage::Error::RocksDBError; use tenderdash_abci::proto::abci as proto; @@ -179,6 +180,48 @@ where let platform_state = app.platform().state.load(); + // Verify that Platform State corresponds to Drive commited state + let platform_state_app_hash = platform_state + .last_committed_block_app_hash() + .unwrap_or_default(); + + let grove_version = &platform_state + .current_platform_version()? + .drive + .grove_version; + + let drive_storage_root_hash = app + .platform() + .drive + .grove + .root_hash(None, grove_version) + .unwrap()?; + + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state and updating the cache. + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable these fixes at the block when we consider the state is consistent. + let config = &app.platform().config; + + #[allow(clippy::collapsible_if)] + if !(app.platform().config.network == Network::Dash + && config.abci.chain_id == "evo1" + && request.height < 33000) + { + // App hash in memory must be equal to app hash on disk + if drive_storage_root_hash != platform_state_app_hash { + // We panic because we can't recover from this situation. + // Better to restart the Drive, so we might self-heal the node + // reloading state form the disk + panic!( + "drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}", + drive_storage_root_hash, platform_state_app_hash + ); + } + } + let starting_platform_version = platform_state.current_platform_version()?; // Running the proposal executes all the state transitions for the block From 306b86cb35fce29bec2c94a660c3923bf13bedd6 Mon Sep 17 00:00:00 2001 From: QuantumExplorer Date: Mon, 4 Nov 2024 12:31:37 +0100 Subject: [PATCH 03/40] fix(drive): apply batch is not using transaction in `remove_all_votes_given_by_identities` (#2309) Co-authored-by: Ivan Shumkov --- .../mod.rs | 3 +++ .../v0/mod.rs | 5 ++++ .../voting/run_dao_platform_events/v0/mod.rs | 1 + .../state_transitions/masternode_vote/mod.rs | 1 + .../mod.rs | 8 +++++++ .../v0/mod.rs | 24 +++++++++++++++++-- 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs index 8328eb0fc1c..ffd97c42929 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/mod.rs @@ -3,6 +3,7 @@ use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; @@ -14,6 +15,7 @@ where /// Removes the votes for removed masternodes pub(in crate::execution) fn remove_votes_for_removed_masternodes( &self, + block_info: &BlockInfo, last_committed_platform_state: &PlatformState, block_platform_state: &PlatformState, transaction: TransactionArg, @@ -26,6 +28,7 @@ where .remove_votes_for_removed_masternodes { 0 => self.remove_votes_for_removed_masternodes_v0( + block_info, last_committed_platform_state, block_platform_state, transaction, diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs index b0081570c75..04931a3928e 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/remove_votes_for_removed_masternodes/v0/mod.rs @@ -3,6 +3,7 @@ use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::platform_state::PlatformState; use crate::rpc::core::CoreRPCLike; +use dpp::block::block_info::BlockInfo; use dpp::dashcore::hashes::Hash; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; @@ -14,6 +15,7 @@ where /// Removes the votes for removed masternodes pub(super) fn remove_votes_for_removed_masternodes_v0( &self, + block_info: &BlockInfo, last_committed_platform_state: &PlatformState, block_platform_state: &PlatformState, transaction: TransactionArg, @@ -29,6 +31,9 @@ where .iter() .map(|pro_tx_hash| pro_tx_hash.as_byte_array().to_vec()) .collect(), + block_info.height, + self.config.network, + self.config.abci.chain_id.as_str(), transaction, platform_version, )?; diff --git a/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs index 2ea9357af14..57fbe635b22 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/voting/run_dao_platform_events/v0/mod.rs @@ -21,6 +21,7 @@ where // Remove any votes that self.remove_votes_for_removed_masternodes( + block_info, last_committed_platform_state, block_platform_state, transaction, diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs index fe7d8095b87..9d0394c4420 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs @@ -11287,6 +11287,7 @@ mod tests { platform .remove_votes_for_removed_masternodes( + &BlockInfo::default(), &platform_state_before_masternode_identity_removals, &block_platform_state, Some(&transaction), diff --git a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs index 0f5e0d96040..f93d92a424d 100644 --- a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs +++ b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/mod.rs @@ -5,6 +5,8 @@ use crate::drive::Drive; use crate::error::drive::DriveError; use crate::error::Error; +use dpp::dashcore::Network; +use dpp::prelude::BlockHeight; use dpp::version::PlatformVersion; use grovedb::TransactionArg; @@ -14,6 +16,9 @@ impl Drive { pub fn remove_all_votes_given_by_identities( &self, identity_ids_as_byte_arrays: Vec>, + block_height: BlockHeight, + network: Network, + chain_id: &str, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { @@ -26,6 +31,9 @@ impl Drive { { 0 => self.remove_all_votes_given_by_identities_v0( identity_ids_as_byte_arrays, + block_height, + network, + chain_id, transaction, platform_version, ), diff --git a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs index 3c36b0ec647..81b3d0fab7b 100644 --- a/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs +++ b/packages/rs-drive/src/drive/votes/cleanup/remove_all_votes_given_by_identities/v0/mod.rs @@ -11,7 +11,8 @@ use crate::drive::votes::paths::{ use crate::drive::votes::storage_form::contested_document_resource_reference_storage_form::ContestedDocumentResourceVoteReferenceStorageForm; use crate::query::QueryItem; use crate::util::grove_operations::BatchDeleteApplyType; -use dpp::prelude::Identifier; +use dpp::dashcore::Network; +use dpp::prelude::{BlockHeight, Identifier}; use dpp::version::PlatformVersion; use grovedb::query_result_type::QueryResultType::QueryPathKeyElementTrioResultType; use grovedb::{PathQuery, Query, SizedQuery, TransactionArg}; @@ -22,6 +23,9 @@ impl Drive { pub(super) fn remove_all_votes_given_by_identities_v0( &self, identity_ids_as_byte_arrays: Vec>, + block_height: BlockHeight, + network: Network, + chain_id: &str, transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result<(), Error> { @@ -112,9 +116,25 @@ impl Drive { } if !deletion_batch.is_empty() { + // We had a sequence of errors on the mainnet started since block 32326. + // We got RocksDB's "transaction is busy" error because of a bug (https://github.com/dashpay/platform/pull/2309). + // Due to another bug in Tenderdash (https://github.com/dashpay/tenderdash/pull/966), + // validators just proceeded to the next block partially committing the state + // and updating the cache (https://github.com/dashpay/platform/pull/2305). + // Full nodes are stuck and proceeded after re-sync. + // For the mainnet chain, we enable this fix at the block when we consider the state is consistent. + let transaction = + if network == Network::Dash && chain_id == "evo1" && block_height < 33000 { + // Old behaviour on mainnet + None + } else { + // We should use transaction + transaction + }; + self.apply_batch_low_level_drive_operations( None, - None, + transaction, deletion_batch, &mut vec![], &platform_version.drive, From 99fe5fa402ddcae329795bb29eaf73fd5044b4f2 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Mon, 4 Nov 2024 23:16:36 +0700 Subject: [PATCH 04/40] add comment --- packages/strategy-tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strategy-tests/src/lib.rs b/packages/strategy-tests/src/lib.rs index 65e8a51f851..c2d81ea9905 100644 --- a/packages/strategy-tests/src/lib.rs +++ b/packages/strategy-tests/src/lib.rs @@ -1312,7 +1312,7 @@ impl Strategy { &sender.0, &recipient.0, identity_nonce_counter, - signer, // Does this mean the loaded identity must be the sender since we're signing with it? + signer, // This means the TUI loaded identity must always be the sender since we're always signing with it for now transfer_info.amount, ); operations.push(state_transition); From 0d3e091a5591fde03dbfd8e501864b5ffa2e3602 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 5 Nov 2024 13:07:49 +0700 Subject: [PATCH 05/40] comment --- packages/rs-drive-abci/tests/strategy_tests/strategy.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs index 4d1a7ccb624..bf3235ea788 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/strategy.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/strategy.rs @@ -404,6 +404,8 @@ impl NetworkStrategy { ); state_transitions.append(&mut new_transitions); } + // Extend the state transitions with the strategy's hard coded start identities + // Filtering out the ones that have no create transition if !self.strategy.start_identities.hard_coded.is_empty() { state_transitions.extend( self.strategy.start_identities.hard_coded.iter().filter_map( From e4215145ad7889300810472c5a91f15ae987c1eb Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 5 Nov 2024 13:16:38 +0700 Subject: [PATCH 06/40] use into_iter instead of iter --- .../tests/strategy_tests/main.rs | 4 ++-- .../tests/strategy_tests/voting_tests.rs | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index f2122d627ef..03bb92bc1ad 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -2603,8 +2603,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let strategy = NetworkStrategy { diff --git a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs index 2264a4cd5fb..83834520c0c 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs @@ -87,8 +87,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let dpns_contract = platform @@ -375,8 +375,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let dpns_contract = platform @@ -651,8 +651,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let dpns_contract = platform @@ -1008,8 +1008,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let dpns_contract = platform @@ -1377,8 +1377,8 @@ mod tests { &mut rng, platform_version, ) - .iter() - .map(|(identity, transition)| (identity.clone(), Some(transition.clone()))) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) .collect(); let dpns_contract = platform From 3d941ec5ab7f947e53d41c68eb5758ff2e0bd074 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 5 Nov 2024 13:31:07 +0700 Subject: [PATCH 07/40] use current identities instead of hardcoded start identities --- packages/strategy-tests/src/lib.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/strategy-tests/src/lib.rs b/packages/strategy-tests/src/lib.rs index c2d81ea9905..efdb702a482 100644 --- a/packages/strategy-tests/src/lib.rs +++ b/packages/strategy-tests/src/lib.rs @@ -1290,33 +1290,32 @@ impl Strategy { // Generate state transition for identity transfer operation OperationType::IdentityTransfer(identity_transfer_info) => { for _ in 0..count { + // Handle the case where specific sender, recipient, and amount are provided if let Some(transfer_info) = identity_transfer_info { - let sender = self - .start_identities - .hard_coded + let sender = current_identities .iter() - .find(|(identity, _)| identity.id() == transfer_info.from) + .find(|identity| identity.id() == transfer_info.from) .expect( "Expected to find sender identity in hardcoded start identities", ); - let recipient = self - .start_identities - .hard_coded + let recipient = current_identities .iter() - .find(|(identity, _)| identity.id() == transfer_info.to) + .find(|identity| identity.id() == transfer_info.to) .expect( "Expected to find recipient identity in hardcoded start identities", ); let state_transition = create_identity_credit_transfer_transition( - &sender.0, - &recipient.0, + &sender, + &recipient, identity_nonce_counter, - signer, // This means the TUI loaded identity must always be the sender since we're always signing with it for now + signer, // This means in the TUI, the loaded identity must always be the sender since we're always signing with it for now transfer_info.amount, ); operations.push(state_transition); } else if current_identities.len() > 1 { + // Handle the case where no sender, recipient, and amount are provided + let identities_count = current_identities.len(); if identities_count == 0 { break; From 4bc0a653de328adacae4e8e85ab6971c42984786 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 5 Nov 2024 16:19:48 +0700 Subject: [PATCH 08/40] let transfer keys be any security level or key type --- packages/strategy-tests/src/transitions.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strategy-tests/src/transitions.rs b/packages/strategy-tests/src/transitions.rs index c77b51e2903..a9cb113d83c 100644 --- a/packages/strategy-tests/src/transitions.rs +++ b/packages/strategy-tests/src/transitions.rs @@ -824,8 +824,8 @@ pub fn create_identity_credit_transfer_transition( let identity_public_key = identity .get_first_public_key_matching( Purpose::TRANSFER, - HashSet::from([SecurityLevel::CRITICAL]), - HashSet::from([KeyType::ECDSA_SECP256K1, KeyType::BLS12_381]), + SecurityLevel::full_range().into(), + KeyType::all_key_types().into(), false, ) .expect("expected to get a signing key"); From dc4882725f6ed6f7a6e4bc8835d84d95bd4ec41f Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Tue, 5 Nov 2024 17:44:37 +0700 Subject: [PATCH 09/40] fix --- packages/strategy-tests/src/transitions.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strategy-tests/src/transitions.rs b/packages/strategy-tests/src/transitions.rs index a9cb113d83c..c77b51e2903 100644 --- a/packages/strategy-tests/src/transitions.rs +++ b/packages/strategy-tests/src/transitions.rs @@ -824,8 +824,8 @@ pub fn create_identity_credit_transfer_transition( let identity_public_key = identity .get_first_public_key_matching( Purpose::TRANSFER, - SecurityLevel::full_range().into(), - KeyType::all_key_types().into(), + HashSet::from([SecurityLevel::CRITICAL]), + HashSet::from([KeyType::ECDSA_SECP256K1, KeyType::BLS12_381]), false, ) .expect("expected to get a signing key"); From ae97f47b72a9e5a1c914469107865cb971929878 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Wed, 6 Nov 2024 21:56:50 +0700 Subject: [PATCH 10/40] ci: run devcontainers workflow only on push to master (#2295) --- .github/workflows/prebuild-devcontainers.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prebuild-devcontainers.yml b/.github/workflows/prebuild-devcontainers.yml index 794fa3d4a56..1825985c82a 100644 --- a/.github/workflows/prebuild-devcontainers.yml +++ b/.github/workflows/prebuild-devcontainers.yml @@ -7,6 +7,8 @@ on: - '.github/workflows/prebuild-devcontainers.yml' - rust-toolchain.toml - Dockerfile + branches: + - master workflow_dispatch: concurrency: From 48cca1a319505ff7abda72c9a3bb87883d6e8a07 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Wed, 6 Nov 2024 21:57:07 +0700 Subject: [PATCH 11/40] ci: do not run test on push (#2308) --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c823d0cd061..cca5f1c471d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,12 +7,6 @@ on: branches: - master - 'v[0-9]+\.[0-9]+-dev' - push: - branches: - - master - - 'v[0-9]+\.[0-9]+-dev' - schedule: - - cron: "30 4 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 7315c919139248e546a2078c058993ebac350d1d Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Thu, 31 Oct 2024 12:45:28 -0700 Subject: [PATCH 12/40] feat: add wallet contract --- Cargo.lock | 681 +++++++++--------- Cargo.toml | 1 + config/local_seed.json | 5 + local_seed | 0 packages/wallet-contract/.eslintrc | 18 + packages/wallet-contract/.mocharc.yml | 2 + packages/wallet-contract/Cargo.toml | 13 + packages/wallet-contract/LICENSE | 20 + packages/wallet-contract/README.md | 33 + packages/wallet-contract/lib/systemIds.js | 4 + packages/wallet-contract/package.json | 29 + .../schema/v1/wallet-contract-documents.json | 125 ++++ packages/wallet-contract/src/error.rs | 17 + packages/wallet-contract/src/lib.rs | 37 + packages/wallet-contract/src/v1/mod.rs | 19 + packages/wallet-contract/test/.eslintrc | 12 + packages/wallet-contract/test/bootstrap.js | 30 + .../test/unit/walletContract.spec.js | 335 +++++++++ 18 files changed, 1046 insertions(+), 335 deletions(-) create mode 100644 config/local_seed.json create mode 100644 local_seed create mode 100644 packages/wallet-contract/.eslintrc create mode 100644 packages/wallet-contract/.mocharc.yml create mode 100644 packages/wallet-contract/Cargo.toml create mode 100644 packages/wallet-contract/LICENSE create mode 100644 packages/wallet-contract/README.md create mode 100644 packages/wallet-contract/lib/systemIds.js create mode 100644 packages/wallet-contract/package.json create mode 100644 packages/wallet-contract/schema/v1/wallet-contract-documents.json create mode 100644 packages/wallet-contract/src/error.rs create mode 100644 packages/wallet-contract/src/lib.rs create mode 100644 packages/wallet-contract/src/v1/mod.rs create mode 100644 packages/wallet-contract/test/.eslintrc create mode 100644 packages/wallet-contract/test/bootstrap.js create mode 100644 packages/wallet-contract/test/unit/walletContract.spec.js diff --git a/Cargo.lock b/Cargo.lock index c59d07d2b49..b25656807da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,19 +4,13 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -97,9 +91,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -112,43 +106,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "arbitrary" @@ -167,9 +161,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -196,9 +190,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -207,13 +201,13 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -224,7 +218,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -235,15 +229,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.5" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", "axum-core", @@ -268,17 +262,17 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "tokio", - "tower", - "tower-layer", - "tower-service", + "tower 0.5.1", + "tower-layer 0.3.3", + "tower-service 0.3.3", "tracing", ] [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -289,22 +283,21 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", + "sync_wrapper 1.0.1", + "tower-layer 0.3.3", + "tower-service 0.3.3", "tracing", ] [[package]] name = "axum-macros" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" +checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ - "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -320,17 +313,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -401,15 +394,15 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.75", + "syn 2.0.85", "which", ] [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags 2.6.0", "cexpr", @@ -422,7 +415,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -500,7 +493,7 @@ dependencies = [ "arrayvec", "cc", "cfg-if", - "constant_time_eq 0.3.0", + "constant_time_eq 0.3.1", ] [[package]] @@ -550,10 +543,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "syn_derive", ] @@ -608,9 +601,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -644,9 +637,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.14" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -770,9 +763,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -780,9 +773,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -792,14 +785,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -810,9 +803,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -835,9 +828,9 @@ dependencies = [ [[package]] name = "console-api" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ed14aa9c9f927213c6e4f3ef75faaad3406134efe84ba2cb7983431d5f0931" +checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857" dependencies = [ "futures-core", "prost", @@ -848,9 +841,9 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e3a111a37f3333946ebf9da370ba5c5577b18eb342ec683eb488dd21980302" +checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01" dependencies = [ "console-api", "crossbeam-channel", @@ -886,9 +879,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -914,9 +907,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1040,7 +1033,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1064,9 +1057,9 @@ name = "dapi-grpc-macros" version = "1.5.0" dependencies = [ "dapi-grpc", - "heck 0.5.0", + "heck", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1090,7 +1083,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1101,7 +1094,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1237,13 +1230,13 @@ dependencies = [ [[package]] name = "delegate" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5060bb0febb73fa907273f8a7ed17ab4bf831d585eac835b28ec24a1e2460956" +checksum = "bc2323e10c92e1cf4d86e11538512e6dc03ceb586842970b6332af3d4046a046" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1274,7 +1267,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1287,7 +1280,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1307,7 +1300,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "unicode-xid", ] @@ -1336,7 +1329,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1580,9 +1573,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1604,7 +1597,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -1718,15 +1711,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ "bit-set", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "feature-flags-contract" @@ -1762,12 +1755,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1785,6 +1778,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1839,9 +1838,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1854,9 +1853,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1864,15 +1863,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1881,38 +1880,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1951,9 +1950,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -2111,7 +2110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "921b9a29facf9d3f0de667cd1da083a34695ede9e7bfacd74bb5bd29f8f7c178" dependencies = [ "serde", - "serde_with 3.9.0", + "serde_with 3.11.0", ] [[package]] @@ -2165,7 +2164,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", - "allocator-api2", ] [[package]] @@ -2173,6 +2171,11 @@ name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "hdrhistogram" @@ -2187,12 +2190,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -2311,9 +2308,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2329,9 +2326,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -2350,9 +2347,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -2362,7 +2359,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls", - "tower-service", + "tower-service 0.3.3", ] [[package]] @@ -2375,7 +2372,7 @@ dependencies = [ "hyper-util", "pin-project-lite", "tokio", - "tower-service", + "tower-service 0.3.3", ] [[package]] @@ -2391,14 +2388,14 @@ dependencies = [ "native-tls", "tokio", "tokio-native-tls", - "tower-service", + "tower-service 0.3.3", ] [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -2409,8 +2406,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", - "tower-service", + "tower-service 0.3.3", "tracing", ] @@ -2501,9 +2497,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -2663,9 +2659,9 @@ checksum = "744a4c881f502e98c2241d2e5f50040ac73b30194d64452bb6260393b53f0dc9" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libloading" @@ -2683,7 +2679,7 @@ version = "0.16.0+8.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce3d60bc059831dc1c83903fb45c103f75db65c5a7bf22272764d9cc683e348c" dependencies = [ - "bindgen 0.69.4", + "bindgen 0.69.5", "bzip2-sys", "cc", "glob", @@ -2695,9 +2691,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -2734,18 +2730,18 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] name = "lz4-sys" -version = "1.10.0" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -2849,15 +2845,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2902,7 +2889,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3037,7 +3024,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3126,26 +3113,26 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "object" -version = "0.36.3" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -3155,9 +3142,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -3176,7 +3163,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3187,9 +3174,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -3205,9 +3192,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -3285,29 +3272,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -3327,9 +3314,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "platform-serialization" @@ -3345,7 +3332,7 @@ version = "1.5.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "virtue 0.0.17", ] @@ -3375,7 +3362,7 @@ name = "platform-value-convertible" version = "1.5.0" dependencies = [ "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3395,7 +3382,7 @@ version = "1.5.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3413,24 +3400,24 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -3485,12 +3472,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -3505,11 +3492,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.22", ] [[package]] @@ -3537,18 +3524,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -3556,12 +3543,12 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", - "heck 0.5.0", + "heck", "itertools 0.13.0", "log", "multimap", @@ -3571,28 +3558,28 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.75", + "syn 2.0.85", "tempfile", ] [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ "prost", ] @@ -3679,9 +3666,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.1.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ "bitflags 2.6.0", ] @@ -3708,23 +3695,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -3738,13 +3725,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -3755,9 +3742,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rend" @@ -3813,7 +3800,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tower-service", + "tower-service 0.3.3", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3935,18 +3922,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -3957,9 +3944,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "log", "once_cell", @@ -3985,25 +3972,24 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -4012,9 +3998,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -4043,11 +4029,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4098,9 +4084,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4114,9 +4100,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -4142,20 +4128,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.126" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b863381a05ffefbc82571a2d893edf47b27fb0ebedbf582c39640e51abebef" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "indexmap 2.6.0", "itoa", @@ -4182,14 +4168,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -4224,9 +4210,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -4236,7 +4222,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros 3.9.0", + "serde_with_macros 3.11.0", "time", ] @@ -4249,19 +4235,19 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4327,9 +4313,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "simple-signer" @@ -4437,11 +4423,11 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4472,9 +4458,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -4490,7 +4476,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4555,9 +4541,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -4654,7 +4640,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4665,28 +4651,28 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "test-case-core", ] [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4757,9 +4743,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -4782,7 +4768,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4852,7 +4838,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit 0.22.22", ] [[package]] @@ -4877,26 +4863,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.6.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow 0.6.20", ] [[package]] @@ -4926,24 +4901,25 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tower", - "tower-layer", - "tower-service", + "tower 0.4.13", + "tower-layer 0.3.3", + "tower-service 0.3.3", "tracing", "webpki-roots", ] [[package]] name = "tonic-build" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568392c5a2bd0020723e3f387891176aabafe36fd9fcd074ad309dfa0c8eb964" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -4960,8 +4936,24 @@ dependencies = [ "slab", "tokio", "tokio-util", - "tower-layer", - "tower-service", + "tower-layer 0.3.2", + "tower-service 0.3.2", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", + "tower-layer 0.3.3", + "tower-service 0.3.3", "tracing", ] @@ -4985,8 +4977,8 @@ dependencies = [ "pin-project-lite", "tokio", "tokio-util", - "tower-layer", - "tower-service", + "tower-layer 0.3.3", + "tower-service 0.3.3", "tracing", ] @@ -4995,11 +4987,23 @@ name = "tower-layer" version = "0.3.2" source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.2" source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.40" @@ -5020,7 +5024,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -5101,39 +5105,36 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "untrusted" @@ -5176,9 +5177,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", @@ -5235,6 +5236,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wallet-contract" +version = "1.4.1" +dependencies = [ + "platform-value", + "platform-version", + "serde_json", + "thiserror", +] + [[package]] name = "want" version = "0.3.1" @@ -5271,7 +5282,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -5305,7 +5316,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5363,9 +5374,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -5611,9 +5622,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -5664,7 +5675,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] @@ -5685,7 +5696,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.85", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ab03e80fb4b..3c79f70f09e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ members = [ "packages/simple-signer", "packages/rs-json-schema-compatibility-validator", "packages/check-features", + "packages/wallet-contract" ] [workspace.package] diff --git a/config/local_seed.json b/config/local_seed.json new file mode 100644 index 00000000000..fac88f73206 --- /dev/null +++ b/config/local_seed.json @@ -0,0 +1,5 @@ +{ + "seeds": [ + "127.0.0.1" + ] +} \ No newline at end of file diff --git a/local_seed b/local_seed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/wallet-contract/.eslintrc b/packages/wallet-contract/.eslintrc new file mode 100644 index 00000000000..cb6c7636b60 --- /dev/null +++ b/packages/wallet-contract/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": "airbnb-base", + "rules": { + "no-plusplus": 0, + "eol-last": [ + "error", + "always" + ], + "class-methods-use-this": "off", + "curly": [ + "error", + "all" + ] + }, + "globals": { + "BigInt": true + } +} diff --git a/packages/wallet-contract/.mocharc.yml b/packages/wallet-contract/.mocharc.yml new file mode 100644 index 00000000000..164b941c1b6 --- /dev/null +++ b/packages/wallet-contract/.mocharc.yml @@ -0,0 +1,2 @@ +require: test/bootstrap.js +recursive: true diff --git a/packages/wallet-contract/Cargo.toml b/packages/wallet-contract/Cargo.toml new file mode 100644 index 00000000000..cb987cb3c27 --- /dev/null +++ b/packages/wallet-contract/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "wallet-contract" +description = "Wallet data contract schema and tools" +version = "1.4.1" +edition = "2021" +rust-version.workspace = true +license = "MIT" + +[dependencies] +thiserror = "1.0.64" +platform-version = { path = "../rs-platform-version" } +serde_json = { version = "1.0" } +platform-value = { path = "../rs-platform-value" } diff --git a/packages/wallet-contract/LICENSE b/packages/wallet-contract/LICENSE new file mode 100644 index 00000000000..3be95833750 --- /dev/null +++ b/packages/wallet-contract/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 Dash Core Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/wallet-contract/README.md b/packages/wallet-contract/README.md new file mode 100644 index 00000000000..be4b3a7eb6d --- /dev/null +++ b/packages/wallet-contract/README.md @@ -0,0 +1,33 @@ +# Wallet Contract + +[![Build Status](https://github.com/dashpay/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashpay/platform/actions/workflows/release.yml) +[![NPM version](https://img.shields.io/npm/v/@dashevo/dpns-contract.svg?style=flat-square)](https://npmjs.org/package/@dashevo/dpns-contract) + +JSON Contracts for Dash Wallet apps + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) +- [Contributing](#contributing) +- [License](#license) + +## Install + +```sh +npm install @dashevo/wallet-contract +``` + +## Usage + +```sh +# TODO ... +``` + +## Contributing + +Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs. + +## License + +[MIT](LICENSE) © Dash Core Group, Inc. diff --git a/packages/wallet-contract/lib/systemIds.js b/packages/wallet-contract/lib/systemIds.js new file mode 100644 index 00000000000..27b253c0d0d --- /dev/null +++ b/packages/wallet-contract/lib/systemIds.js @@ -0,0 +1,4 @@ +module.exports = { + ownerId: '11111111111111111111111111111111', + contractId: 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec' +}; diff --git a/packages/wallet-contract/package.json b/packages/wallet-contract/package.json new file mode 100644 index 00000000000..69fbd81b14f --- /dev/null +++ b/packages/wallet-contract/package.json @@ -0,0 +1,29 @@ +{ + "name": "@dashevo/wallet-contract", + "version": "1.4.1", + "description": "A contract and helper scripts for Wallet DApp", + "scripts": { + "lint": "eslint .", + "test": "yarn run test:unit", + "test:unit": "mocha 'test/unit/**/*.spec.js'" + }, + "contributors": [ + { + "name": "Eric Britten", + "email": "eric.britten@dash.org", + "url": "https://github.com/hashengineering" + } + ], + "license": "MIT", + "devDependencies": { + "@dashevo/wasm-dpp": "workspace:*", + "chai": "^4.3.10", + "dirty-chai": "^2.0.1", + "eslint": "^8.53.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.0", + "mocha": "^10.2.0", + "sinon": "^17.0.1", + "sinon-chai": "^3.7.0" + } +} diff --git a/packages/wallet-contract/schema/v1/wallet-contract-documents.json b/packages/wallet-contract/schema/v1/wallet-contract-documents.json new file mode 100644 index 00000000000..688c1045811 --- /dev/null +++ b/packages/wallet-contract/schema/v1/wallet-contract-documents.json @@ -0,0 +1,125 @@ +{ + "txMetadata": { + "type": "object", + "indices": [ + { + "name": "ownerId", + "properties": [ + { + "$ownerId": "asc" + } + ] + }, + { + "name": "ownerIdAndCreatedAt", + "properties": [ + { + "$ownerId": "asc" + }, + { + "$createdAt": "asc" + } + ] + } + ], + "properties": { + "keyIndex": { + "type": "integer", + "minimum": 0, + "description": "The index of the owners identity public key used to derive the encryption key.", + "position": 0 + }, + "encryptionKeyIndex": { + "type": "integer", + "minimum": 0, + "description": "The secondary index used to derive the encryption key that is used to encrypt and decrypt encryptedData.", + "position": 1 + }, + "encryptedMetadata": { + "type": "array", + "byteArray": true, + "minItems": 32, + "maxItems": 4096, + "description": "encrypted metadata using AES-CBC-256", + "position": 2 + } + }, + "required": [ + "keyIndex", + "encryptionKeyIndex", + "encryptedMetadata", + "$createdAt" + ], + "additionalProperties": false + }, + "identityVerify": { + "documentsMutable": true, + "canBeDeleted": true, + "type": "object", + "properties": { + "normalizedLabel": { + "position": 0, + "type": "string", + "pattern": "^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-]{0,61}[a-hj-km-np-z0-9]$", + "maxLength": 63, + "description": "Domain label converted to lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'b0b'", + "$comment": "Must match a domain document to provide further information. Must be equal to the label in lowercase. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\"." + }, + "normalizedParentDomainName": { + "type": "string", + "pattern": "^$|^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-\\.]{0,61}[a-hj-km-np-z0-9]$", + "minLength": 0, + "maxLength": 63, + "position": 1, + "description": "A parent domain name in lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'dash'", + "$comment": "Must either be equal to an existing domain or empty to create a top level domain. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\". Only the data contract owner can create top level domains." + }, + "url": { + "position": 2, + "type": "string", + "description": "The identity verification URL to be stored.", + "maxLength": 128, + "pattern": "^https?://.*", + "format": "uri" + } + }, + "indices": [ + { + "name": "ownerId", + "properties": [ + { + "$ownerId": "asc" + } + ] + }, + { + "name": "ownerId_NormDomainName_NormLabel", + "properties": [ + { + "$ownerId": "asc" + }, + { + "normalizedParentDomainName": "asc" + }, + { + "normalizedLabel": "asc" + } + ] + }, + { + "name": "uniqueUsernameIndex", + "properties": [ + { + "normalizedLabel": "asc" + } + ] + } + ], + "required": [ + "url", + "normalizedLabel", + "normalizedParentDomainName" + ], + "additionalProperties": false + } +} \ No newline at end of file diff --git a/packages/wallet-contract/src/error.rs b/packages/wallet-contract/src/error.rs new file mode 100644 index 00000000000..d01bbcc91cf --- /dev/null +++ b/packages/wallet-contract/src/error.rs @@ -0,0 +1,17 @@ +use platform_version::version::FeatureVersion; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + /// Platform expected some specific versions + #[error("platform unknown version on {method}, received: {received}")] + UnknownVersionMismatch { + /// method + method: String, + /// the allowed versions for this method + known_versions: Vec, + /// requested core height + received: FeatureVersion, + }, + #[error("schema deserialize error: {0}")] + InvalidSchemaJson(#[from] serde_json::Error), +} diff --git a/packages/wallet-contract/src/lib.rs b/packages/wallet-contract/src/lib.rs new file mode 100644 index 00000000000..0a418f06e9c --- /dev/null +++ b/packages/wallet-contract/src/lib.rs @@ -0,0 +1,37 @@ +mod error; +pub mod v1; + +pub use crate::error::Error; +use platform_value::{Identifier, IdentifierBytes32}; +use platform_version::version::PlatformVersion; +use serde_json::Value; + +pub const ID_BYTES: [u8; 32] = [ + 162, 48, 73, 255, 116, 241, 166, 155, 131, 121, 132, 39, 129, 40, 127, 6, 103, 164, 72, 139, + 143, 116, 163, 19, 81, 193, 38, 248, 116, 244, 59, 196 +]; + +pub const OWNER_ID_BYTES: [u8; 32] = [0; 32]; + +pub const ID: Identifier = Identifier(IdentifierBytes32(ID_BYTES)); +pub const OWNER_ID: Identifier = Identifier(IdentifierBytes32(OWNER_ID_BYTES)); +pub fn load_definitions(platform_version: &PlatformVersion) -> Result, Error> { + match platform_version.system_data_contracts.withdrawals { + 1 => Ok(None), + version => Err(Error::UnknownVersionMismatch { + method: "dpns_contract::load_definitions".to_string(), + known_versions: vec![1], + received: version, + }), + } +} +pub fn load_documents_schemas(platform_version: &PlatformVersion) -> Result { + match platform_version.system_data_contracts.withdrawals { + 1 => v1::load_documents_schemas(), + version => Err(Error::UnknownVersionMismatch { + method: "dpns_contract::load_documents_schemas".to_string(), + known_versions: vec![1], + received: version, + }), + } +} diff --git a/packages/wallet-contract/src/v1/mod.rs b/packages/wallet-contract/src/v1/mod.rs new file mode 100644 index 00000000000..4569ad779c4 --- /dev/null +++ b/packages/wallet-contract/src/v1/mod.rs @@ -0,0 +1,19 @@ +use crate::Error; +use serde_json::Value; + +pub mod document_types { + pub mod tx_metadata { + pub const NAME: &str = "tx_metadata"; + + pub mod properties { + pub const KEY_INDEX: &str = "keyIndex"; + pub const ENCRYPTION_KEY_INDEX: &str = "encryptionKeyIndex"; + pub const ENCRYPTED_METADATA: &str = "encryptedMetadata"; + } + } +} + +pub fn load_documents_schemas() -> Result { + serde_json::from_str(include_str!("../../schema/v1/wallet-contract-documents.json")) + .map_err(Error::InvalidSchemaJson) +} diff --git a/packages/wallet-contract/test/.eslintrc b/packages/wallet-contract/test/.eslintrc new file mode 100644 index 00000000000..720ced73852 --- /dev/null +++ b/packages/wallet-contract/test/.eslintrc @@ -0,0 +1,12 @@ +{ + "env": { + "node": true, + "mocha": true + }, + "rules": { + "import/no-extraneous-dependencies": "off" + }, + "globals": { + "expect": true + } +} diff --git a/packages/wallet-contract/test/bootstrap.js b/packages/wallet-contract/test/bootstrap.js new file mode 100644 index 00000000000..7af04f464d7 --- /dev/null +++ b/packages/wallet-contract/test/bootstrap.js @@ -0,0 +1,30 @@ +const sinon = require('sinon'); +const sinonChai = require('sinon-chai'); + +const { expect, use } = require('chai'); +const dirtyChai = require('dirty-chai'); + +const { + default: loadWasmDpp, +} = require('@dashevo/wasm-dpp'); + +use(dirtyChai); +use(sinonChai); + +exports.mochaHooks = { + beforeAll: loadWasmDpp, + + beforeEach() { + if (!this.sinon) { + this.sinon = sinon.createSandbox(); + } else { + this.sinon.restore(); + } + }, + + afterEach() { + this.sinon.restore(); + }, +}; + +global.expect = expect; diff --git a/packages/wallet-contract/test/unit/walletContract.spec.js b/packages/wallet-contract/test/unit/walletContract.spec.js new file mode 100644 index 00000000000..d796a3dc7ae --- /dev/null +++ b/packages/wallet-contract/test/unit/walletContract.spec.js @@ -0,0 +1,335 @@ +const crypto = require('crypto'); + +const { + DashPlatformProtocol, + JsonSchemaError, +} = require('@dashevo/wasm-dpp'); +const generateRandomIdentifier = require('@dashevo/wasm-dpp/lib/test/utils/generateRandomIdentifierAsync'); + +const { expect } = require('chai'); +const walletContractDocumentsSchema = require('../../schema/v1/wallet-contract-documents.json'); + +const expectJsonSchemaError = (validationResult, errorCount = 1) => { + const errors = validationResult.getErrors(); + expect(errors) + .to + .have + .length(errorCount); + + const error = validationResult.getErrors()[0]; + expect(error) + .to + .be + .instanceof(JsonSchemaError); + + return error; +}; + +describe('Wallet Contract', () => { + let dpp; + let dataContract; + let identityId; + + beforeEach(async () => { + dpp = new DashPlatformProtocol( + { generate: () => crypto.randomBytes(32) }, + ); + + identityId = await generateRandomIdentifier(); + + dataContract = dpp.dataContract.create(identityId, BigInt(1), walletContractDocumentsSchema); + }); + + it('should have a valid contract definition', async () => { + expect(() => dpp.dataContract.create(identityId, BigInt(1), walletContractDocumentsSchema)) + .to + .not + .throw(); + }); + + describe('documents', () => { + describe('txMetadata', () => { + let rawTxMetadataDocument; + + beforeEach(() => { + rawTxMetadataDocument = { + keyIndex: 0, + encryptionKeyIndex: 100, + encryptedMetadata: crypto.randomBytes(64), + }; + }); + + describe('keyIndex', () => { + it('should be defined', async () => { + delete rawTxMetadataDocument.keyIndex; + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('keyIndex'); + }); + }); + + describe('encryptionKeyIndex', () => { + it('should be defined', async () => { + delete rawTxMetadataDocument.encryptionKeyIndex; + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('encryptionKeyIndex'); + }); + }); + + describe('encryptedMetadata', () => { + it('should be defined', async () => { + delete rawTxMetadataDocument.encryptedMetadata; + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('encryptedMetadata'); + }); + + it('should be not shorter than 32 bytes', async () => { + rawTxMetadataDocument.encryptedMetadata = crypto.randomBytes(31); + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('maxItems'); + expect(error.instancePath) + .to + .equal('/encryptedMetadata'); + }); + + it('should be not longer than 4096 bytes', async () => { + rawTxMetadataDocument.encryptedMetadata = crypto.randomBytes(4097); + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('maxItems'); + expect(error.instancePath) + .to + .equal('/encryptedMetadata'); + }); + }); + + it('should not have additional properties', async () => { + rawTxMetadataDocument.someOtherProperty = 42; + + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('additionalProperties'); + expect(error.params.additionalProperties) + .to + .deep + .equal(['someOtherProperty']); + }); + + it('should be valid', async () => { + const txMetadata = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + + const result = await txMetadata.validate(dpp.protocolVersion); + + expect(result.isValid()) + .to + .be + .true(); + }); + }); + + describe('verifyIdentity', () => { + let rawIdentityVerifyDocument; + + beforeEach(async () => { + rawIdentityVerifyDocument = { + normalizedLabel: 'wa11et', // lower case and base58 chars only + normalizedParentDomainName: 'dash', + url: "https://dash.org" + }; + }); + + describe('normalizedLabel', () => { + it('should be defined', async () => { + delete rawIdentityVerifyDocument.normalizedLabel; + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('normalizedLabel'); + }); + + it('should follow pattern', async () => { + rawIdentityVerifyDocument.normalizedLabel = 'InValiD label'; + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/normalizedLabel'); + }); + + it('should be less than 63 chars', async () => { + rawIdentityVerifyDocument.normalizedLabel = 'a'.repeat(64); + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult, 2); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/normalizedLabel'); + }); + }); + + describe('normalizedParentDomainName', () => { + it('should be defined', async () => { + delete rawIdentityVerifyDocument.normalizedParentDomainName; + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('normalizedParentDomainName'); + }); + + it('should be less than 190 chars', async () => { + rawIdentityVerifyDocument.normalizedParentDomainName = 'a'.repeat(191); + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult, 2); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/normalizedParentDomainName'); + }); + + it('should follow pattern', async () => { + rawIdentityVerifyDocument.normalizedParentDomainName = '&'.repeat(50); + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/normalizedParentDomainName'); + }); + }); + + describe('url', () => { + it('should be defined', async () => { + delete rawIdentityVerifyDocument.url; + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('required'); + expect(error.params.missingProperty) + .to + .equal('url'); + }); + + it('should be less than 128 chars', async () => { + rawIdentityVerifyDocument.normalizedParentDomainName = 'a'.repeat(129); + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult, 2); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/url'); + }); + + it('should follow pattern', async () => { + rawIdentityVerifyDocument.url = '&'.repeat(50); + + const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + + expect(error.keyword) + .to + .equal('pattern'); + expect(error.instancePath) + .to + .equal('/url'); + }); + }); + + it('should be valid', async () => { + const domain = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); + + const result = await domain.validate(dpp.protocolVersion); + + expect(result.isValid()) + .to + .be + .true(); + }); + }); + }); +}); From 2e166479fd97db92b3555f2e358e103599d76fef Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 6 Nov 2024 15:13:14 -0800 Subject: [PATCH 13/40] fix: remove unnecessary file --- config/local_seed.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 config/local_seed.json diff --git a/config/local_seed.json b/config/local_seed.json deleted file mode 100644 index fac88f73206..00000000000 --- a/config/local_seed.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "seeds": [ - "127.0.0.1" - ] -} \ No newline at end of file From 08cb2e5cd340b6fc8c80a641cf10f51b7858d07d Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 6 Nov 2024 16:11:53 -0800 Subject: [PATCH 14/40] fix: set v1.5.1 --- packages/wallet-contract/Cargo.toml | 2 +- packages/wallet-contract/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/wallet-contract/Cargo.toml b/packages/wallet-contract/Cargo.toml index cb987cb3c27..9d5bb9c732d 100644 --- a/packages/wallet-contract/Cargo.toml +++ b/packages/wallet-contract/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "wallet-contract" description = "Wallet data contract schema and tools" -version = "1.4.1" +version = "1.5.0" edition = "2021" rust-version.workspace = true license = "MIT" diff --git a/packages/wallet-contract/package.json b/packages/wallet-contract/package.json index 69fbd81b14f..2602c430131 100644 --- a/packages/wallet-contract/package.json +++ b/packages/wallet-contract/package.json @@ -1,6 +1,6 @@ { "name": "@dashevo/wallet-contract", - "version": "1.4.1", + "version": "1.5.0", "description": "A contract and helper scripts for Wallet DApp", "scripts": { "lint": "eslint .", From e9b8601730ddfc3dcabe652c7f20c14d0323bff7 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 6 Nov 2024 16:14:43 -0800 Subject: [PATCH 15/40] fix: rename dpns_contract to wallet_contract --- packages/wallet-contract/README.md | 2 +- packages/wallet-contract/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/wallet-contract/README.md b/packages/wallet-contract/README.md index be4b3a7eb6d..d37046f14dc 100644 --- a/packages/wallet-contract/README.md +++ b/packages/wallet-contract/README.md @@ -1,7 +1,7 @@ # Wallet Contract [![Build Status](https://github.com/dashpay/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashpay/platform/actions/workflows/release.yml) -[![NPM version](https://img.shields.io/npm/v/@dashevo/dpns-contract.svg?style=flat-square)](https://npmjs.org/package/@dashevo/dpns-contract) +[![NPM version](https://img.shields.io/npm/v/@dashevo/wallet-contract.svg?style=flat-square)](https://npmjs.org/package/@dashevo/wallet-contract) JSON Contracts for Dash Wallet apps diff --git a/packages/wallet-contract/src/lib.rs b/packages/wallet-contract/src/lib.rs index 0a418f06e9c..fe281f9b2a6 100644 --- a/packages/wallet-contract/src/lib.rs +++ b/packages/wallet-contract/src/lib.rs @@ -19,7 +19,7 @@ pub fn load_definitions(platform_version: &PlatformVersion) -> Result Ok(None), version => Err(Error::UnknownVersionMismatch { - method: "dpns_contract::load_definitions".to_string(), + method: "wallet_contract::load_definitions".to_string(), known_versions: vec![1], received: version, }), @@ -29,7 +29,7 @@ pub fn load_documents_schemas(platform_version: &PlatformVersion) -> Result v1::load_documents_schemas(), version => Err(Error::UnknownVersionMismatch { - method: "dpns_contract::load_documents_schemas".to_string(), + method: "wallet_contract::load_documents_schemas".to_string(), known_versions: vec![1], received: version, }), From c265209f3333dee853396aa8872277297aa83d04 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 6 Nov 2024 16:21:09 -0800 Subject: [PATCH 16/40] tests: fix validation --- packages/wallet-contract/test/unit/walletContract.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/wallet-contract/test/unit/walletContract.spec.js b/packages/wallet-contract/test/unit/walletContract.spec.js index d796a3dc7ae..922a04c7e6c 100644 --- a/packages/wallet-contract/test/unit/walletContract.spec.js +++ b/packages/wallet-contract/test/unit/walletContract.spec.js @@ -118,7 +118,7 @@ describe('Wallet Contract', () => { expect(error.keyword) .to - .equal('maxItems'); + .equal('minBytes'); expect(error.instancePath) .to .equal('/encryptedMetadata'); @@ -290,7 +290,7 @@ describe('Wallet Contract', () => { }); it('should be less than 128 chars', async () => { - rawIdentityVerifyDocument.normalizedParentDomainName = 'a'.repeat(129); + rawIdentityVerifyDocument.url = 'a'.repeat(129); const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); const validationResult = document.validate(dpp.protocolVersion); From 644061257583fbba5cde40e629c370083458da35 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Thu, 21 Nov 2024 07:26:53 -0800 Subject: [PATCH 17/40] fix: remove identityVerify document and tests --- .../schema/v1/wallet-contract-documents.json | 70 -------- .../test/unit/walletContract.spec.js | 164 ------------------ 2 files changed, 234 deletions(-) diff --git a/packages/wallet-contract/schema/v1/wallet-contract-documents.json b/packages/wallet-contract/schema/v1/wallet-contract-documents.json index 688c1045811..7aa9dbfe951 100644 --- a/packages/wallet-contract/schema/v1/wallet-contract-documents.json +++ b/packages/wallet-contract/schema/v1/wallet-contract-documents.json @@ -51,75 +51,5 @@ "$createdAt" ], "additionalProperties": false - }, - "identityVerify": { - "documentsMutable": true, - "canBeDeleted": true, - "type": "object", - "properties": { - "normalizedLabel": { - "position": 0, - "type": "string", - "pattern": "^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-]{0,61}[a-hj-km-np-z0-9]$", - "maxLength": 63, - "description": "Domain label converted to lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'b0b'", - "$comment": "Must match a domain document to provide further information. Must be equal to the label in lowercase. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\"." - }, - "normalizedParentDomainName": { - "type": "string", - "pattern": "^$|^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-\\.]{0,61}[a-hj-km-np-z0-9]$", - "minLength": 0, - "maxLength": 63, - "position": 1, - "description": "A parent domain name in lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'dash'", - "$comment": "Must either be equal to an existing domain or empty to create a top level domain. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\". Only the data contract owner can create top level domains." - }, - "url": { - "position": 2, - "type": "string", - "description": "The identity verification URL to be stored.", - "maxLength": 128, - "pattern": "^https?://.*", - "format": "uri" - } - }, - "indices": [ - { - "name": "ownerId", - "properties": [ - { - "$ownerId": "asc" - } - ] - }, - { - "name": "ownerId_NormDomainName_NormLabel", - "properties": [ - { - "$ownerId": "asc" - }, - { - "normalizedParentDomainName": "asc" - }, - { - "normalizedLabel": "asc" - } - ] - }, - { - "name": "uniqueUsernameIndex", - "properties": [ - { - "normalizedLabel": "asc" - } - ] - } - ], - "required": [ - "url", - "normalizedLabel", - "normalizedParentDomainName" - ], - "additionalProperties": false } } \ No newline at end of file diff --git a/packages/wallet-contract/test/unit/walletContract.spec.js b/packages/wallet-contract/test/unit/walletContract.spec.js index 922a04c7e6c..f39514c4231 100644 --- a/packages/wallet-contract/test/unit/walletContract.spec.js +++ b/packages/wallet-contract/test/unit/walletContract.spec.js @@ -167,169 +167,5 @@ describe('Wallet Contract', () => { .true(); }); }); - - describe('verifyIdentity', () => { - let rawIdentityVerifyDocument; - - beforeEach(async () => { - rawIdentityVerifyDocument = { - normalizedLabel: 'wa11et', // lower case and base58 chars only - normalizedParentDomainName: 'dash', - url: "https://dash.org" - }; - }); - - describe('normalizedLabel', () => { - it('should be defined', async () => { - delete rawIdentityVerifyDocument.normalizedLabel; - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('required'); - expect(error.params.missingProperty) - .to - .equal('normalizedLabel'); - }); - - it('should follow pattern', async () => { - rawIdentityVerifyDocument.normalizedLabel = 'InValiD label'; - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/normalizedLabel'); - }); - - it('should be less than 63 chars', async () => { - rawIdentityVerifyDocument.normalizedLabel = 'a'.repeat(64); - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult, 2); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/normalizedLabel'); - }); - }); - - describe('normalizedParentDomainName', () => { - it('should be defined', async () => { - delete rawIdentityVerifyDocument.normalizedParentDomainName; - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('required'); - expect(error.params.missingProperty) - .to - .equal('normalizedParentDomainName'); - }); - - it('should be less than 190 chars', async () => { - rawIdentityVerifyDocument.normalizedParentDomainName = 'a'.repeat(191); - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult, 2); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/normalizedParentDomainName'); - }); - - it('should follow pattern', async () => { - rawIdentityVerifyDocument.normalizedParentDomainName = '&'.repeat(50); - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/normalizedParentDomainName'); - }); - }); - - describe('url', () => { - it('should be defined', async () => { - delete rawIdentityVerifyDocument.url; - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('required'); - expect(error.params.missingProperty) - .to - .equal('url'); - }); - - it('should be less than 128 chars', async () => { - rawIdentityVerifyDocument.url = 'a'.repeat(129); - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult, 2); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/url'); - }); - - it('should follow pattern', async () => { - rawIdentityVerifyDocument.url = '&'.repeat(50); - - const document = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - const validationResult = document.validate(dpp.protocolVersion); - const error = expectJsonSchemaError(validationResult); - - expect(error.keyword) - .to - .equal('pattern'); - expect(error.instancePath) - .to - .equal('/url'); - }); - }); - - it('should be valid', async () => { - const domain = dpp.document.create(dataContract, identityId, 'domain', rawIdentityVerifyDocument); - - const result = await domain.validate(dpp.protocolVersion); - - expect(result.isValid()) - .to - .be - .true(); - }); - }); }); }); From 91a830384143d7a4c16c8b9715cd8f298e438576 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 13:28:45 +0700 Subject: [PATCH 18/40] chore: remove junk --- .github/workflows/tests.yml | 6 ++++++ Cargo.lock | 2 +- local_seed | 0 3 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 local_seed diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5092d32ede8..c26e8e52894 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,12 @@ on: branches: - master - 'v[0-9]+\.[0-9]+-dev' + push: + branches: + - master + - 'v[0-9]+\.[0-9]+-dev' + schedule: + - cron: "30 4 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/Cargo.lock b/Cargo.lock index b25656807da..e0424e42e16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5238,7 +5238,7 @@ dependencies = [ [[package]] name = "wallet-contract" -version = "1.4.1" +version = "1.5.0" dependencies = [ "platform-value", "platform-version", diff --git a/local_seed b/local_seed deleted file mode 100644 index e69de29bb2d..00000000000 From 19fbb5167b2536a9fb36745ba354a75d2adc172b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:04:00 +0700 Subject: [PATCH 19/40] chore: create wallet contract --- Cargo.lock | 785 +++++++++++------- Cargo.toml | 1 + packages/data-contracts/Cargo.toml | 1 + packages/data-contracts/src/error.rs | 17 + packages/data-contracts/src/lib.rs | 9 + .../v0/mod.rs | 46 + .../system_data_contract_versions/mod.rs | 1 + .../system_data_contract_versions/v1.rs | 1 + 8 files changed, 574 insertions(+), 287 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0424e42e16..c02531fc62a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "android-tzdata" @@ -91,9 +91,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -140,15 +140,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -207,7 +207,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -218,7 +218,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -235,9 +235,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.7" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", @@ -260,11 +260,11 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", - "tower 0.5.1", - "tower-layer 0.3.3", - "tower-service 0.3.3", + "tower", + "tower-layer", + "tower-service", "tracing", ] @@ -283,9 +283,9 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", - "tower-layer 0.3.3", - "tower-service 0.3.3", + "sync_wrapper", + "tower-layer", + "tower-service", "tracing", ] @@ -297,14 +297,14 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "backon" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4fa97bb310c33c811334143cf64c5bb2b7b3c06e453db6b095d7061eff8f113" +checksum = "ba5289ec98f68f28dd809fd601059e6aa908bb8f6108620930828283d4ee23d7" dependencies = [ "fastrand", "gloo-timers", @@ -394,7 +394,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.85", + "syn 2.0.89", "which", ] @@ -415,7 +415,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -425,7 +425,7 @@ source = "git+https://github.com/dashpay/rs-bip37-bloom-filter?branch=develop#35 dependencies = [ "bitvec", "murmur3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -445,9 +445,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitcoin-io" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" [[package]] name = "bitcoin_hashes" @@ -528,9 +528,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" dependencies = [ "borsh-derive", "cfg_aliases", @@ -538,16 +538,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" dependencies = [ "once_cell", "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.85", - "syn_derive", + "syn 2.0.89", ] [[package]] @@ -637,9 +636,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", @@ -763,9 +762,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -773,9 +772,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -792,14 +791,14 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "colorchoice" @@ -899,6 +898,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -907,9 +916,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -1033,7 +1042,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1059,7 +1068,7 @@ dependencies = [ "dapi-grpc", "heck", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1083,7 +1092,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1094,7 +1103,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1128,7 +1137,7 @@ dependencies = [ "serde", "serde_json", "test-case", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-test", "tokio-util", @@ -1210,7 +1219,7 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1224,7 +1233,8 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", + "wallet-contract", "withdrawals-contract", ] @@ -1236,7 +1246,7 @@ checksum = "bc2323e10c92e1cf4d86e11538512e6dc03ceb586842970b6332af3d4046a046" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1261,13 +1271,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1280,7 +1290,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1300,7 +1310,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "unicode-xid", ] @@ -1329,7 +1339,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1351,7 +1361,7 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1400,7 +1410,7 @@ dependencies = [ "sha2", "strum", "test-case", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -1441,7 +1451,7 @@ dependencies = [ "serde_json", "sqlparser", "tempfile", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1491,7 +1501,7 @@ dependencies = [ "strategy-tests", "tempfile", "tenderdash-abci", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -1515,7 +1525,7 @@ dependencies = [ "serde", "serde_json", "tenderdash-abci", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1526,7 +1536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9c8d6ea916fadcd87e3d1ff4802b696d717c83519b47e76f267ab77e536dd5a" dependencies = [ "ed-derive", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1597,7 +1607,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1701,7 +1711,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -1711,15 +1721,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ "bit-set", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "feature-flags-contract" @@ -1728,7 +1738,7 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1755,9 +1765,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1892,7 +1902,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -2000,7 +2010,7 @@ dependencies = [ "reqwest", "sha2", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tower-http", @@ -2015,7 +2025,7 @@ checksum = "360f7c8d3b20beafcbf3cde8754bbcfd201ae2a30ec7594a4b9678fd2fa3c7a8" dependencies = [ "integer-encoding", "intmap", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2028,7 +2038,7 @@ dependencies = [ "hex", "integer-encoding", "intmap", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2053,7 +2063,7 @@ dependencies = [ "integer-encoding", "num_cpus", "rand", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -2080,7 +2090,7 @@ dependencies = [ "rocksdb", "strum", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2089,7 +2099,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4be0c1a1ef97068fe93212e7b6f349e0b44a9fc90063c8c28e110cfb8c2fcb2" dependencies = [ - "thiserror", + "thiserror 1.0.69", "versioned-feature-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2115,9 +2125,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -2168,9 +2178,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" dependencies = [ "allocator-api2", "equivalent", @@ -2326,9 +2336,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -2359,20 +2369,20 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls", - "tower-service 0.3.3", + "tower-service", ] [[package]] name = "hyper-timeout" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ "hyper", "hyper-util", "pin-project-lite", "tokio", - "tower-service 0.3.3", + "tower-service", ] [[package]] @@ -2388,7 +2398,7 @@ dependencies = [ "native-tls", "tokio", "tokio-native-tls", - "tower-service 0.3.3", + "tower-service", ] [[package]] @@ -2406,7 +2416,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower-service 0.3.3", + "tower-service", "tracing", ] @@ -2433,6 +2443,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2441,12 +2569,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2467,7 +2606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "serde", ] @@ -2556,9 +2695,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" [[package]] name = "jobserver" @@ -2586,7 +2725,7 @@ checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" dependencies = [ "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2598,7 +2737,7 @@ dependencies = [ "json-schema-compatibility-validator", "once_cell", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2659,9 +2798,9 @@ checksum = "744a4c881f502e98c2241d2e5f50040ac73b30194d64452bb6260393b53f0dc9" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libloading" @@ -2706,6 +2845,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2734,7 +2879,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.15.1", ] [[package]] @@ -2754,7 +2899,7 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2803,7 +2948,7 @@ dependencies = [ "metrics", "metrics-util", "quanta", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2868,9 +3013,9 @@ dependencies = [ [[package]] name = "mockall" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c28b3fb6d753d28c20e826cd46ee611fda1cf3cde03a443a974043247c065a" +checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" dependencies = [ "cfg-if", "downcast", @@ -2882,14 +3027,14 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "341014e7f530314e9a1fdbc7400b244efea7122662c96bfa248c31da5bfb2020" +checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -2911,7 +3056,7 @@ dependencies = [ "rustc_version", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.69", "triomphe", "uuid", ] @@ -2940,7 +3085,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -3024,7 +3169,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3116,7 +3261,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3163,7 +3308,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3287,7 +3432,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3332,7 +3477,7 @@ version = "1.5.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "virtue 0.0.17", ] @@ -3353,7 +3498,7 @@ dependencies = [ "regex", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "treediff", ] @@ -3362,7 +3507,7 @@ name = "platform-value-convertible" version = "1.5.0" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3372,7 +3517,7 @@ dependencies = [ "bincode", "grovedb-version", "once_cell", - "thiserror", + "thiserror 1.0.69", "versioned-feature-core 1.0.0 (git+https://github.com/dashpay/versioned-feature-core)", ] @@ -3382,7 +3527,7 @@ version = "1.5.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3477,7 +3622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3499,34 +3644,11 @@ dependencies = [ "toml_edit 0.22.22", ] -[[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.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -3558,7 +3680,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.85", + "syn 2.0.89", "tempfile", ] @@ -3572,7 +3694,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3710,7 +3832,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -3725,9 +3847,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3796,11 +3918,11 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", - "tower-service 0.3.3", + "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3877,7 +3999,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -3931,9 +4053,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -3944,9 +4066,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", @@ -3959,15 +4081,14 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.0.1", ] [[package]] @@ -4029,9 +4150,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -4076,7 +4197,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -4084,9 +4218,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -4100,9 +4234,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -4128,20 +4262,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "indexmap 2.6.0", "itoa", @@ -4168,7 +4302,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4235,7 +4369,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4247,7 +4381,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4383,6 +4517,12 @@ dependencies = [ "log", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strategy-tests" version = "1.5.0" @@ -4427,7 +4567,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4458,38 +4598,20 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" 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 2.0.85", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] @@ -4506,6 +4628,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "system-configuration" version = "0.6.1" @@ -4513,7 +4646,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -4541,9 +4674,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -4564,7 +4697,7 @@ dependencies = [ "semver", "serde_json", "tenderdash-proto", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -4604,7 +4737,7 @@ dependencies = [ "tonic-build", "ureq", "walkdir", - "zip 2.2.0", + "zip 2.2.1", ] [[package]] @@ -4640,7 +4773,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4651,28 +4784,48 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "test-case-core", ] [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4716,6 +4869,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -4743,9 +4906,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -4768,7 +4931,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4901,9 +5064,9 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tower 0.4.13", - "tower-layer 0.3.3", - "tower-service 0.3.3", + "tower", + "tower-layer", + "tower-service", "tracing", "webpki-roots", ] @@ -4919,7 +5082,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4936,24 +5099,8 @@ dependencies = [ "slab", "tokio", "tokio-util", - "tower-layer 0.3.2", - "tower-service 0.3.2", - "tracing", -] - -[[package]] -name = "tower" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 0.1.2", - "tokio", - "tower-layer 0.3.3", - "tower-service 0.3.3", + "tower-layer", + "tower-service", "tracing", ] @@ -4977,8 +5124,8 @@ dependencies = [ "pin-project-lite", "tokio", "tokio-util", - "tower-layer 0.3.3", - "tower-service 0.3.3", + "tower-layer", + "tower-service", "tracing", ] @@ -4987,23 +5134,11 @@ name = "tower-layer" version = "0.3.2" source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" version = "0.3.2" source = "git+https://github.com/QuantumExplorer/tower?branch=fix/indexMap2OnV0413#5286f8c605d10f48d51254f2434c5ab3fc5d7779" -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.40" @@ -5024,7 +5159,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -5109,26 +5244,11 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-xid" @@ -5160,15 +5280,27 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -5243,7 +5375,7 @@ dependencies = [ "platform-value", "platform-version", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5282,7 +5414,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -5316,7 +5448,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5344,7 +5476,7 @@ dependencies = [ "serde", "serde-wasm-bindgen", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "wasm-logger", @@ -5374,9 +5506,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -5639,9 +5771,21 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.69", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -5657,6 +5801,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -5675,7 +5843,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure 0.13.1", ] [[package]] @@ -5696,7 +5885,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -5721,9 +5932,9 @@ dependencies = [ [[package]] name = "zip" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +checksum = "99d52293fc86ea7cf13971b3bb81eb21683636e7ae24c729cdaf1b7c4157a352" dependencies = [ "arbitrary", "crc32fast", @@ -5732,7 +5943,7 @@ dependencies = [ "flate2", "indexmap 2.6.0", "memchr", - "thiserror", + "thiserror 2.0.3", "zopfli", ] diff --git a/Cargo.toml b/Cargo.toml index 3c79f70f09e..6c6e93e0ab5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,3 +38,4 @@ rust-version = "1.80" tower-service = { git = "https://github.com/QuantumExplorer/tower", branch = "fix/indexMap2OnV0413" } tower-layer = { git = "https://github.com/QuantumExplorer/tower", branch = "fix/indexMap2OnV0413" } tower = { git = "https://github.com/QuantumExplorer/tower", branch = "fix/indexMap2OnV0413" } + diff --git a/packages/data-contracts/Cargo.toml b/packages/data-contracts/Cargo.toml index 248f8886e2c..7998501b7c6 100644 --- a/packages/data-contracts/Cargo.toml +++ b/packages/data-contracts/Cargo.toml @@ -16,3 +16,4 @@ dpns-contract = { path = "../dpns-contract" } dashpay-contract = { path = "../dashpay-contract" } feature-flags-contract = { path = "../feature-flags-contract" } platform-value = { path = "../rs-platform-value" } +wallet-contract = { path = "../wallet-contract" } diff --git a/packages/data-contracts/src/error.rs b/packages/data-contracts/src/error.rs index b9a5dd5d244..fdb6c2f50c1 100644 --- a/packages/data-contracts/src/error.rs +++ b/packages/data-contracts/src/error.rs @@ -102,3 +102,20 @@ impl From for Error { } } } + +impl From for Error { + fn from(e: wallet_contract::Error) -> Self { + match e { + wallet_contract::Error::UnknownVersionMismatch { + method, + known_versions, + received, + } => Error::UnknownVersionMismatch { + method, + known_versions, + received, + }, + wallet_contract::Error::InvalidSchemaJson(e) => Error::InvalidSchemaJson(e), + } + } +} diff --git a/packages/data-contracts/src/lib.rs b/packages/data-contracts/src/lib.rs index f6761d1eb8c..f1a1d8623af 100644 --- a/packages/data-contracts/src/lib.rs +++ b/packages/data-contracts/src/lib.rs @@ -19,6 +19,7 @@ pub enum SystemDataContract { FeatureFlags = 2, DPNS = 3, Dashpay = 4, + Wallet = 5, } pub struct DataContractSource { @@ -37,6 +38,7 @@ impl SystemDataContract { SystemDataContract::FeatureFlags => feature_flags_contract::ID_BYTES, SystemDataContract::DPNS => dpns_contract::ID_BYTES, SystemDataContract::Dashpay => dashpay_contract::ID_BYTES, + SystemDataContract::Wallet => wallet_contract::ID_BYTES, }; Identifier::new(bytes) } @@ -82,6 +84,13 @@ impl SystemDataContract { definitions: dashpay_contract::load_definitions(platform_version)?, document_schemas: dashpay_contract::load_documents_schemas(platform_version)?, }, + SystemDataContract::Wallet => DataContractSource { + id_bytes: wallet_contract::ID_BYTES, + owner_id_bytes: wallet_contract::OWNER_ID_BYTES, + version: platform_version.system_data_contracts.wallet as u32, + definitions: wallet_contract::load_definitions(platform_version)?, + document_schemas: wallet_contract::load_documents_schemas(platform_version)?, + }, }; Ok(data) diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index f5cf202665e..92f63826cff 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -4,6 +4,8 @@ use crate::platform_types::platform_state::v0::PlatformStateV0Methods; use crate::platform_types::platform_state::PlatformState; use dpp::block::block_info::BlockInfo; use dpp::dashcore::hashes::Hash; +use dpp::data_contracts::SystemDataContract; +use dpp::system_data_contracts::load_system_data_contract; use dpp::version::PlatformVersion; use dpp::version::ProtocolVersion; use drive::drive::identity::key::fetch::{ @@ -52,6 +54,50 @@ impl Platform { )?; } + if previous_protocol_version < 6 && platform_version.protocol_version >= 6 { + self.transition_to_version_6( + platform_state, + block_info, + transaction, + platform_version, + )?; + } + + Ok(()) + } + + /// Initializes an empty sum tree for withdrawal transactions required for protocol version 4. + /// + /// This function is called during the transition to protocol version 4 to set up + /// an empty sum tree at the specified path if it does not already exist. + /// + /// # Parameters + /// + /// * `transaction`: A reference to the transaction context in which the changes should be applied. + /// * `platform_version`: The current platform version containing the updated protocol version and relevant configuration details. + /// + /// # Returns + /// + /// * `Ok(())`: If the transition to version 4 was successful. + /// * `Err(Error)`: If there was an issue creating or updating the necessary data structures. + fn transition_to_version_6( + &self, + _platform_state: &PlatformState, + block_info: &BlockInfo, + transaction: &Transaction, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + // We are adding the withdrawal transactions sum amount tree + let contract = load_system_data_contract(SystemDataContract::Wallet, platform_version)?; + + self.drive.insert_contract( + &contract, + block_info.clone(), + true, + Some(transaction), + platform_version, + )?; + Ok(()) } diff --git a/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs index 53af3b5ce0f..cc444b25e9d 100644 --- a/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs @@ -9,4 +9,5 @@ pub struct SystemDataContractVersions { pub dashpay: FeatureVersion, pub masternode_reward_shares: FeatureVersion, pub feature_flags: FeatureVersion, + pub wallet: FeatureVersion, } diff --git a/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs b/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs index 205d6fda2ae..a55db9a296b 100644 --- a/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs @@ -7,4 +7,5 @@ pub const SYSTEM_DATA_CONTRACT_VERSIONS_V1: SystemDataContractVersions = dashpay: 1, masternode_reward_shares: 1, feature_flags: 1, + wallet: 1, }; From eda1351893699022d6a6db367c61841484fd20d9 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:16:32 +0700 Subject: [PATCH 20/40] build: add wallet-contract --- Dockerfile | 60 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index cdd72119184..85f5a587883 100644 --- a/Dockerfile +++ b/Dockerfile @@ -306,6 +306,7 @@ COPY --parents \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ packages/dpns-contract \ + packages/wallet-contract \ packages/data-contracts \ packages/strategy-tests \ packages/simple-signer \ @@ -374,6 +375,7 @@ COPY --parents \ packages/rs-platform-value-convertible \ packages/rs-drive-abci \ packages/dashpay-contract \ + packages/wallet-contract \ packages/withdrawals-contract \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ @@ -462,6 +464,7 @@ COPY --parents \ packages/wasm-dpp \ packages/dashpay-contract \ packages/withdrawals-contract \ + packages/wallet-contract \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ packages/dpns-contract \ @@ -569,23 +572,29 @@ LABEL description="Dashmate Helper Node.JS" WORKDIR /platform -COPY --from=build-dashmate-helper /platform/.yarn /platform/.yarn -COPY --from=build-dashmate-helper /platform/package.json /platform/yarn.lock /platform/.yarnrc.yml /platform/.pnp* /platform/ - # Copy only necessary packages from monorepo -COPY --from=build-dashmate-helper /platform/packages/dashmate packages/dashmate -COPY --from=build-dashmate-helper /platform/packages/dashpay-contract packages/dashpay-contract -COPY --from=build-dashmate-helper /platform/packages/wallet-lib packages/wallet-lib -COPY --from=build-dashmate-helper /platform/packages/js-dapi-client packages/js-dapi-client -COPY --from=build-dashmate-helper /platform/packages/js-grpc-common packages/js-grpc-common -COPY --from=build-dashmate-helper /platform/packages/dapi-grpc packages/dapi-grpc -COPY --from=build-dashmate-helper /platform/packages/dash-spv packages/dash-spv -COPY --from=build-dashmate-helper /platform/packages/withdrawals-contract packages/withdrawals-contract -COPY --from=build-dashmate-helper /platform/packages/masternode-reward-shares-contract packages/masternode-reward-shares-contract -COPY --from=build-dashmate-helper /platform/packages/feature-flags-contract packages/feature-flags-contract -COPY --from=build-dashmate-helper /platform/packages/dpns-contract packages/dpns-contract -COPY --from=build-dashmate-helper /platform/packages/data-contracts packages/data-contracts -COPY --from=build-dashmate-helper /platform/packages/wasm-dpp packages/wasm-dpp +COPY --from=build-dashmate-helper \ + --parents \ + /platform/.yarn \ + /platform/package.json \ + /platform/yarn.lock \ + /platform/.yarnrc.yml \ + /platform/.pnp* \ + /platform/packages/dashmate \ + /platform/packages/dashpay-contract \ + /platform/packages/wallet-lib \ + /platform/packages/js-dapi-client \ + /platform/packages/js-grpc-common \ + /platform/packages/dapi-grpc \ + /platform/packages/dash-spv \ + /platform/packages/wallet-contract \ + /platform/packages/withdrawals-contract \ + /platform/packages/masternode-reward-shares-contract \ + /platform/packages/feature-flags-contract \ + /platform/packages/dpns-contract \ + /platform/packages/data-contracts \ + /platform/packages/wasm-dpp \ + /platform/ ENV DASHMATE_HOME_DIR=/home/dashmate/.dashmate ENV DASHMATE_HELPER=1 @@ -646,14 +655,21 @@ RUN apk add --no-cache zeromq-dev WORKDIR /platform/packages/dapi -COPY --from=build-dapi /platform/.yarn /platform/.yarn -COPY --from=build-dapi /platform/package.json /platform/yarn.lock /platform/.yarnrc.yml /platform/.pnp* /platform/ # List of required dependencies. Based on: # yarn run ultra --info --filter '@dashevo/dapi' | sed -E 's/.*@dashevo\/(.*)/COPY --from=build-dapi \/platform\/packages\/\1 \/platform\/packages\/\1/' -COPY --from=build-dapi /platform/packages/dapi /platform/packages/dapi -COPY --from=build-dapi /platform/packages/dapi-grpc /platform/packages/dapi-grpc -COPY --from=build-dapi /platform/packages/js-grpc-common /platform/packages/js-grpc-common -COPY --from=build-dapi /platform/packages/wasm-dpp /platform/packages/wasm-dpp + +COPY --from=build-dapi \ + --parents \ + /platform/.yarn \ + /platform/package.json \ + /platform/yarn.lock \ + /platform/.yarnrc.yml \ + /platform/.pnp* \ + /platform/packages/dapi \ + /platform/packages/dapi-grpc \ + /platform/packages/js-grpc-common \ + /platform/packages/wasm-dpp \ + /platfrom/ RUN cp /platform/packages/dapi/.env.example /platform/packages/dapi/.env From 97d9400eab70144ca3f0770979406e31efa6aa4e Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:44:24 +0700 Subject: [PATCH 21/40] build: invalid platform path --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 85f5a587883..bb34aafc2ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -669,7 +669,7 @@ COPY --from=build-dapi \ /platform/packages/dapi-grpc \ /platform/packages/js-grpc-common \ /platform/packages/wasm-dpp \ - /platfrom/ + /platform/ RUN cp /platform/packages/dapi/.env.example /platform/packages/dapi/.env From ab81b550b1586d5050461e4fa35835cdbbeb97d4 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:47:53 +0700 Subject: [PATCH 22/40] docs: fix doc block --- .../mod.rs | 2 +- .../v0/mod.rs | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs index 56c1e17c6a2..7a101b4e342 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs @@ -61,7 +61,7 @@ impl Platform { previous_protocol_version, platform_version, ), - None => return Ok(()), + None => Ok(()), Some(version) => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { method: "perform_events_on_first_block_of_protocol_change".to_string(), known_versions: vec![0], diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index 92f63826cff..52769d876a0 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -66,20 +66,11 @@ impl Platform { Ok(()) } - /// Initializes an empty sum tree for withdrawal transactions required for protocol version 4. - /// - /// This function is called during the transition to protocol version 4 to set up - /// an empty sum tree at the specified path if it does not already exist. + /// Initializes the wallet contract that supports mobile wallets with additional + /// functionality /// - /// # Parameters - /// - /// * `transaction`: A reference to the transaction context in which the changes should be applied. - /// * `platform_version`: The current platform version containing the updated protocol version and relevant configuration details. - /// - /// # Returns - /// - /// * `Ok(())`: If the transition to version 4 was successful. - /// * `Err(Error)`: If there was an issue creating or updating the necessary data structures. + /// This function is called during the transition from protocol version 5 to protocol version 6 + /// and higher to set up the wallet contract in the platform. fn transition_to_version_6( &self, _platform_state: &PlatformState, @@ -92,7 +83,7 @@ impl Platform { self.drive.insert_contract( &contract, - block_info.clone(), + *block_info, true, Some(transaction), platform_version, From 39fe144caad17c5751f8de9b0ce355cf0a6804c7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:49:40 +0700 Subject: [PATCH 23/40] chore: re-export wallet contract --- packages/data-contracts/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/data-contracts/src/lib.rs b/packages/data-contracts/src/lib.rs index f1a1d8623af..393e79b050c 100644 --- a/packages/data-contracts/src/lib.rs +++ b/packages/data-contracts/src/lib.rs @@ -9,6 +9,7 @@ pub use feature_flags_contract; pub use masternode_reward_shares_contract; use platform_value::Identifier; use platform_version::version::PlatformVersion; +pub use wallet_contract; pub use withdrawals_contract; #[repr(u8)] From baea39739ac04c62a56f0956d111f13f1c785594 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 15:58:53 +0700 Subject: [PATCH 24/40] revert: unnecessary and broken refactoring --- Dockerfile | 60 +++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index bb34aafc2ab..b93bc5ac7fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -572,29 +572,25 @@ LABEL description="Dashmate Helper Node.JS" WORKDIR /platform +# TODO: Do one COPY with --parents +COPY --from=build-dashmate-helper /platform/.yarn /platform/.yarn +COPY --from=build-dashmate-helper /platform/package.json /platform/yarn.lock /platform/.yarnrc.yml /platform/.pnp* /platform/ + # Copy only necessary packages from monorepo -COPY --from=build-dashmate-helper \ - --parents \ - /platform/.yarn \ - /platform/package.json \ - /platform/yarn.lock \ - /platform/.yarnrc.yml \ - /platform/.pnp* \ - /platform/packages/dashmate \ - /platform/packages/dashpay-contract \ - /platform/packages/wallet-lib \ - /platform/packages/js-dapi-client \ - /platform/packages/js-grpc-common \ - /platform/packages/dapi-grpc \ - /platform/packages/dash-spv \ - /platform/packages/wallet-contract \ - /platform/packages/withdrawals-contract \ - /platform/packages/masternode-reward-shares-contract \ - /platform/packages/feature-flags-contract \ - /platform/packages/dpns-contract \ - /platform/packages/data-contracts \ - /platform/packages/wasm-dpp \ - /platform/ +COPY --from=build-dashmate-helper /platform/packages/dashmate packages/dashmate +COPY --from=build-dashmate-helper /platform/packages/dashpay-contract packages/dashpay-contract +COPY --from=build-dashmate-helper /platform/packages/wallet-lib packages/wallet-lib +COPY --from=build-dashmate-helper /platform/packages/js-dapi-client packages/js-dapi-client +COPY --from=build-dashmate-helper /platform/packages/js-grpc-common packages/js-grpc-common +COPY --from=build-dashmate-helper /platform/packages/dapi-grpc packages/dapi-grpc +COPY --from=build-dashmate-helper /platform/packages/dash-spv packages/dash-spv +COPY --from=build-dashmate-helper /platform/packages/wallet-contract packages/wallet-contract +COPY --from=build-dashmate-helper /platform/packages/withdrawals-contract packages/withdrawals-contract +COPY --from=build-dashmate-helper /platform/packages/masternode-reward-shares-contract packages/masternode-reward-shares-contract +COPY --from=build-dashmate-helper /platform/packages/feature-flags-contract packages/feature-flags-contract +COPY --from=build-dashmate-helper /platform/packages/dpns-contract packages/dpns-contract +COPY --from=build-dashmate-helper /platform/packages/data-contracts packages/data-contracts +COPY --from=build-dashmate-helper /platform/packages/wasm-dpp packages/wasm-dpp ENV DASHMATE_HOME_DIR=/home/dashmate/.dashmate ENV DASHMATE_HELPER=1 @@ -655,21 +651,15 @@ RUN apk add --no-cache zeromq-dev WORKDIR /platform/packages/dapi +# TODO: Do one COPY with --parents +COPY --from=build-dapi /platform/.yarn /platform/.yarn +COPY --from=build-dapi /platform/package.json /platform/yarn.lock /platform/.yarnrc.yml /platform/.pnp* /platform/ # List of required dependencies. Based on: # yarn run ultra --info --filter '@dashevo/dapi' | sed -E 's/.*@dashevo\/(.*)/COPY --from=build-dapi \/platform\/packages\/\1 \/platform\/packages\/\1/' - -COPY --from=build-dapi \ - --parents \ - /platform/.yarn \ - /platform/package.json \ - /platform/yarn.lock \ - /platform/.yarnrc.yml \ - /platform/.pnp* \ - /platform/packages/dapi \ - /platform/packages/dapi-grpc \ - /platform/packages/js-grpc-common \ - /platform/packages/wasm-dpp \ - /platform/ +COPY --from=build-dapi /platform/packages/dapi /platform/packages/dapi +COPY --from=build-dapi /platform/packages/dapi-grpc /platform/packages/dapi-grpc +COPY --from=build-dapi /platform/packages/js-grpc-common /platform/packages/js-grpc-common +COPY --from=build-dapi /platform/packages/wasm-dpp /platform/packages/wasm-dpp RUN cp /platform/packages/dapi/.env.example /platform/packages/dapi/.env From 0f2ea364b3a3037496cf1a7de1468ce4d5aa89f2 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 16:49:36 +0700 Subject: [PATCH 25/40] docs: remove wrong comment --- .../perform_events_on_first_block_of_protocol_change/v0/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index 52769d876a0..e2ed2149ea7 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -78,7 +78,6 @@ impl Platform { transaction: &Transaction, platform_version: &PlatformVersion, ) -> Result<(), Error> { - // We are adding the withdrawal transactions sum amount tree let contract = load_system_data_contract(SystemDataContract::Wallet, platform_version)?; self.drive.insert_contract( From 16534b067853bce28abd5ffaab20f8b26cd6db9d Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 18:40:38 +0700 Subject: [PATCH 26/40] refactor: remove unused param --- .../v0/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index e2ed2149ea7..5616f807994 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -55,12 +55,7 @@ impl Platform { } if previous_protocol_version < 6 && platform_version.protocol_version >= 6 { - self.transition_to_version_6( - platform_state, - block_info, - transaction, - platform_version, - )?; + self.transition_to_version_6(block_info, transaction, platform_version)?; } Ok(()) @@ -73,7 +68,6 @@ impl Platform { /// and higher to set up the wallet contract in the platform. fn transition_to_version_6( &self, - _platform_state: &PlatformState, block_info: &BlockInfo, transaction: &Transaction, platform_version: &PlatformVersion, From d4ed5353a08528cbca1880d16a127755afecd8b4 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 18:40:58 +0700 Subject: [PATCH 27/40] docs: remove usage section --- packages/wallet-contract/README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/wallet-contract/README.md b/packages/wallet-contract/README.md index d37046f14dc..9d421408083 100644 --- a/packages/wallet-contract/README.md +++ b/packages/wallet-contract/README.md @@ -18,12 +18,6 @@ JSON Contracts for Dash Wallet apps npm install @dashevo/wallet-contract ``` -## Usage - -```sh -# TODO ... -``` - ## Contributing Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs. From 8f9db892619b97050e2b043e4b07eae7dabd3c81 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 18:50:56 +0700 Subject: [PATCH 28/40] fix: duplicated ID --- packages/wallet-contract/lib/systemIds.js | 2 +- packages/wallet-contract/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/wallet-contract/lib/systemIds.js b/packages/wallet-contract/lib/systemIds.js index 27b253c0d0d..30ba0c3727b 100644 --- a/packages/wallet-contract/lib/systemIds.js +++ b/packages/wallet-contract/lib/systemIds.js @@ -1,4 +1,4 @@ module.exports = { ownerId: '11111111111111111111111111111111', - contractId: 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec' + contractId: '7CSFGeF4WNzgDmx94zwvHkYaG3Dx4XEe5LFsFgJswLbm' }; diff --git a/packages/wallet-contract/src/lib.rs b/packages/wallet-contract/src/lib.rs index fe281f9b2a6..70dafcc26fd 100644 --- a/packages/wallet-contract/src/lib.rs +++ b/packages/wallet-contract/src/lib.rs @@ -7,8 +7,8 @@ use platform_version::version::PlatformVersion; use serde_json::Value; pub const ID_BYTES: [u8; 32] = [ - 162, 48, 73, 255, 116, 241, 166, 155, 131, 121, 132, 39, 129, 40, 127, 6, 103, 164, 72, 139, - 143, 116, 163, 19, 81, 193, 38, 248, 116, 244, 59, 196 + 92, 20, 14, 101, 92, 2, 101, 187, 194, 168, 8, 113, 109, 225, 132, 121, 133, 19, 89, 24, 173, + 81, 205, 253, 11, 118, 102, 75, 169, 91, 163, 124, ]; pub const OWNER_ID_BYTES: [u8; 32] = [0; 32]; From c036d95470bdd9c7b8e646ef8ce19d9ce7bc9169 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 19:22:14 +0700 Subject: [PATCH 29/40] docs: update description --- .../wallet-contract/schema/v1/wallet-contract-documents.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/wallet-contract/schema/v1/wallet-contract-documents.json b/packages/wallet-contract/schema/v1/wallet-contract-documents.json index 7aa9dbfe951..04b4cb9ce4f 100644 --- a/packages/wallet-contract/schema/v1/wallet-contract-documents.json +++ b/packages/wallet-contract/schema/v1/wallet-contract-documents.json @@ -26,7 +26,7 @@ "keyIndex": { "type": "integer", "minimum": 0, - "description": "The index of the owners identity public key used to derive the encryption key.", + "description": "The derivation index used to create the encryption key.", "position": 0 }, "encryptionKeyIndex": { @@ -52,4 +52,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} From c18f02d5a9cf2aa9bc38cf88d5cdbf712dfab744 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 19:24:06 +0700 Subject: [PATCH 30/40] docs: remove usage --- packages/wallet-contract/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/wallet-contract/README.md b/packages/wallet-contract/README.md index 9d421408083..26445ea17de 100644 --- a/packages/wallet-contract/README.md +++ b/packages/wallet-contract/README.md @@ -8,7 +8,6 @@ JSON Contracts for Dash Wallet apps ## Table of Contents - [Install](#install) -- [Usage](#usage) - [Contributing](#contributing) - [License](#license) From bf1769f7b17e193d20afe3ee04e760d1573890c7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 22:51:57 +0700 Subject: [PATCH 31/40] feat: add mutability flags --- .../wallet-contract/schema/v1/wallet-contract-documents.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/wallet-contract/schema/v1/wallet-contract-documents.json b/packages/wallet-contract/schema/v1/wallet-contract-documents.json index 04b4cb9ce4f..850255567a0 100644 --- a/packages/wallet-contract/schema/v1/wallet-contract-documents.json +++ b/packages/wallet-contract/schema/v1/wallet-contract-documents.json @@ -1,6 +1,8 @@ { "txMetadata": { "type": "object", + "documentsMutable": false, + "canBeDeleted": true, "indices": [ { "name": "ownerId", From 03733de4aad3a64017417f0268bc066b0777751b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 23:13:17 +0700 Subject: [PATCH 32/40] refactor: rename contract --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- package.json | 1 + packages/data-contracts/Cargo.toml | 2 +- packages/data-contracts/src/error.rs | 8 ++++---- packages/data-contracts/src/lib.rs | 16 ++++++++-------- .../v0/mod.rs | 3 ++- .../.eslintrc | 0 .../.mocharc.yml | 0 .../Cargo.toml | 2 +- .../LICENSE | 0 .../README.md | 2 +- .../lib/systemIds.js | 0 .../package.json | 2 +- .../v1/wallet-utils-contract-documents.json} | 0 .../src/error.rs | 0 .../src/lib.rs | 0 .../src/v1/mod.rs | 6 ++++-- .../test/.eslintrc | 0 .../test/bootstrap.js | 0 .../test/unit/walletContract.spec.js | 0 21 files changed, 26 insertions(+), 22 deletions(-) rename packages/{wallet-contract => wallet-utils-contract}/.eslintrc (100%) rename packages/{wallet-contract => wallet-utils-contract}/.mocharc.yml (100%) rename packages/{wallet-contract => wallet-utils-contract}/Cargo.toml (91%) rename packages/{wallet-contract => wallet-utils-contract}/LICENSE (100%) rename packages/{wallet-contract => wallet-utils-contract}/README.md (96%) rename packages/{wallet-contract => wallet-utils-contract}/lib/systemIds.js (100%) rename packages/{wallet-contract => wallet-utils-contract}/package.json (94%) rename packages/{wallet-contract/schema/v1/wallet-contract-documents.json => wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json} (100%) rename packages/{wallet-contract => wallet-utils-contract}/src/error.rs (100%) rename packages/{wallet-contract => wallet-utils-contract}/src/lib.rs (100%) rename packages/{wallet-contract => wallet-utils-contract}/src/v1/mod.rs (74%) rename packages/{wallet-contract => wallet-utils-contract}/test/.eslintrc (100%) rename packages/{wallet-contract => wallet-utils-contract}/test/bootstrap.js (100%) rename packages/{wallet-contract => wallet-utils-contract}/test/unit/walletContract.spec.js (100%) diff --git a/Cargo.lock b/Cargo.lock index c02531fc62a..54155743db4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1234,7 +1234,7 @@ dependencies = [ "platform-version", "serde_json", "thiserror 1.0.69", - "wallet-contract", + "wallet-utils-contract", "withdrawals-contract", ] @@ -5369,7 +5369,7 @@ dependencies = [ ] [[package]] -name = "wallet-contract" +name = "wallet-utils-contract" version = "1.5.0" dependencies = [ "platform-value", diff --git a/Cargo.toml b/Cargo.toml index 6c6e93e0ab5..3b7b503758f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ members = [ "packages/simple-signer", "packages/rs-json-schema-compatibility-validator", "packages/check-features", - "packages/wallet-contract" + "packages/wallet-utils-contract" ] [workspace.package] diff --git a/package.json b/package.json index 0c004c20773..21a1bf6ab4e 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "packages/feature-flags-contract", "packages/js-dapi-client", "packages/wallet-lib", + "packages/wallet-utils-contract", "packages/js-dash-sdk", "packages/dapi", "packages/dashmate", diff --git a/packages/data-contracts/Cargo.toml b/packages/data-contracts/Cargo.toml index 7998501b7c6..144edd198fb 100644 --- a/packages/data-contracts/Cargo.toml +++ b/packages/data-contracts/Cargo.toml @@ -16,4 +16,4 @@ dpns-contract = { path = "../dpns-contract" } dashpay-contract = { path = "../dashpay-contract" } feature-flags-contract = { path = "../feature-flags-contract" } platform-value = { path = "../rs-platform-value" } -wallet-contract = { path = "../wallet-contract" } +wallet-utils-contract = { path = "../wallet-utils-contract" } diff --git a/packages/data-contracts/src/error.rs b/packages/data-contracts/src/error.rs index fdb6c2f50c1..0550873b012 100644 --- a/packages/data-contracts/src/error.rs +++ b/packages/data-contracts/src/error.rs @@ -103,10 +103,10 @@ impl From for Error { } } -impl From for Error { - fn from(e: wallet_contract::Error) -> Self { +impl From for Error { + fn from(e: wallet_utils_contract::Error) -> Self { match e { - wallet_contract::Error::UnknownVersionMismatch { + wallet_utils_contract::Error::UnknownVersionMismatch { method, known_versions, received, @@ -115,7 +115,7 @@ impl From for Error { known_versions, received, }, - wallet_contract::Error::InvalidSchemaJson(e) => Error::InvalidSchemaJson(e), + wallet_utils_contract::Error::InvalidSchemaJson(e) => Error::InvalidSchemaJson(e), } } } diff --git a/packages/data-contracts/src/lib.rs b/packages/data-contracts/src/lib.rs index 393e79b050c..65f324137fd 100644 --- a/packages/data-contracts/src/lib.rs +++ b/packages/data-contracts/src/lib.rs @@ -9,7 +9,7 @@ pub use feature_flags_contract; pub use masternode_reward_shares_contract; use platform_value::Identifier; use platform_version::version::PlatformVersion; -pub use wallet_contract; +pub use wallet_utils_contract; pub use withdrawals_contract; #[repr(u8)] @@ -20,7 +20,7 @@ pub enum SystemDataContract { FeatureFlags = 2, DPNS = 3, Dashpay = 4, - Wallet = 5, + WalletUtils = 5, } pub struct DataContractSource { @@ -39,7 +39,7 @@ impl SystemDataContract { SystemDataContract::FeatureFlags => feature_flags_contract::ID_BYTES, SystemDataContract::DPNS => dpns_contract::ID_BYTES, SystemDataContract::Dashpay => dashpay_contract::ID_BYTES, - SystemDataContract::Wallet => wallet_contract::ID_BYTES, + SystemDataContract::WalletUtils => wallet_utils_contract::ID_BYTES, }; Identifier::new(bytes) } @@ -85,12 +85,12 @@ impl SystemDataContract { definitions: dashpay_contract::load_definitions(platform_version)?, document_schemas: dashpay_contract::load_documents_schemas(platform_version)?, }, - SystemDataContract::Wallet => DataContractSource { - id_bytes: wallet_contract::ID_BYTES, - owner_id_bytes: wallet_contract::OWNER_ID_BYTES, + SystemDataContract::WalletUtils => DataContractSource { + id_bytes: wallet_utils_contract::ID_BYTES, + owner_id_bytes: wallet_utils_contract::OWNER_ID_BYTES, version: platform_version.system_data_contracts.wallet as u32, - definitions: wallet_contract::load_definitions(platform_version)?, - document_schemas: wallet_contract::load_documents_schemas(platform_version)?, + definitions: wallet_utils_contract::load_definitions(platform_version)?, + document_schemas: wallet_utils_contract::load_documents_schemas(platform_version)?, }, }; diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index 5616f807994..d36250ea3e7 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -72,7 +72,8 @@ impl Platform { transaction: &Transaction, platform_version: &PlatformVersion, ) -> Result<(), Error> { - let contract = load_system_data_contract(SystemDataContract::Wallet, platform_version)?; + let contract = + load_system_data_contract(SystemDataContract::WalletUtils, platform_version)?; self.drive.insert_contract( &contract, diff --git a/packages/wallet-contract/.eslintrc b/packages/wallet-utils-contract/.eslintrc similarity index 100% rename from packages/wallet-contract/.eslintrc rename to packages/wallet-utils-contract/.eslintrc diff --git a/packages/wallet-contract/.mocharc.yml b/packages/wallet-utils-contract/.mocharc.yml similarity index 100% rename from packages/wallet-contract/.mocharc.yml rename to packages/wallet-utils-contract/.mocharc.yml diff --git a/packages/wallet-contract/Cargo.toml b/packages/wallet-utils-contract/Cargo.toml similarity index 91% rename from packages/wallet-contract/Cargo.toml rename to packages/wallet-utils-contract/Cargo.toml index 9d5bb9c732d..5286e0e5ea4 100644 --- a/packages/wallet-contract/Cargo.toml +++ b/packages/wallet-utils-contract/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wallet-contract" +name = "wallet-utils-contract" description = "Wallet data contract schema and tools" version = "1.5.0" edition = "2021" diff --git a/packages/wallet-contract/LICENSE b/packages/wallet-utils-contract/LICENSE similarity index 100% rename from packages/wallet-contract/LICENSE rename to packages/wallet-utils-contract/LICENSE diff --git a/packages/wallet-contract/README.md b/packages/wallet-utils-contract/README.md similarity index 96% rename from packages/wallet-contract/README.md rename to packages/wallet-utils-contract/README.md index 26445ea17de..ce6b5a62333 100644 --- a/packages/wallet-contract/README.md +++ b/packages/wallet-utils-contract/README.md @@ -1,4 +1,4 @@ -# Wallet Contract +# Wallet Utils Contract [![Build Status](https://github.com/dashpay/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashpay/platform/actions/workflows/release.yml) [![NPM version](https://img.shields.io/npm/v/@dashevo/wallet-contract.svg?style=flat-square)](https://npmjs.org/package/@dashevo/wallet-contract) diff --git a/packages/wallet-contract/lib/systemIds.js b/packages/wallet-utils-contract/lib/systemIds.js similarity index 100% rename from packages/wallet-contract/lib/systemIds.js rename to packages/wallet-utils-contract/lib/systemIds.js diff --git a/packages/wallet-contract/package.json b/packages/wallet-utils-contract/package.json similarity index 94% rename from packages/wallet-contract/package.json rename to packages/wallet-utils-contract/package.json index 2602c430131..fd7ff2fc800 100644 --- a/packages/wallet-contract/package.json +++ b/packages/wallet-utils-contract/package.json @@ -1,5 +1,5 @@ { - "name": "@dashevo/wallet-contract", + "name": "@dashevo/wallet-utils-contract", "version": "1.5.0", "description": "A contract and helper scripts for Wallet DApp", "scripts": { diff --git a/packages/wallet-contract/schema/v1/wallet-contract-documents.json b/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json similarity index 100% rename from packages/wallet-contract/schema/v1/wallet-contract-documents.json rename to packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json diff --git a/packages/wallet-contract/src/error.rs b/packages/wallet-utils-contract/src/error.rs similarity index 100% rename from packages/wallet-contract/src/error.rs rename to packages/wallet-utils-contract/src/error.rs diff --git a/packages/wallet-contract/src/lib.rs b/packages/wallet-utils-contract/src/lib.rs similarity index 100% rename from packages/wallet-contract/src/lib.rs rename to packages/wallet-utils-contract/src/lib.rs diff --git a/packages/wallet-contract/src/v1/mod.rs b/packages/wallet-utils-contract/src/v1/mod.rs similarity index 74% rename from packages/wallet-contract/src/v1/mod.rs rename to packages/wallet-utils-contract/src/v1/mod.rs index 4569ad779c4..c6e5034231a 100644 --- a/packages/wallet-contract/src/v1/mod.rs +++ b/packages/wallet-utils-contract/src/v1/mod.rs @@ -14,6 +14,8 @@ pub mod document_types { } pub fn load_documents_schemas() -> Result { - serde_json::from_str(include_str!("../../schema/v1/wallet-contract-documents.json")) - .map_err(Error::InvalidSchemaJson) + serde_json::from_str(include_str!( + "../../schema/v1/wallet-utils-contract-documents.json" + )) + .map_err(Error::InvalidSchemaJson) } diff --git a/packages/wallet-contract/test/.eslintrc b/packages/wallet-utils-contract/test/.eslintrc similarity index 100% rename from packages/wallet-contract/test/.eslintrc rename to packages/wallet-utils-contract/test/.eslintrc diff --git a/packages/wallet-contract/test/bootstrap.js b/packages/wallet-utils-contract/test/bootstrap.js similarity index 100% rename from packages/wallet-contract/test/bootstrap.js rename to packages/wallet-utils-contract/test/bootstrap.js diff --git a/packages/wallet-contract/test/unit/walletContract.spec.js b/packages/wallet-utils-contract/test/unit/walletContract.spec.js similarity index 100% rename from packages/wallet-contract/test/unit/walletContract.spec.js rename to packages/wallet-utils-contract/test/unit/walletContract.spec.js From 4dd3feb44f92fbf98a89835c510774af56e7c021 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 23:14:54 +0700 Subject: [PATCH 33/40] chore: update yarn --- .pnp.cjs | 23 +++++++++++++++++++++++ yarn.lock | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.pnp.cjs b/.pnp.cjs index e6e5c001ec8..21f4c62f9a0 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -69,6 +69,10 @@ const RAW_RUNTIME_STATE = "name": "@dashevo/wallet-lib",\ "reference": "workspace:packages/wallet-lib"\ },\ + {\ + "name": "@dashevo/wallet-utils-contract",\ + "reference": "workspace:packages/wallet-utils-contract"\ + },\ {\ "name": "@dashevo/wasm-dpp",\ "reference": "workspace:packages/wasm-dpp"\ @@ -94,6 +98,7 @@ const RAW_RUNTIME_STATE = ["@dashevo/platform", ["workspace:."]],\ ["@dashevo/platform-test-suite", ["workspace:packages/platform-test-suite"]],\ ["@dashevo/wallet-lib", ["workspace:packages/wallet-lib"]],\ + ["@dashevo/wallet-utils-contract", ["workspace:packages/wallet-utils-contract"]],\ ["@dashevo/wasm-dpp", ["workspace:packages/wasm-dpp"]],\ ["@dashevo/withdrawals-contract", ["workspace:packages/withdrawals-contract"]],\ ["dash", ["workspace:packages/js-dash-sdk"]],\ @@ -3086,6 +3091,24 @@ const RAW_RUNTIME_STATE = "linkType": "SOFT"\ }]\ ]],\ + ["@dashevo/wallet-utils-contract", [\ + ["workspace:packages/wallet-utils-contract", {\ + "packageLocation": "./packages/wallet-utils-contract/",\ + "packageDependencies": [\ + ["@dashevo/wallet-utils-contract", "workspace:packages/wallet-utils-contract"],\ + ["@dashevo/wasm-dpp", "workspace:packages/wasm-dpp"],\ + ["chai", "npm:4.3.10"],\ + ["dirty-chai", "virtual:e2d057e7cc143d3cb9bec864f4a2d862441b5a09f81f8e6c46e7a098cbc89e4d07017cc6e2e2142d5704bb55da853cbec2d025ebc0b30e8696c31380c00f2c7d#npm:2.0.1"],\ + ["eslint", "npm:8.53.0"],\ + ["eslint-config-airbnb-base", "virtual:e2d057e7cc143d3cb9bec864f4a2d862441b5a09f81f8e6c46e7a098cbc89e4d07017cc6e2e2142d5704bb55da853cbec2d025ebc0b30e8696c31380c00f2c7d#npm:15.0.0"],\ + ["eslint-plugin-import", "virtual:e2d057e7cc143d3cb9bec864f4a2d862441b5a09f81f8e6c46e7a098cbc89e4d07017cc6e2e2142d5704bb55da853cbec2d025ebc0b30e8696c31380c00f2c7d#npm:2.29.0"],\ + ["mocha", "npm:10.2.0"],\ + ["sinon", "npm:17.0.1"],\ + ["sinon-chai", "virtual:e2d057e7cc143d3cb9bec864f4a2d862441b5a09f81f8e6c46e7a098cbc89e4d07017cc6e2e2142d5704bb55da853cbec2d025ebc0b30e8696c31380c00f2c7d#npm:3.7.0"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@dashevo/wasm-dpp", [\ ["workspace:packages/wasm-dpp", {\ "packageLocation": "./packages/wasm-dpp/",\ diff --git a/yarn.lock b/yarn.lock index 1ea5015fe3c..e9661201c4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1935,6 +1935,22 @@ __metadata: languageName: unknown linkType: soft +"@dashevo/wallet-utils-contract@workspace:packages/wallet-utils-contract": + version: 0.0.0-use.local + resolution: "@dashevo/wallet-utils-contract@workspace:packages/wallet-utils-contract" + dependencies: + "@dashevo/wasm-dpp": "workspace:*" + chai: "npm:^4.3.10" + dirty-chai: "npm:^2.0.1" + eslint: "npm:^8.53.0" + eslint-config-airbnb-base: "npm:^15.0.0" + eslint-plugin-import: "npm:^2.29.0" + mocha: "npm:^10.2.0" + sinon: "npm:^17.0.1" + sinon-chai: "npm:^3.7.0" + languageName: unknown + linkType: soft + "@dashevo/wasm-dpp@workspace:*, @dashevo/wasm-dpp@workspace:packages/wasm-dpp": version: 0.0.0-use.local resolution: "@dashevo/wasm-dpp@workspace:packages/wasm-dpp" From 837cbd728ffe431072f349243347836971336eb8 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 22 Nov 2024 23:17:09 +0700 Subject: [PATCH 34/40] ci: add wallet utils contract --- .github/package-filters/js-packages.yml | 5 +++++ .github/package-filters/rs-packages.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/package-filters/js-packages.yml b/.github/package-filters/js-packages.yml index d158bb39f67..b42237f81b1 100644 --- a/.github/package-filters/js-packages.yml +++ b/.github/package-filters/js-packages.yml @@ -1,3 +1,7 @@ +'@dashevo/wallet-utils-contract': &wallet-utils-contract + - .github/workflows/tests* + - packages/wallet-utils-contract/** + '@dashevo/dashpay-contract': &dashpay-contract - .github/workflows/tests* - packages/dashpay-contract/** @@ -25,6 +29,7 @@ - *masternode-reward-shares-contract - *dpns-contract - *withdrawals-contract + - *wallet-utils-contract - packages/rs-platform-serialization/** - packages/rs-platform-serialization-derive/** - packages/rs-platform-value/** diff --git a/.github/package-filters/rs-packages.yml b/.github/package-filters/rs-packages.yml index f50dea216d3..1e8dba8657c 100644 --- a/.github/package-filters/rs-packages.yml +++ b/.github/package-filters/rs-packages.yml @@ -1,3 +1,7 @@ +'@dashevo/wallet-utils-contract': &wallet-utils-contract + - .github/workflows/tests* + - packages/wallet-utils-contract/** + dashpay-contract: &dashpay-contract - .github/workflows/tests* - packages/dashpay-contract/** @@ -25,6 +29,7 @@ dpp: &dpp - *masternode-reward-shares-contract - *dpns-contract - *withdrawals-contract + - *wallet-utils-contract - *json-schema-compatibility-validator - packages/rs-platform-serialization/** - packages/rs-platform-serialization-derive/** From 1182e5472871f3a15dae4fe78f5e50f564df85c6 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 14:05:43 +0700 Subject: [PATCH 35/40] build: fix wallet utils contract path --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b93bc5ac7fc..26ccca600f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -306,7 +306,7 @@ COPY --parents \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ packages/dpns-contract \ - packages/wallet-contract \ + packages/wallet-utils-contract \ packages/data-contracts \ packages/strategy-tests \ packages/simple-signer \ @@ -375,7 +375,7 @@ COPY --parents \ packages/rs-platform-value-convertible \ packages/rs-drive-abci \ packages/dashpay-contract \ - packages/wallet-contract \ + packages/wallet-utils-contract \ packages/withdrawals-contract \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ @@ -464,7 +464,7 @@ COPY --parents \ packages/wasm-dpp \ packages/dashpay-contract \ packages/withdrawals-contract \ - packages/wallet-contract \ + packages/wallet-utils-contract \ packages/masternode-reward-shares-contract \ packages/feature-flags-contract \ packages/dpns-contract \ @@ -584,7 +584,7 @@ COPY --from=build-dashmate-helper /platform/packages/js-dapi-client packages/js- COPY --from=build-dashmate-helper /platform/packages/js-grpc-common packages/js-grpc-common COPY --from=build-dashmate-helper /platform/packages/dapi-grpc packages/dapi-grpc COPY --from=build-dashmate-helper /platform/packages/dash-spv packages/dash-spv -COPY --from=build-dashmate-helper /platform/packages/wallet-contract packages/wallet-contract +COPY --from=build-dashmate-helper /platform/packages/wallet-utils-contract packages/wallet-utils-contract COPY --from=build-dashmate-helper /platform/packages/withdrawals-contract packages/withdrawals-contract COPY --from=build-dashmate-helper /platform/packages/masternode-reward-shares-contract packages/masternode-reward-shares-contract COPY --from=build-dashmate-helper /platform/packages/feature-flags-contract packages/feature-flags-contract From 7ec638bce92eae48cda336c58a29ddaadd9726d7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 14:44:37 +0700 Subject: [PATCH 36/40] chore: fix linter warning and tests --- .../wallet-utils-contract/lib/systemIds.js | 2 +- .../test/unit/walletContract.spec.js | 34 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/wallet-utils-contract/lib/systemIds.js b/packages/wallet-utils-contract/lib/systemIds.js index 30ba0c3727b..f1aa5b80c07 100644 --- a/packages/wallet-utils-contract/lib/systemIds.js +++ b/packages/wallet-utils-contract/lib/systemIds.js @@ -1,4 +1,4 @@ module.exports = { ownerId: '11111111111111111111111111111111', - contractId: '7CSFGeF4WNzgDmx94zwvHkYaG3Dx4XEe5LFsFgJswLbm' + contractId: '7CSFGeF4WNzgDmx94zwvHkYaG3Dx4XEe5LFsFgJswLbm', }; diff --git a/packages/wallet-utils-contract/test/unit/walletContract.spec.js b/packages/wallet-utils-contract/test/unit/walletContract.spec.js index f39514c4231..46e63f2d759 100644 --- a/packages/wallet-utils-contract/test/unit/walletContract.spec.js +++ b/packages/wallet-utils-contract/test/unit/walletContract.spec.js @@ -7,7 +7,7 @@ const { const generateRandomIdentifier = require('@dashevo/wasm-dpp/lib/test/utils/generateRandomIdentifierAsync'); const { expect } = require('chai'); -const walletContractDocumentsSchema = require('../../schema/v1/wallet-contract-documents.json'); +const walletContractDocumentsSchema = require('../../schema/v1/wallet-utils-contract-documents.json'); const expectJsonSchemaError = (validationResult, errorCount = 1) => { const errors = validationResult.getErrors(); @@ -85,11 +85,11 @@ describe('Wallet Contract', () => { const error = expectJsonSchemaError(validationResult); expect(error.keyword) - .to - .equal('required'); + .to + .equal('required'); expect(error.params.missingProperty) - .to - .equal('encryptionKeyIndex'); + .to + .equal('encryptionKeyIndex'); }); }); @@ -102,11 +102,11 @@ describe('Wallet Contract', () => { const error = expectJsonSchemaError(validationResult); expect(error.keyword) - .to - .equal('required'); + .to + .equal('required'); expect(error.params.missingProperty) - .to - .equal('encryptedMetadata'); + .to + .equal('encryptedMetadata'); }); it('should be not shorter than 32 bytes', async () => { @@ -117,11 +117,11 @@ describe('Wallet Contract', () => { const error = expectJsonSchemaError(validationResult); expect(error.keyword) - .to - .equal('minBytes'); + .to + .equal('minItems'); expect(error.instancePath) - .to - .equal('/encryptedMetadata'); + .to + .equal('/encryptedMetadata'); }); it('should be not longer than 4096 bytes', async () => { @@ -132,11 +132,11 @@ describe('Wallet Contract', () => { const error = expectJsonSchemaError(validationResult); expect(error.keyword) - .to - .equal('maxItems'); + .to + .equal('maxItems'); expect(error.instancePath) - .to - .equal('/encryptedMetadata'); + .to + .equal('/encryptedMetadata'); }); }); From 233c582a33f8dc861678659d3daa2b8c98976df7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 14:50:24 +0700 Subject: [PATCH 37/40] test: add more tests --- .../test/unit/walletContract.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/wallet-utils-contract/test/unit/walletContract.spec.js b/packages/wallet-utils-contract/test/unit/walletContract.spec.js index 46e63f2d759..5b3efe97af4 100644 --- a/packages/wallet-utils-contract/test/unit/walletContract.spec.js +++ b/packages/wallet-utils-contract/test/unit/walletContract.spec.js @@ -74,6 +74,14 @@ describe('Wallet Contract', () => { .to .equal('keyIndex'); }); + + it('should be a non-negative integer', async () => { + rawTxMetadataDocument.keyIndex = -1; + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + expect(error.keyword).to.equal('minimum'); + }); }); describe('encryptionKeyIndex', () => { @@ -91,6 +99,14 @@ describe('Wallet Contract', () => { .to .equal('encryptionKeyIndex'); }); + + it('should be a non-negative integer', async () => { + rawTxMetadataDocument.encryptionKeyIndex = -1; + const document = dpp.document.create(dataContract, identityId, 'txMetadata', rawTxMetadataDocument); + const validationResult = document.validate(dpp.protocolVersion); + const error = expectJsonSchemaError(validationResult); + expect(error.keyword).to.equal('minimum'); + }); }); describe('encryptedMetadata', () => { From 4565ca3d9e575a14558b81af44fe00bd431d0b3b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 14:58:15 +0700 Subject: [PATCH 38/40] ci: fix rs package name --- .github/package-filters/rs-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/package-filters/rs-packages.yml b/.github/package-filters/rs-packages.yml index 1e8dba8657c..c813323e1dd 100644 --- a/.github/package-filters/rs-packages.yml +++ b/.github/package-filters/rs-packages.yml @@ -1,4 +1,4 @@ -'@dashevo/wallet-utils-contract': &wallet-utils-contract +wallet-utils-contract: &wallet-utils-contract - .github/workflows/tests* - packages/wallet-utils-contract/** From 953c7b265690842e597a2c2a39637bc27c9e86b5 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 17:34:59 +0700 Subject: [PATCH 39/40] feat: make tx_metadata mutable --- .../schema/v1/wallet-utils-contract-documents.json | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json b/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json index 850255567a0..a39224e11e7 100644 --- a/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json +++ b/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json @@ -1,17 +1,9 @@ { "txMetadata": { "type": "object", - "documentsMutable": false, + "documentsMutable": true, "canBeDeleted": true, "indices": [ - { - "name": "ownerId", - "properties": [ - { - "$ownerId": "asc" - } - ] - }, { "name": "ownerIdAndCreatedAt", "properties": [ @@ -19,7 +11,7 @@ "$ownerId": "asc" }, { - "$createdAt": "asc" + "$updatedAt": "asc" } ] } @@ -50,7 +42,7 @@ "keyIndex", "encryptionKeyIndex", "encryptedMetadata", - "$createdAt" + "$updatedAt" ], "additionalProperties": false } From 33850fe8059b9c080a102af1279320a4a5335571 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 25 Nov 2024 17:39:31 +0700 Subject: [PATCH 40/40] chore: change index name --- .../schema/v1/wallet-utils-contract-documents.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json b/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json index a39224e11e7..b1a012e26fc 100644 --- a/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json +++ b/packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json @@ -5,7 +5,7 @@ "canBeDeleted": true, "indices": [ { - "name": "ownerIdAndCreatedAt", + "name": "updated", "properties": [ { "$ownerId": "asc"