From 24de2352d0872536a4857eca565004585d0d9a0d Mon Sep 17 00:00:00 2001 From: QuantumExplorer Date: Wed, 23 Oct 2024 12:45:51 +0700 Subject: [PATCH] refactor: platform version refactoring into sub versions (#2269) --- .../find_identifier_and_binary_paths/mod.rs | 2 +- .../rs-dpp/src/data_contract/factory/mod.rs | 3 +- .../src/document/document_factory/mod.rs | 6 +- .../specialized_document_factory/mod.rs | 6 +- .../src/attribute.rs | 3 - .../src/version/dpp_versions.rs | 281 ---- .../dpp_asset_lock_versions/mod.rs | 8 + .../dpp_asset_lock_versions/v1.rs | 10 + .../dpp_versions/dpp_contract_versions/mod.rs | 74 + .../dpp_versions/dpp_contract_versions/v1.rs | 54 + .../dpp_versions/dpp_costs_versions/mod.rs | 8 + .../dpp_versions/dpp_costs_versions/v1.rs | 5 + .../dpp_versions/dpp_document_versions/mod.rs | 23 + .../dpp_versions/dpp_document_versions/v1.rs | 31 + .../dpp_versions/dpp_factory_versions/mod.rs | 9 + .../dpp_versions/dpp_factory_versions/v1.rs | 6 + .../dpp_versions/dpp_identity_versions/mod.rs | 17 + .../dpp_versions/dpp_identity_versions/v1.rs | 12 + .../dpp_versions/dpp_method_versions/mod.rs | 9 + .../dpp_versions/dpp_method_versions/v1.rs | 5 + .../mod.rs | 12 + .../v1.rs | 9 + .../v2.rs | 9 + .../mod.rs | 18 + .../v1.rs | 15 + .../mod.rs | 29 + .../v1.rs | 105 ++ .../dpp_state_transition_versions/mod.rs | 46 + .../dpp_state_transition_versions/v1.rs | 29 + .../dpp_state_transition_versions/v2.rs | 29 + .../dpp_validation_versions/mod.rs | 47 + .../dpp_validation_versions/v1.rs | 31 + .../dpp_validation_versions/v2.rs | 31 + .../dpp_versions/dpp_voting_versions/mod.rs | 11 + .../dpp_versions/dpp_voting_versions/v1.rs | 7 + .../dpp_versions/dpp_voting_versions/v2.rs | 7 + .../src/version/dpp_versions/mod.rs | 45 + .../src/version/drive_abci_versions.rs | 362 ----- .../drive_abci_method_versions/mod.rs | 166 ++ .../drive_abci_method_versions/v1.rs | 121 ++ .../drive_abci_method_versions/v2.rs | 122 ++ .../drive_abci_method_versions/v3.rs | 121 ++ .../drive_abci_query_versions/mod.rs | 68 + .../drive_abci_query_versions/v1.rs | 168 +++ .../drive_abci_structure_versions/mod.rs | 13 + .../drive_abci_structure_versions/v1.rs | 11 + .../drive_abci_validation_versions/mod.rs | 115 ++ .../drive_abci_validation_versions/v1.rs | 146 ++ .../drive_abci_validation_versions/v2.rs | 146 ++ .../drive_abci_validation_versions/v3.rs | 146 ++ .../drive_abci_withdrawal_constants/mod.rs | 8 + .../drive_abci_withdrawal_constants/v1.rs | 7 + .../drive_abci_withdrawal_constants/v2.rs | 7 + .../src/version/drive_abci_versions/mod.rs | 19 + .../src/version/drive_versions.rs | 756 ---------- .../drive_contract_method_versions/mod.rs | 59 + .../drive_contract_method_versions/v1.rs | 33 + .../drive_credit_pool_method_versions/mod.rs | 49 + .../drive_credit_pool_method_versions/v1.rs | 41 + .../drive_document_method_versions/mod.rs | 90 ++ .../drive_document_method_versions/v1.rs | 72 + .../drive_grove_method_versions/mod.rs | 66 + .../drive_grove_method_versions/v1.rs | 54 + .../drive_identity_method_versions/mod.rs | 199 +++ .../drive_identity_method_versions/v1.rs | 151 ++ .../mod.rs | 39 + .../v1.rs | 36 + .../drive_structure_version/mod.rs | 10 + .../drive_structure_version/v1.rs | 20 + .../drive_verify_method_versions/mod.rs | 76 + .../drive_verify_method_versions/v1.rs | 57 + .../drive_vote_method_versions/mod.rs | 56 + .../drive_vote_method_versions/v1.rs | 38 + .../drive_vote_method_versions/v2.rs | 38 + .../src/version/drive_versions/mod.rs | 161 ++ .../src/version/drive_versions/v1.rs | 100 ++ .../src/version/drive_versions/v2.rs | 100 ++ .../src/version/mocks/v2_test.rs | 1104 +------------- .../src/version/mocks/v3_test.rs | 1232 +-------------- .../rs-platform-version/src/version/mod.rs | 4 +- .../src/version/protocol_version.rs | 12 +- .../mod.rs} | 2 + .../system_data_contract_versions/v1.rs | 10 + .../{limits.rs => system_limits/mod.rs} | 2 + .../src/version/system_limits/v1.rs | 11 + .../rs-platform-version/src/version/v1.rs | 1343 +---------------- .../rs-platform-version/src/version/v2.rs | 1343 +---------------- .../rs-platform-version/src/version/v3.rs | 1342 +--------------- .../rs-platform-version/src/version/v4.rs | 1341 +--------------- 89 files changed, 4019 insertions(+), 8826 deletions(-) delete mode 100644 packages/rs-platform-version/src/version/dpp_versions.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/dpp_versions/mod.rs delete mode 100644 packages/rs-platform-version/src/version/drive_abci_versions.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs create mode 100644 packages/rs-platform-version/src/version/drive_abci_versions/mod.rs delete mode 100644 packages/rs-platform-version/src/version/drive_versions.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/mod.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/v1.rs create mode 100644 packages/rs-platform-version/src/version/drive_versions/v2.rs rename packages/rs-platform-version/src/version/{contracts.rs => system_data_contract_versions/mod.rs} (95%) create mode 100644 packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs rename packages/rs-platform-version/src/version/{limits.rs => system_limits/mod.rs} (96%) create mode 100644 packages/rs-platform-version/src/version/system_limits/v1.rs diff --git a/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs b/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs index a8f97466e7..ccd1e64fed 100644 --- a/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/schema/find_identifier_and_binary_paths/mod.rs @@ -1,9 +1,9 @@ use crate::data_contract::document_type::property::DocumentProperty; use crate::data_contract::document_type::v0::DocumentTypeV0; use crate::data_contract::document_type::DocumentType; -use crate::version::dpp_versions::DocumentTypeVersions; use crate::ProtocolError; use indexmap::IndexMap; +use platform_version::version::dpp_versions::dpp_contract_versions::DocumentTypeVersions; use std::collections::BTreeSet; mod v0; diff --git a/packages/rs-dpp/src/data_contract/factory/mod.rs b/packages/rs-dpp/src/data_contract/factory/mod.rs index ff3a11ec2e..0953489760 100644 --- a/packages/rs-dpp/src/data_contract/factory/mod.rs +++ b/packages/rs-dpp/src/data_contract/factory/mod.rs @@ -39,7 +39,8 @@ impl DataContractFactory { pub fn new(protocol_version: u32) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .data_contract_factory_structure_version { 0 => Ok(DataContractFactoryV0::new(protocol_version).into()), diff --git a/packages/rs-dpp/src/document/document_factory/mod.rs b/packages/rs-dpp/src/document/document_factory/mod.rs index b026e80551..75db720fd5 100644 --- a/packages/rs-dpp/src/document/document_factory/mod.rs +++ b/packages/rs-dpp/src/document/document_factory/mod.rs @@ -42,7 +42,8 @@ impl DocumentFactory { pub fn new(protocol_version: u32) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(DocumentFactoryV0::new(protocol_version).into()), @@ -60,7 +61,8 @@ impl DocumentFactory { ) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(DocumentFactoryV0::new_with_entropy_generator( diff --git a/packages/rs-dpp/src/document/specialized_document_factory/mod.rs b/packages/rs-dpp/src/document/specialized_document_factory/mod.rs index 2e8cd371cd..8a9c438804 100644 --- a/packages/rs-dpp/src/document/specialized_document_factory/mod.rs +++ b/packages/rs-dpp/src/document/specialized_document_factory/mod.rs @@ -42,7 +42,8 @@ impl SpecializedDocumentFactory { pub fn new(protocol_version: u32, data_contract: DataContract) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(SpecializedDocumentFactoryV0::new(protocol_version, data_contract).into()), @@ -61,7 +62,8 @@ impl SpecializedDocumentFactory { ) -> Result { let platform_version = PlatformVersion::get(protocol_version)?; match platform_version - .platform_architecture + .dpp + .factory_versions .document_factory_structure_version { 0 => Ok(SpecializedDocumentFactoryV0::new_with_entropy_generator( diff --git a/packages/rs-platform-serialization-derive/src/attribute.rs b/packages/rs-platform-serialization-derive/src/attribute.rs index d908a7c165..3b873607cd 100644 --- a/packages/rs-platform-serialization-derive/src/attribute.rs +++ b/packages/rs-platform-serialization-derive/src/attribute.rs @@ -5,7 +5,6 @@ use virtue::utils::{parse_tagged_attribute, ParsedAttribute}; pub struct ContainerAttributes { pub crate_name: String, pub untagged: bool, - pub unversioned: bool, pub bounds: Option<(String, Literal)>, pub decode_bounds: Option<(String, Literal)>, pub borrow_decode_bounds: Option<(String, Literal)>, @@ -16,7 +15,6 @@ impl Default for ContainerAttributes { fn default() -> Self { Self { crate_name: "::platform_serialization".to_string(), - unversioned: false, untagged: false, bounds: None, decode_bounds: None, @@ -111,7 +109,6 @@ impl FromAttribute for ContainerAttributes { pub struct FieldAttributes { pub with_serde: bool, pub with_platform_version: bool, - pub platform_version_path_bounds: String, } impl FromAttribute for FieldAttributes { diff --git a/packages/rs-platform-version/src/version/dpp_versions.rs b/packages/rs-platform-version/src/version/dpp_versions.rs deleted file mode 100644 index 713f9dc54a..0000000000 --- a/packages/rs-platform-version/src/version/dpp_versions.rs +++ /dev/null @@ -1,281 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds}; - -#[derive(Clone, Debug, Default)] -pub struct DPPVersion { - pub costs: CostVersions, - pub validation: DPPValidationVersions, - // TODO: Should be split by state transition type - pub state_transition_serialization_versions: StateTransitionSerializationVersions, - pub state_transition_conversion_versions: StateTransitionConversionVersions, - pub state_transition_method_versions: StateTransitionMethodVersions, - pub state_transitions: StateTransitionVersions, - pub contract_versions: ContractVersions, - pub document_versions: DocumentVersions, - pub identity_versions: IdentityVersions, - pub voting_versions: VotingVersions, - pub asset_lock_versions: AssetLockVersions, - pub methods: DPPMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionVersions { - pub documents: DocumentTransitionVersions, - pub identities: IdentityTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityTransitionVersions { - pub max_public_keys_in_creation: u16, - pub asset_locks: IdentityTransitionAssetLockVersions, - pub credit_withdrawal: IdentityCreditWithdrawalTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityCreditWithdrawalTransitionVersions { - pub default_constructor: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityTransitionAssetLockVersions { - pub required_asset_lock_duff_balance_for_processing_start_for_identity_create: u64, - pub required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: u64, - pub validate_asset_lock_transaction_structure: FeatureVersion, - pub validate_instant_asset_lock_proof_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTransitionVersions { - pub documents_batch_transition: DocumentsBatchTransitionVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentsBatchTransitionVersions { - pub validation: DocumentsBatchTransitionValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentsBatchTransitionValidationVersions { - pub find_duplicates_by_id: FeatureVersion, - pub validate_base_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct CostVersions { - pub signature_verify: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DPPValidationVersions { - pub json_schema_validator: JsonSchemaValidatorVersions, - pub data_contract: DataContractValidationVersions, - pub document_type: DocumentTypeValidationVersions, - pub voting: VotingValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DataContractValidationVersions { - pub validate: FeatureVersion, - pub validate_config_update: FeatureVersion, - pub validate_index_definitions: FeatureVersion, - pub validate_index_naming_duplicates: FeatureVersion, - pub validate_not_defined_properties: FeatureVersion, - pub validate_property_definition: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct VotingValidationVersions { - /// How long do we allow other contenders to join a contest after the first contender - pub allow_other_contenders_time_mainnet_ms: u64, - /// How long do we allow other contenders to join a contest after the first contender in a testing environment - pub allow_other_contenders_time_testing_ms: u64, - /// How many votes do we allow from the same masternode? - pub votes_allowed_per_masternode: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeValidationVersions { - pub validate_update: FeatureVersion, - pub unique_index_limit: u16, - pub contested_index_limit: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct JsonSchemaValidatorVersions { - pub new: FeatureVersion, - pub validate: FeatureVersion, - pub compile: FeatureVersion, - pub compile_and_validate: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionMethodVersions { - pub public_key_in_creation_methods: PublicKeyInCreationMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct PublicKeyInCreationMethodVersions { - pub from_public_key_signed_with_private_key: FeatureVersion, - pub from_public_key_signed_external: FeatureVersion, - pub hash: FeatureVersion, - pub duplicated_key_ids_witness: FeatureVersion, - pub duplicated_keys_witness: FeatureVersion, - pub validate_identity_public_keys_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionConversionVersions { - pub identity_to_identity_create_transition: FeatureVersion, - pub identity_to_identity_top_up_transition: FeatureVersion, - pub identity_to_identity_withdrawal_transition: FeatureVersion, - pub identity_to_identity_create_transition_with_signer: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct StateTransitionSerializationVersions { - pub identity_public_key_in_creation: FeatureVersionBounds, - pub identity_create_state_transition: FeatureVersionBounds, - pub identity_update_state_transition: FeatureVersionBounds, - pub identity_top_up_state_transition: FeatureVersionBounds, - pub identity_credit_withdrawal_state_transition: FeatureVersionBounds, - pub identity_credit_transfer_state_transition: FeatureVersionBounds, - pub masternode_vote_state_transition: FeatureVersionBounds, - pub contract_create_state_transition: FeatureVersionBounds, - pub contract_update_state_transition: FeatureVersionBounds, - pub documents_batch_state_transition: FeatureVersionBounds, - pub document_base_state_transition: FeatureVersionBounds, - pub document_create_state_transition: DocumentFeatureVersionBounds, - pub document_replace_state_transition: DocumentFeatureVersionBounds, - pub document_delete_state_transition: DocumentFeatureVersionBounds, - pub document_transfer_state_transition: DocumentFeatureVersionBounds, - pub document_update_price_state_transition: DocumentFeatureVersionBounds, - pub document_purchase_state_transition: DocumentFeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentFeatureVersionBounds { - pub bounds: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct ContractVersions { - /// The maximum that we can store a data contract in the state. There is a possibility that a client - /// sends a state transition serialized in a specific version and that the system re-serializes it - /// to the current version, and in so doing increases it's size. - pub max_serialized_size: u32, - /// This is how we serialize and deserialize a contract - pub contract_serialization_version: FeatureVersionBounds, - /// This is the structure of the Contract as it is defined for code paths - pub contract_structure_version: FeatureVersion, - pub created_data_contract_structure: FeatureVersion, - pub config: FeatureVersion, - pub methods: DataContractMethodVersions, - pub document_type_versions: DocumentTypeVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DataContractMethodVersions { - pub validate_document: FeatureVersion, - pub validate_update: FeatureVersion, - pub schema: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeClassMethodVersions { - pub try_from_schema: FeatureVersion, - pub create_document_types_from_document_schemas: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeIndexVersions { - pub index_levels_from_indices: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeVersions { - pub index_versions: DocumentTypeIndexVersions, - pub class_method_versions: DocumentTypeClassMethodVersions, - /// This is for the overall structure of the document type, like DocumentTypeV0 - pub structure_version: FeatureVersion, - pub schema: DocumentTypeSchemaVersions, - pub methods: DocumentTypeMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeMethodVersions { - pub create_document_from_data: FeatureVersion, - pub create_document_with_prevalidated_properties: FeatureVersion, - pub prefunded_voting_balance_for_document: FeatureVersion, - pub contested_vote_poll_for_document: FeatureVersion, - pub estimated_size: FeatureVersion, - pub index_for_types: FeatureVersion, - pub max_size: FeatureVersion, - pub serialize_value_for_key: FeatureVersion, - pub deserialize_value_for_key: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentTypeSchemaVersions { - pub enrich_with_base_schema: FeatureVersion, - pub find_identifier_and_binary_paths: FeatureVersion, - pub validate_max_depth: FeatureVersion, - pub max_depth: u16, - pub recursive_schema_validator_versions: RecursiveSchemaValidatorVersions, - pub validate_schema_compatibility: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct RecursiveSchemaValidatorVersions { - pub traversal_validator: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct AssetLockVersions { - pub reduced_asset_lock_value: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityVersions { - /// This is the structure of the Identity as it is defined for code paths - pub identity_structure_version: FeatureVersion, - pub identity_key_structure_version: FeatureVersion, - pub identity_key_type_method_versions: IdentityKeyTypeMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct VotingVersions { - pub default_vote_poll_time_duration_mainnet_ms: u64, - pub default_vote_poll_time_duration_test_network_ms: u64, - pub contested_document_vote_poll_stored_info_version: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct IdentityKeyTypeMethodVersions { - pub random_public_key_data: FeatureVersion, - pub random_public_and_private_key_data: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentVersions { - // This is for the overall structure of the document, like DocumentV0 - pub document_structure_version: FeatureVersion, - pub document_serialization_version: FeatureVersionBounds, - pub document_cbor_serialization_version: FeatureVersionBounds, - pub extended_document_structure_version: FeatureVersion, - pub extended_document_serialization_version: FeatureVersionBounds, - pub document_method_versions: DocumentMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DocumentMethodVersions { - pub is_equal_ignoring_timestamps: FeatureVersion, - pub hash: FeatureVersion, - pub get_raw_for_contract: FeatureVersion, - pub get_raw_for_document_type: FeatureVersion, - pub try_into_asset_unlock_base_transaction_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DPPMethodVersions { - pub epoch_core_reward_credits_for_distribution: FeatureVersion, - pub daily_withdrawal_limit: FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs new file mode 100644 index 0000000000..50f27a70ed --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/mod.rs @@ -0,0 +1,8 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPAssetLockVersions { + pub reduced_asset_lock_value: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs new file mode 100644 index 0000000000..0e494c8662 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_asset_lock_versions/v1.rs @@ -0,0 +1,10 @@ +use crate::version::dpp_versions::dpp_asset_lock_versions::DPPAssetLockVersions; +use versioned_feature_core::FeatureVersionBounds; + +pub const DPP_ASSET_LOCK_VERSIONS_V1: DPPAssetLockVersions = DPPAssetLockVersions { + reduced_asset_lock_value: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs new file mode 100644 index 0000000000..91fd85cbae --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/mod.rs @@ -0,0 +1,74 @@ +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPContractVersions { + /// The maximum that we can store a data contract in the state. There is a possibility that a client + /// sends a state transition serialized in a specific version and that the system re-serializes it + /// to the current version, and in so doing increases it's size. + pub max_serialized_size: u32, + /// This is how we serialize and deserialize a contract + pub contract_serialization_version: FeatureVersionBounds, + /// This is the structure of the Contract as it is defined for code paths + pub contract_structure_version: FeatureVersion, + pub created_data_contract_structure: FeatureVersion, + pub config: FeatureVersion, + pub methods: DataContractMethodVersions, + pub document_type_versions: DocumentTypeVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DataContractMethodVersions { + pub validate_document: FeatureVersion, + pub validate_update: FeatureVersion, + pub schema: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeClassMethodVersions { + pub try_from_schema: FeatureVersion, + pub create_document_types_from_document_schemas: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeIndexVersions { + pub index_levels_from_indices: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeVersions { + pub index_versions: DocumentTypeIndexVersions, + pub class_method_versions: DocumentTypeClassMethodVersions, + /// This is for the overall structure of the document type, like DocumentTypeV0 + pub structure_version: FeatureVersion, + pub schema: DocumentTypeSchemaVersions, + pub methods: DocumentTypeMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeMethodVersions { + pub create_document_from_data: FeatureVersion, + pub create_document_with_prevalidated_properties: FeatureVersion, + pub prefunded_voting_balance_for_document: FeatureVersion, + pub contested_vote_poll_for_document: FeatureVersion, + pub estimated_size: FeatureVersion, + pub index_for_types: FeatureVersion, + pub max_size: FeatureVersion, + pub serialize_value_for_key: FeatureVersion, + pub deserialize_value_for_key: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeSchemaVersions { + pub enrich_with_base_schema: FeatureVersion, + pub find_identifier_and_binary_paths: FeatureVersion, + pub validate_max_depth: FeatureVersion, + pub max_depth: u16, + pub recursive_schema_validator_versions: RecursiveSchemaValidatorVersions, + pub validate_schema_compatibility: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct RecursiveSchemaValidatorVersions { + pub traversal_validator: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs new file mode 100644 index 0000000000..5483e66c95 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_contract_versions/v1.rs @@ -0,0 +1,54 @@ +use crate::version::dpp_versions::dpp_contract_versions::{ + DPPContractVersions, DataContractMethodVersions, DocumentTypeClassMethodVersions, + DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, + DocumentTypeVersions, RecursiveSchemaValidatorVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const CONTRACT_VERSIONS_V1: DPPContractVersions = DPPContractVersions { + max_serialized_size: 65000, + contract_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_structure_version: 0, + created_data_contract_structure: 0, + config: 0, + methods: DataContractMethodVersions { + validate_document: 0, + validate_update: 0, + schema: 0, + }, + document_type_versions: DocumentTypeVersions { + index_versions: DocumentTypeIndexVersions { + index_levels_from_indices: 0, + }, + class_method_versions: DocumentTypeClassMethodVersions { + try_from_schema: 0, + create_document_types_from_document_schemas: 0, + }, + structure_version: 0, + schema: DocumentTypeSchemaVersions { + enrich_with_base_schema: 0, + find_identifier_and_binary_paths: 0, + validate_max_depth: 0, + max_depth: 256, + recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { + traversal_validator: 0, + }, + validate_schema_compatibility: 0, + }, + methods: DocumentTypeMethodVersions { + create_document_from_data: 0, + create_document_with_prevalidated_properties: 0, + prefunded_voting_balance_for_document: 0, + contested_vote_poll_for_document: 0, + estimated_size: 0, + index_for_types: 0, + max_size: 0, + serialize_value_for_key: 0, + deserialize_value_for_key: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs new file mode 100644 index 0000000000..672e076137 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/mod.rs @@ -0,0 +1,8 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPCostsVersions { + pub signature_verify: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs new file mode 100644 index 0000000000..0d8d5622ec --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_costs_versions/v1.rs @@ -0,0 +1,5 @@ +use crate::version::dpp_versions::dpp_costs_versions::DPPCostsVersions; + +pub const DPP_COSTS_VERSIONS_V1: DPPCostsVersions = DPPCostsVersions { + signature_verify: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs new file mode 100644 index 0000000000..d5a81808e4 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/mod.rs @@ -0,0 +1,23 @@ +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPDocumentVersions { + // This is for the overall structure of the document, like DocumentV0 + pub document_structure_version: FeatureVersion, + pub document_serialization_version: FeatureVersionBounds, + pub document_cbor_serialization_version: FeatureVersionBounds, + pub extended_document_structure_version: FeatureVersion, + pub extended_document_serialization_version: FeatureVersionBounds, + pub document_method_versions: DocumentMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentMethodVersions { + pub is_equal_ignoring_timestamps: FeatureVersion, + pub hash: FeatureVersion, + pub get_raw_for_contract: FeatureVersion, + pub get_raw_for_document_type: FeatureVersion, + pub try_into_asset_unlock_base_transaction_info: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs new file mode 100644 index 0000000000..8911129ab6 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_document_versions/v1.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_document_versions::{ + DPPDocumentVersions, DocumentMethodVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const DOCUMENT_VERSIONS_V1: DPPDocumentVersions = DPPDocumentVersions { + document_structure_version: 0, + document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_cbor_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + extended_document_structure_version: 0, + extended_document_serialization_version: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_method_versions: DocumentMethodVersions { + is_equal_ignoring_timestamps: 0, + hash: 0, + get_raw_for_contract: 0, + get_raw_for_document_type: 0, + try_into_asset_unlock_base_transaction_info: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs new file mode 100644 index 0000000000..1ce467d139 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/mod.rs @@ -0,0 +1,9 @@ +pub mod v1; + +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DPPFactoryVersions { + pub data_contract_factory_structure_version: FeatureVersion, + pub document_factory_structure_version: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs new file mode 100644 index 0000000000..1eb875eab1 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_factory_versions/v1.rs @@ -0,0 +1,6 @@ +use crate::version::dpp_versions::dpp_factory_versions::DPPFactoryVersions; + +pub const DPP_FACTORY_VERSIONS_V1: DPPFactoryVersions = DPPFactoryVersions { + data_contract_factory_structure_version: 0, + document_factory_structure_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs new file mode 100644 index 0000000000..df9356c003 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/mod.rs @@ -0,0 +1,17 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPIdentityVersions { + /// This is the structure of the Identity as it is defined for code paths + pub identity_structure_version: FeatureVersion, + pub identity_key_structure_version: FeatureVersion, + pub identity_key_type_method_versions: IdentityKeyTypeMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityKeyTypeMethodVersions { + pub random_public_key_data: FeatureVersion, + pub random_public_and_private_key_data: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs new file mode 100644 index 0000000000..6726dbc55d --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_identity_versions/v1.rs @@ -0,0 +1,12 @@ +use crate::version::dpp_versions::dpp_identity_versions::{ + DPPIdentityVersions, IdentityKeyTypeMethodVersions, +}; + +pub const IDENTITY_VERSIONS_V1: DPPIdentityVersions = DPPIdentityVersions { + identity_structure_version: 0, + identity_key_structure_version: 0, + identity_key_type_method_versions: IdentityKeyTypeMethodVersions { + random_public_key_data: 0, + random_public_and_private_key_data: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs new file mode 100644 index 0000000000..a39362f90e --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/mod.rs @@ -0,0 +1,9 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPMethodVersions { + pub epoch_core_reward_credits_for_distribution: FeatureVersion, + pub daily_withdrawal_limit: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs new file mode 100644 index 0000000000..dfc749b7b3 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_method_versions/v1.rs @@ -0,0 +1,5 @@ +use crate::version::dpp_versions::dpp_method_versions::DPPMethodVersions; +pub const DPP_METHOD_VERSIONS_V1: DPPMethodVersions = DPPMethodVersions { + epoch_core_reward_credits_for_distribution: 0, + daily_withdrawal_limit: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs new file mode 100644 index 0000000000..4c2e0a22a3 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/mod.rs @@ -0,0 +1,12 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionConversionVersions { + pub identity_to_identity_create_transition: FeatureVersion, + pub identity_to_identity_top_up_transition: FeatureVersion, + pub identity_to_identity_withdrawal_transition: FeatureVersion, + pub identity_to_identity_create_transition_with_signer: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs new file mode 100644 index 0000000000..d465374250 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v1.rs @@ -0,0 +1,9 @@ +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; + +pub const STATE_TRANSITION_CONVERSION_VERSIONS_V1: DPPStateTransitionConversionVersions = + DPPStateTransitionConversionVersions { + identity_to_identity_create_transition: 0, + identity_to_identity_top_up_transition: 0, + identity_to_identity_withdrawal_transition: 0, + identity_to_identity_create_transition_with_signer: 0, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs new file mode 100644 index 0000000000..17fd17bd94 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_conversion_versions/v2.rs @@ -0,0 +1,9 @@ +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; + +pub const STATE_TRANSITION_CONVERSION_VERSIONS_V2: DPPStateTransitionConversionVersions = + DPPStateTransitionConversionVersions { + identity_to_identity_create_transition: 0, + identity_to_identity_top_up_transition: 0, + identity_to_identity_withdrawal_transition: 1, + identity_to_identity_create_transition_with_signer: 0, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs new file mode 100644 index 0000000000..ad2a16e431 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/mod.rs @@ -0,0 +1,18 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionMethodVersions { + pub public_key_in_creation_methods: PublicKeyInCreationMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct PublicKeyInCreationMethodVersions { + pub from_public_key_signed_with_private_key: FeatureVersion, + pub from_public_key_signed_external: FeatureVersion, + pub hash: FeatureVersion, + pub duplicated_key_ids_witness: FeatureVersion, + pub duplicated_keys_witness: FeatureVersion, + pub validate_identity_public_keys_structure: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs new file mode 100644 index 0000000000..f8844fa69e --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_method_versions/v1.rs @@ -0,0 +1,15 @@ +use crate::version::dpp_versions::dpp_state_transition_method_versions::{ + DPPStateTransitionMethodVersions, PublicKeyInCreationMethodVersions, +}; + +pub const STATE_TRANSITION_METHOD_VERSIONS_V1: DPPStateTransitionMethodVersions = + DPPStateTransitionMethodVersions { + public_key_in_creation_methods: PublicKeyInCreationMethodVersions { + from_public_key_signed_with_private_key: 0, + from_public_key_signed_external: 0, + hash: 0, + duplicated_key_ids_witness: 0, + duplicated_keys_witness: 0, + validate_identity_public_keys_structure: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs new file mode 100644 index 0000000000..3ad838e5de --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/mod.rs @@ -0,0 +1,29 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionSerializationVersions { + pub identity_public_key_in_creation: FeatureVersionBounds, + pub identity_create_state_transition: FeatureVersionBounds, + pub identity_update_state_transition: FeatureVersionBounds, + pub identity_top_up_state_transition: FeatureVersionBounds, + pub identity_credit_withdrawal_state_transition: FeatureVersionBounds, + pub identity_credit_transfer_state_transition: FeatureVersionBounds, + pub masternode_vote_state_transition: FeatureVersionBounds, + pub contract_create_state_transition: FeatureVersionBounds, + pub contract_update_state_transition: FeatureVersionBounds, + pub documents_batch_state_transition: FeatureVersionBounds, + pub document_base_state_transition: FeatureVersionBounds, + pub document_create_state_transition: DocumentFeatureVersionBounds, + pub document_replace_state_transition: DocumentFeatureVersionBounds, + pub document_delete_state_transition: DocumentFeatureVersionBounds, + pub document_transfer_state_transition: DocumentFeatureVersionBounds, + pub document_update_price_state_transition: DocumentFeatureVersionBounds, + pub document_purchase_state_transition: DocumentFeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentFeatureVersionBounds { + pub bounds: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs new file mode 100644 index 0000000000..917b8405f0 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_serialization_versions/v1.rs @@ -0,0 +1,105 @@ +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::{ + DPPStateTransitionSerializationVersions, DocumentFeatureVersionBounds, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const STATE_TRANSITION_SERIALIZATION_VERSIONS_V1: DPPStateTransitionSerializationVersions = + DPPStateTransitionSerializationVersions { + identity_public_key_in_creation: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_top_up_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_withdrawal_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_credit_transfer_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + masternode_vote_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_create_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contract_update_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + documents_batch_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_base_state_transition: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_create_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_replace_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_delete_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_transfer_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_update_price_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + document_purchase_state_transition: DocumentFeatureVersionBounds { + bounds: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + }; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs new file mode 100644 index 0000000000..407e6e1c52 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/mod.rs @@ -0,0 +1,46 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPStateTransitionVersions { + pub documents: DocumentTransitionVersions, + pub identities: IdentityTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityTransitionVersions { + pub max_public_keys_in_creation: u16, + pub asset_locks: IdentityTransitionAssetLockVersions, + pub credit_withdrawal: IdentityCreditWithdrawalTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityCreditWithdrawalTransitionVersions { + pub default_constructor: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityTransitionAssetLockVersions { + pub required_asset_lock_duff_balance_for_processing_start_for_identity_create: u64, + pub required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: u64, + pub validate_asset_lock_transaction_structure: FeatureVersion, + pub validate_instant_asset_lock_proof_structure: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTransitionVersions { + pub documents_batch_transition: DocumentsBatchTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentsBatchTransitionVersions { + pub validation: DocumentsBatchTransitionValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentsBatchTransitionValidationVersions { + pub find_duplicates_by_id: FeatureVersion, + pub validate_base_structure: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs new file mode 100644 index 0000000000..2dac96fd8f --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v1.rs @@ -0,0 +1,29 @@ +use crate::version::dpp_versions::dpp_state_transition_versions::{ + DPPStateTransitionVersions, DocumentTransitionVersions, + DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityTransitionAssetLockVersions, + IdentityTransitionVersions, +}; + +pub const STATE_TRANSITION_VERSIONS_V1: DPPStateTransitionVersions = DPPStateTransitionVersions { + documents: DocumentTransitionVersions { + documents_batch_transition: DocumentsBatchTransitionVersions { + validation: DocumentsBatchTransitionValidationVersions { + find_duplicates_by_id: 0, + validate_base_structure: 0, + }, + }, + }, + identities: IdentityTransitionVersions { + max_public_keys_in_creation: 6, + asset_locks: IdentityTransitionAssetLockVersions { + required_asset_lock_duff_balance_for_processing_start_for_identity_create: 200000, + required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: 50000, + validate_asset_lock_transaction_structure: 0, + validate_instant_asset_lock_proof_structure: 0, + }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs new file mode 100644 index 0000000000..2a5d2d0651 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_state_transition_versions/v2.rs @@ -0,0 +1,29 @@ +use crate::version::dpp_versions::dpp_state_transition_versions::{ + DPPStateTransitionVersions, DocumentTransitionVersions, + DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityTransitionAssetLockVersions, + IdentityTransitionVersions, +}; + +pub const STATE_TRANSITION_VERSIONS_V2: DPPStateTransitionVersions = DPPStateTransitionVersions { + documents: DocumentTransitionVersions { + documents_batch_transition: DocumentsBatchTransitionVersions { + validation: DocumentsBatchTransitionValidationVersions { + find_duplicates_by_id: 0, + validate_base_structure: 0, + }, + }, + }, + identities: IdentityTransitionVersions { + max_public_keys_in_creation: 6, + asset_locks: IdentityTransitionAssetLockVersions { + required_asset_lock_duff_balance_for_processing_start_for_identity_create: 200000, + required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: 50000, + validate_asset_lock_transaction_structure: 0, + validate_instant_asset_lock_proof_structure: 0, + }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 1, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs new file mode 100644 index 0000000000..ebaa11678f --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/mod.rs @@ -0,0 +1,47 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPValidationVersions { + pub json_schema_validator: JsonSchemaValidatorVersions, + pub data_contract: DataContractValidationVersions, + pub document_type: DocumentTypeValidationVersions, + pub voting: VotingValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DataContractValidationVersions { + pub validate: FeatureVersion, + pub validate_config_update: FeatureVersion, + pub validate_index_definitions: FeatureVersion, + pub validate_index_naming_duplicates: FeatureVersion, + pub validate_not_defined_properties: FeatureVersion, + pub validate_property_definition: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct VotingValidationVersions { + /// How long do we allow other contenders to join a contest after the first contender + pub allow_other_contenders_time_mainnet_ms: u64, + /// How long do we allow other contenders to join a contest after the first contender in a testing environment + pub allow_other_contenders_time_testing_ms: u64, + /// How many votes do we allow from the same masternode? + pub votes_allowed_per_masternode: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct DocumentTypeValidationVersions { + pub validate_update: FeatureVersion, + pub unique_index_limit: u16, + pub contested_index_limit: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct JsonSchemaValidatorVersions { + pub new: FeatureVersion, + pub validate: FeatureVersion, + pub compile: FeatureVersion, + pub compile_and_validate: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs new file mode 100644 index 0000000000..e698694e62 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v1.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_validation_versions::{ + DPPValidationVersions, DataContractValidationVersions, DocumentTypeValidationVersions, + JsonSchemaValidatorVersions, VotingValidationVersions, +}; + +pub const DPP_VALIDATION_VERSIONS_V1: DPPValidationVersions = DPPValidationVersions { + json_schema_validator: JsonSchemaValidatorVersions { + new: 0, + validate: 0, + compile: 0, + compile_and_validate: 0, + }, + data_contract: DataContractValidationVersions { + validate: 0, + validate_config_update: 0, + validate_index_definitions: 0, + validate_index_naming_duplicates: 0, + validate_not_defined_properties: 0, + validate_property_definition: 0, + }, + document_type: DocumentTypeValidationVersions { + validate_update: 0, + contested_index_limit: 1, + unique_index_limit: 10, + }, + voting: VotingValidationVersions { + allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms + allow_other_contenders_time_testing_ms: 604_800_000, // 1 week in ms for v1 (changes in v2) + votes_allowed_per_masternode: 5, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs new file mode 100644 index 0000000000..7122390711 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_validation_versions/v2.rs @@ -0,0 +1,31 @@ +use crate::version::dpp_versions::dpp_validation_versions::{ + DPPValidationVersions, DataContractValidationVersions, DocumentTypeValidationVersions, + JsonSchemaValidatorVersions, VotingValidationVersions, +}; + +pub const DPP_VALIDATION_VERSIONS_V2: DPPValidationVersions = DPPValidationVersions { + json_schema_validator: JsonSchemaValidatorVersions { + new: 0, + validate: 0, + compile: 0, + compile_and_validate: 0, + }, + data_contract: DataContractValidationVersions { + validate: 0, + validate_config_update: 0, + validate_index_definitions: 0, + validate_index_naming_duplicates: 0, + validate_not_defined_properties: 0, + validate_property_definition: 0, + }, + document_type: DocumentTypeValidationVersions { + validate_update: 0, + contested_index_limit: 1, + unique_index_limit: 10, + }, + voting: VotingValidationVersions { + allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms + allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes + votes_allowed_per_masternode: 5, + }, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs new file mode 100644 index 0000000000..900fab5a43 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/mod.rs @@ -0,0 +1,11 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DPPVotingVersions { + pub default_vote_poll_time_duration_mainnet_ms: u64, + pub default_vote_poll_time_duration_test_network_ms: u64, + pub contested_document_vote_poll_stored_info_version: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs new file mode 100644 index 0000000000..944a295d1f --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v1.rs @@ -0,0 +1,7 @@ +use crate::version::dpp_versions::dpp_voting_versions::DPPVotingVersions; + +pub const VOTING_VERSION_V1: DPPVotingVersions = DPPVotingVersions { + default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks + default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks + contested_document_vote_poll_stored_info_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs new file mode 100644 index 0000000000..de072e8783 --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/dpp_voting_versions/v2.rs @@ -0,0 +1,7 @@ +use crate::version::dpp_versions::dpp_voting_versions::DPPVotingVersions; + +pub const VOTING_VERSION_V2: DPPVotingVersions = DPPVotingVersions { + default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks + default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes + contested_document_vote_poll_stored_info_version: 0, +}; diff --git a/packages/rs-platform-version/src/version/dpp_versions/mod.rs b/packages/rs-platform-version/src/version/dpp_versions/mod.rs new file mode 100644 index 0000000000..e51203512c --- /dev/null +++ b/packages/rs-platform-version/src/version/dpp_versions/mod.rs @@ -0,0 +1,45 @@ +pub mod dpp_asset_lock_versions; +pub mod dpp_contract_versions; +pub mod dpp_costs_versions; +pub mod dpp_document_versions; +pub mod dpp_factory_versions; +pub mod dpp_identity_versions; +pub mod dpp_method_versions; +pub mod dpp_state_transition_conversion_versions; +pub mod dpp_state_transition_method_versions; +pub mod dpp_state_transition_serialization_versions; +pub mod dpp_state_transition_versions; +pub mod dpp_validation_versions; +pub mod dpp_voting_versions; + +use dpp_asset_lock_versions::DPPAssetLockVersions; +use dpp_contract_versions::DPPContractVersions; +use dpp_costs_versions::DPPCostsVersions; +use dpp_document_versions::DPPDocumentVersions; +use dpp_factory_versions::DPPFactoryVersions; +use dpp_identity_versions::DPPIdentityVersions; +use dpp_method_versions::DPPMethodVersions; +use dpp_state_transition_conversion_versions::DPPStateTransitionConversionVersions; +use dpp_state_transition_method_versions::DPPStateTransitionMethodVersions; +use dpp_state_transition_serialization_versions::DPPStateTransitionSerializationVersions; +use dpp_state_transition_versions::DPPStateTransitionVersions; +use dpp_validation_versions::DPPValidationVersions; +use dpp_voting_versions::DPPVotingVersions; + +#[derive(Clone, Debug, Default)] +pub struct DPPVersion { + pub costs: DPPCostsVersions, + pub validation: DPPValidationVersions, + // TODO: Should be split by state transition type + pub state_transition_serialization_versions: DPPStateTransitionSerializationVersions, + pub state_transition_conversion_versions: DPPStateTransitionConversionVersions, + pub state_transition_method_versions: DPPStateTransitionMethodVersions, + pub state_transitions: DPPStateTransitionVersions, + pub contract_versions: DPPContractVersions, + pub document_versions: DPPDocumentVersions, + pub identity_versions: DPPIdentityVersions, + pub voting_versions: DPPVotingVersions, + pub asset_lock_versions: DPPAssetLockVersions, + pub methods: DPPMethodVersions, + pub factory_versions: DPPFactoryVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions.rs b/packages/rs-platform-version/src/version/drive_abci_versions.rs deleted file mode 100644 index 03ac8cad96..0000000000 --- a/packages/rs-platform-version/src/version/drive_abci_versions.rs +++ /dev/null @@ -1,362 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds, OptionalFeatureVersion}; - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciVersion { - pub structs: DriveAbciStructureVersions, - pub methods: DriveAbciMethodVersions, - pub validation_and_processing: DriveAbciValidationVersions, - pub withdrawal_constants: DriveAbciWithdrawalConstants, - pub query: DriveAbciQueryVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryVersions { - pub max_returned_elements: u16, - pub response_metadata: FeatureVersion, - pub proofs_query: FeatureVersionBounds, - pub document_query: FeatureVersionBounds, - pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, - pub identity_based_queries: DriveAbciQueryIdentityVersions, - pub validator_queries: DriveAbciQueryValidatorVersions, - pub data_contract_based_queries: DriveAbciQueryDataContractVersions, - pub voting_based_queries: DriveAbciQueryVotingVersions, - pub system: DriveAbciQuerySystemVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryPrefundedSpecializedBalancesVersions { - pub balance: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryIdentityVersions { - pub identity: FeatureVersionBounds, - pub identities_contract_keys: FeatureVersionBounds, - pub keys: FeatureVersionBounds, - pub identity_nonce: FeatureVersionBounds, - pub identity_contract_nonce: FeatureVersionBounds, - pub balance: FeatureVersionBounds, - pub identities_balances: FeatureVersionBounds, - pub balance_and_revision: FeatureVersionBounds, - pub identity_by_public_key_hash: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryValidatorVersions { - pub proposed_block_counts_by_evonode_ids: FeatureVersionBounds, - pub proposed_block_counts_by_range: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryVotingVersions { - pub vote_polls_by_end_date_query: FeatureVersionBounds, - pub contested_resource_vote_state: FeatureVersionBounds, - pub contested_resource_voters_for_identity: FeatureVersionBounds, - pub contested_resource_identity_vote_status: FeatureVersionBounds, - pub contested_resources: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQueryDataContractVersions { - pub data_contract: FeatureVersionBounds, - pub data_contract_history: FeatureVersionBounds, - pub data_contracts: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciQuerySystemVersions { - pub version_upgrade_state: FeatureVersionBounds, - pub version_upgrade_vote_status: FeatureVersionBounds, - pub epoch_infos: FeatureVersionBounds, - pub current_quorums_info: FeatureVersionBounds, - pub partial_status: FeatureVersionBounds, - pub path_elements: FeatureVersionBounds, - pub total_credits_in_platform: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStructureVersions { - pub platform_state_structure: FeatureVersion, - pub platform_state_for_saving_structure_default: FeatureVersion, - pub state_transition_execution_context: FeatureVersion, - pub commit: FeatureVersion, - pub masternode: FeatureVersion, - pub signature_verification_quorum_set: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciMethodVersions { - pub engine: DriveAbciEngineMethodVersions, - pub initialization: DriveAbciInitializationMethodVersions, - pub core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions, - pub protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions, - pub block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions, - pub core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants, - pub core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions, - pub fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions, - pub fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions, - pub withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions, - pub voting: DriveAbciVotingMethodVersions, - pub state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions, - pub epoch: DriveAbciEpochMethodVersions, - pub block_start: DriveAbciBlockStartMethodVersions, - pub block_end: DriveAbciBlockEndMethodVersions, - pub platform_state_storage: DriveAbciPlatformStateStorageMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationVersions { - pub state_transitions: DriveAbciStateTransitionValidationVersions, - pub process_state_transition: FeatureVersion, - pub state_transition_to_execution_event_for_check_tx: FeatureVersion, - pub penalties: PenaltyAmounts, - pub event_constants: DriveAbciValidationConstants, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciWithdrawalConstants { - pub core_expiration_blocks: u32, - pub cleanup_expired_locks_of_withdrawal_amounts_limit: u16, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationConstants { - pub maximum_vote_polls_to_process: u16, - pub maximum_contenders_to_consider: u16, -} - -/// All of these penalty amounts are in credits -#[derive(Clone, Debug, Default)] -pub struct PenaltyAmounts { - pub identity_id_not_correct: u64, - pub unique_key_already_present: u64, - pub validation_of_added_keys_structure_failure: u64, - pub validation_of_added_keys_proof_of_possession_failure: u64, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciPlatformStateStorageMethodVersions { - pub fetch_platform_state: FeatureVersion, - pub store_platform_state: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciDocumentsStateTransitionValidationVersions { - pub balance_pre_check: FeatureVersion, - pub basic_structure: FeatureVersion, - pub advanced_structure: FeatureVersion, - pub revision: FeatureVersion, - pub state: FeatureVersion, - pub transform_into_action: FeatureVersion, - pub data_triggers: DriveAbciValidationDataTriggerAndBindingVersions, - pub is_allowed: FeatureVersion, - pub document_create_transition_structure_validation: FeatureVersion, - pub document_delete_transition_structure_validation: FeatureVersion, - pub document_replace_transition_structure_validation: FeatureVersion, - pub document_transfer_transition_structure_validation: FeatureVersion, - pub document_purchase_transition_structure_validation: FeatureVersion, - pub document_update_price_transition_structure_validation: FeatureVersion, - pub document_create_transition_state_validation: FeatureVersion, - pub document_delete_transition_state_validation: FeatureVersion, - pub document_replace_transition_state_validation: FeatureVersion, - pub document_transfer_transition_state_validation: FeatureVersion, - pub document_purchase_transition_state_validation: FeatureVersion, - pub document_update_price_transition_state_validation: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationDataTriggerAndBindingVersions { - pub bindings: FeatureVersion, - pub triggers: DriveAbciValidationDataTriggerVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciValidationDataTriggerVersions { - pub create_contact_request_data_trigger: FeatureVersion, - pub create_domain_data_trigger: FeatureVersion, - pub create_identity_data_trigger: FeatureVersion, - pub create_feature_flag_data_trigger: FeatureVersion, - pub create_masternode_reward_shares_data_trigger: FeatureVersion, - pub delete_withdrawal_data_trigger: FeatureVersion, - pub reject_data_trigger: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionValidationVersion { - pub basic_structure: OptionalFeatureVersion, - pub advanced_structure: OptionalFeatureVersion, - pub identity_signatures: OptionalFeatureVersion, - pub advanced_minimum_balance_pre_check: OptionalFeatureVersion, - pub nonce: OptionalFeatureVersion, - pub state: FeatureVersion, - pub transform_into_action: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionValidationVersions { - pub common_validation_methods: DriveAbciStateTransitionCommonValidationVersions, - pub max_asset_lock_usage_attempts: u16, - pub identity_create_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_update_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_credit_withdrawal_state_transition: DriveAbciStateTransitionValidationVersion, - pub identity_credit_withdrawal_state_transition_purpose_matches_requirements: FeatureVersion, - pub identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion, - pub masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion, - pub contract_create_state_transition: DriveAbciStateTransitionValidationVersion, - pub contract_update_state_transition: DriveAbciStateTransitionValidationVersion, - pub documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionCommonValidationVersions { - pub asset_locks: DriveAbciAssetLockValidationVersions, - pub validate_identity_public_key_contract_bounds: FeatureVersion, - pub validate_identity_public_key_ids_dont_exist_in_state: FeatureVersion, - pub validate_identity_public_key_ids_exist_in_state: FeatureVersion, - pub validate_state_transition_identity_signed: FeatureVersion, - pub validate_unique_identity_public_key_hashes_in_state: FeatureVersion, - pub validate_master_key_uniqueness: FeatureVersion, - pub validate_simple_pre_check_balance: FeatureVersion, -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct DriveAbciAssetLockValidationVersions { - pub fetch_asset_lock_transaction_output_sync: FeatureVersion, - pub verify_asset_lock_is_not_spent_and_has_enough_balance: FeatureVersion, -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct DriveAbciEngineMethodVersions { - pub init_chain: FeatureVersion, - pub check_tx: FeatureVersion, - pub run_block_proposal: FeatureVersion, - pub finalize_block_proposal: FeatureVersion, - pub consensus_params_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreBasedUpdatesMethodVersions { - pub update_core_info: FeatureVersion, - pub update_masternode_list: FeatureVersion, - pub update_quorum_info: FeatureVersion, - pub masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - pub get_voter_identity_key: FeatureVersion, - pub get_operator_identity_keys: FeatureVersion, - pub get_owner_identity_withdrawal_key: FeatureVersion, - pub get_owner_identity_owner_key: FeatureVersion, - pub get_voter_identifier_from_masternode_list_item: FeatureVersion, - pub get_operator_identifier_from_masternode_list_item: FeatureVersion, - pub create_operator_identity: FeatureVersion, - pub create_owner_identity: FeatureVersion, - pub create_voter_identity: FeatureVersion, - pub disable_identity_keys: FeatureVersion, - pub update_masternode_identities: FeatureVersion, - pub update_operator_identity: FeatureVersion, - pub update_owner_withdrawal_address: FeatureVersion, - pub update_voter_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciInitializationMethodVersions { - pub initial_core_height_and_time: FeatureVersion, - pub create_genesis_state: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockFeeProcessingMethodVersions { - pub add_process_epoch_change_operations: FeatureVersion, - pub process_block_fees: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreInstantSendLockMethodVersions { - pub verify_recent_signature_locally: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciCoreChainLockMethodVersionsAndConstants { - pub choose_quorum: FeatureVersion, - pub verify_chain_lock: FeatureVersion, - pub verify_chain_lock_locally: FeatureVersion, - pub verify_chain_lock_through_core: FeatureVersion, - pub make_sure_core_is_synced_to_chain_lock: FeatureVersion, - pub recent_block_count_amount: u32, //what constitutes a recent block, for v0 it's 2. -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciFeePoolInwardsDistributionMethodVersions { - pub add_distribute_block_fees_into_pools_operations: FeatureVersion, - pub add_distribute_storage_fee_to_epochs_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciFeePoolOutwardsDistributionMethodVersions { - pub add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: FeatureVersion, - pub add_epoch_pool_to_proposers_payout_operations: FeatureVersion, - pub find_oldest_epoch_needing_payment: FeatureVersion, - pub fetch_reward_shares_list_for_masternode: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciEpochMethodVersions { - pub gather_epoch_info: FeatureVersion, - pub get_genesis_time: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockStartMethodVersions { - pub clear_drive_block_cache: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciBlockEndMethodVersions { - pub update_state_cache: FeatureVersion, - pub update_drive_cache: FeatureVersion, - pub validator_set_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciVotingMethodVersions { - pub keep_record_of_finished_contested_resource_vote_poll: FeatureVersion, - pub clean_up_after_vote_poll_end: FeatureVersion, - pub clean_up_after_contested_resources_vote_poll_end: FeatureVersion, - pub check_for_ended_vote_polls: FeatureVersion, - pub tally_votes_for_contested_document_resource_vote_poll: FeatureVersion, - pub award_document_to_winner: FeatureVersion, - pub delay_vote_poll: FeatureVersion, - pub run_dao_platform_events: FeatureVersion, - pub remove_votes_for_removed_masternodes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciIdentityCreditWithdrawalMethodVersions { - pub build_untied_withdrawal_transactions_from_documents: FeatureVersion, - pub dequeue_and_build_unsigned_withdrawal_transactions: FeatureVersion, - pub fetch_transactions_block_inclusion_status: FeatureVersion, - pub pool_withdrawals_into_transactions_queue: FeatureVersion, - pub update_broadcasted_withdrawal_statuses: FeatureVersion, - pub rebroadcast_expired_withdrawal_documents: FeatureVersion, - pub append_signatures_and_broadcast_withdrawal_transactions: FeatureVersion, - pub cleanup_expired_locks_of_withdrawal_amounts: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciProtocolUpgradeMethodVersions { - pub check_for_desired_protocol_upgrade: FeatureVersion, - pub upgrade_protocol_version_on_epoch_change: FeatureVersion, - pub perform_events_on_first_block_of_protocol_change: OptionalFeatureVersion, - pub protocol_version_upgrade_percentage_needed: u64, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAbciStateTransitionProcessingMethodVersions { - pub execute_event: FeatureVersion, - pub process_raw_state_transitions: FeatureVersion, - pub decode_raw_state_transitions: FeatureVersion, - pub validate_fees_of_event: FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs new file mode 100644 index 0000000000..5f6dacf380 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/mod.rs @@ -0,0 +1,166 @@ +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +pub mod v1; +pub mod v2; +pub mod v3; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciMethodVersions { + pub engine: DriveAbciEngineMethodVersions, + pub initialization: DriveAbciInitializationMethodVersions, + pub core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions, + pub protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions, + pub block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions, + pub core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants, + pub core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions, + pub fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions, + pub fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions, + pub withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions, + pub voting: DriveAbciVotingMethodVersions, + pub state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions, + pub epoch: DriveAbciEpochMethodVersions, + pub block_start: DriveAbciBlockStartMethodVersions, + pub block_end: DriveAbciBlockEndMethodVersions, + pub platform_state_storage: DriveAbciPlatformStateStorageMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciPlatformStateStorageMethodVersions { + pub fetch_platform_state: FeatureVersion, + pub store_platform_state: FeatureVersion, +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct DriveAbciEngineMethodVersions { + pub init_chain: FeatureVersion, + pub check_tx: FeatureVersion, + pub run_block_proposal: FeatureVersion, + pub finalize_block_proposal: FeatureVersion, + pub consensus_params_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreBasedUpdatesMethodVersions { + pub update_core_info: FeatureVersion, + pub update_masternode_list: FeatureVersion, + pub update_quorum_info: FeatureVersion, + pub masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + pub get_voter_identity_key: FeatureVersion, + pub get_operator_identity_keys: FeatureVersion, + pub get_owner_identity_withdrawal_key: FeatureVersion, + pub get_owner_identity_owner_key: FeatureVersion, + pub get_voter_identifier_from_masternode_list_item: FeatureVersion, + pub get_operator_identifier_from_masternode_list_item: FeatureVersion, + pub create_operator_identity: FeatureVersion, + pub create_owner_identity: FeatureVersion, + pub create_voter_identity: FeatureVersion, + pub disable_identity_keys: FeatureVersion, + pub update_masternode_identities: FeatureVersion, + pub update_operator_identity: FeatureVersion, + pub update_owner_withdrawal_address: FeatureVersion, + pub update_voter_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciInitializationMethodVersions { + pub initial_core_height_and_time: FeatureVersion, + pub create_genesis_state: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockFeeProcessingMethodVersions { + pub add_process_epoch_change_operations: FeatureVersion, + pub process_block_fees: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreInstantSendLockMethodVersions { + pub verify_recent_signature_locally: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciCoreChainLockMethodVersionsAndConstants { + pub choose_quorum: FeatureVersion, + pub verify_chain_lock: FeatureVersion, + pub verify_chain_lock_locally: FeatureVersion, + pub verify_chain_lock_through_core: FeatureVersion, + pub make_sure_core_is_synced_to_chain_lock: FeatureVersion, + pub recent_block_count_amount: u32, //what constitutes a recent block, for v0 it's 2. +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciFeePoolInwardsDistributionMethodVersions { + pub add_distribute_block_fees_into_pools_operations: FeatureVersion, + pub add_distribute_storage_fee_to_epochs_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciFeePoolOutwardsDistributionMethodVersions { + pub add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: FeatureVersion, + pub add_epoch_pool_to_proposers_payout_operations: FeatureVersion, + pub find_oldest_epoch_needing_payment: FeatureVersion, + pub fetch_reward_shares_list_for_masternode: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciEpochMethodVersions { + pub gather_epoch_info: FeatureVersion, + pub get_genesis_time: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockStartMethodVersions { + pub clear_drive_block_cache: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciBlockEndMethodVersions { + pub update_state_cache: FeatureVersion, + pub update_drive_cache: FeatureVersion, + pub validator_set_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciVotingMethodVersions { + pub keep_record_of_finished_contested_resource_vote_poll: FeatureVersion, + pub clean_up_after_vote_poll_end: FeatureVersion, + pub clean_up_after_contested_resources_vote_poll_end: FeatureVersion, + pub check_for_ended_vote_polls: FeatureVersion, + pub tally_votes_for_contested_document_resource_vote_poll: FeatureVersion, + pub award_document_to_winner: FeatureVersion, + pub delay_vote_poll: FeatureVersion, + pub run_dao_platform_events: FeatureVersion, + pub remove_votes_for_removed_masternodes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciIdentityCreditWithdrawalMethodVersions { + pub build_untied_withdrawal_transactions_from_documents: FeatureVersion, + pub dequeue_and_build_unsigned_withdrawal_transactions: FeatureVersion, + pub fetch_transactions_block_inclusion_status: FeatureVersion, + pub pool_withdrawals_into_transactions_queue: FeatureVersion, + pub update_broadcasted_withdrawal_statuses: FeatureVersion, + pub rebroadcast_expired_withdrawal_documents: FeatureVersion, + pub append_signatures_and_broadcast_withdrawal_transactions: FeatureVersion, + pub cleanup_expired_locks_of_withdrawal_amounts: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciProtocolUpgradeMethodVersions { + pub check_for_desired_protocol_upgrade: FeatureVersion, + pub upgrade_protocol_version_on_epoch_change: FeatureVersion, + pub perform_events_on_first_block_of_protocol_change: OptionalFeatureVersion, + pub protocol_version_upgrade_percentage_needed: u64, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionProcessingMethodVersions { + pub execute_event: FeatureVersion, + pub process_raw_state_transitions: FeatureVersion, + pub decode_raw_state_transitions: FeatureVersion, + pub validate_fees_of_event: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs new file mode 100644 index 0000000000..e6e1c63a40 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v1.rs @@ -0,0 +1,121 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V1: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 0, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 0, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 0, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 0, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: None, + protocol_version_upgrade_percentage_needed: 75, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 0, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs new file mode 100644 index 0000000000..1e355fa6a2 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v2.rs @@ -0,0 +1,122 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V2: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + // Update app version if changed as well + consensus_params_update: 1, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 0, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 0, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: None, + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 0, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs new file mode 100644 index 0000000000..2b48e7a034 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v3.rs @@ -0,0 +1,121 @@ +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, + DriveAbciFeePoolOutwardsDistributionMethodVersions, + DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, + DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, + DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, +}; + +pub const DRIVE_ABCI_METHOD_VERSIONS_V3: DriveAbciMethodVersions = DriveAbciMethodVersions { + engine: DriveAbciEngineMethodVersions { + init_chain: 0, + check_tx: 0, + run_block_proposal: 0, + finalize_block_proposal: 0, + consensus_params_update: 1, + }, + initialization: DriveAbciInitializationMethodVersions { + initial_core_height_and_time: 0, + create_genesis_state: 0, + }, + core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { + update_core_info: 0, + update_masternode_list: 0, + update_quorum_info: 0, + masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { + get_voter_identity_key: 0, + get_operator_identity_keys: 0, + get_owner_identity_withdrawal_key: 0, + get_owner_identity_owner_key: 0, + get_voter_identifier_from_masternode_list_item: 0, + get_operator_identifier_from_masternode_list_item: 0, + create_operator_identity: 0, + create_owner_identity: 1, + create_voter_identity: 0, + disable_identity_keys: 0, + update_masternode_identities: 0, + update_operator_identity: 0, + update_owner_withdrawal_address: 1, + update_voter_identity: 0, + }, + }, + protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { + check_for_desired_protocol_upgrade: 1, + upgrade_protocol_version_on_epoch_change: 0, + perform_events_on_first_block_of_protocol_change: Some(0), + protocol_version_upgrade_percentage_needed: 67, + }, + block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { + add_process_epoch_change_operations: 0, + process_block_fees: 0, + }, + core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { + choose_quorum: 0, + verify_chain_lock: 0, + verify_chain_lock_locally: 0, + verify_chain_lock_through_core: 0, + make_sure_core_is_synced_to_chain_lock: 0, + recent_block_count_amount: 2, + }, + core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { + verify_recent_signature_locally: 0, + }, + fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { + add_distribute_block_fees_into_pools_operations: 0, + add_distribute_storage_fee_to_epochs_operations: 0, + }, + fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { + add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, + add_epoch_pool_to_proposers_payout_operations: 0, + find_oldest_epoch_needing_payment: 0, + fetch_reward_shares_list_for_masternode: 0, + }, + withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { + build_untied_withdrawal_transactions_from_documents: 0, + dequeue_and_build_unsigned_withdrawal_transactions: 0, + fetch_transactions_block_inclusion_status: 0, + pool_withdrawals_into_transactions_queue: 0, + update_broadcasted_withdrawal_statuses: 0, + rebroadcast_expired_withdrawal_documents: 0, + append_signatures_and_broadcast_withdrawal_transactions: 0, + cleanup_expired_locks_of_withdrawal_amounts: 0, + }, + voting: DriveAbciVotingMethodVersions { + keep_record_of_finished_contested_resource_vote_poll: 0, + clean_up_after_vote_poll_end: 0, + clean_up_after_contested_resources_vote_poll_end: 0, + check_for_ended_vote_polls: 0, + tally_votes_for_contested_document_resource_vote_poll: 0, + award_document_to_winner: 0, + delay_vote_poll: 0, + run_dao_platform_events: 0, + remove_votes_for_removed_masternodes: 0, + }, + state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { + execute_event: 0, + process_raw_state_transitions: 0, + decode_raw_state_transitions: 0, + validate_fees_of_event: 0, + }, + epoch: DriveAbciEpochMethodVersions { + gather_epoch_info: 0, + get_genesis_time: 0, + }, + block_start: DriveAbciBlockStartMethodVersions { + clear_drive_block_cache: 0, + }, + block_end: DriveAbciBlockEndMethodVersions { + update_state_cache: 0, + update_drive_cache: 0, + validator_set_update: 1, + }, + platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { + fetch_platform_state: 0, + store_platform_state: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs new file mode 100644 index 0000000000..8b010c9c3d --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs @@ -0,0 +1,68 @@ +pub mod v1; + +use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryVersions { + pub max_returned_elements: u16, + pub response_metadata: FeatureVersion, + pub proofs_query: FeatureVersionBounds, + pub document_query: FeatureVersionBounds, + pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, + pub identity_based_queries: DriveAbciQueryIdentityVersions, + pub validator_queries: DriveAbciQueryValidatorVersions, + pub data_contract_based_queries: DriveAbciQueryDataContractVersions, + pub voting_based_queries: DriveAbciQueryVotingVersions, + pub system: DriveAbciQuerySystemVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryPrefundedSpecializedBalancesVersions { + pub balance: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryIdentityVersions { + pub identity: FeatureVersionBounds, + pub identities_contract_keys: FeatureVersionBounds, + pub keys: FeatureVersionBounds, + pub identity_nonce: FeatureVersionBounds, + pub identity_contract_nonce: FeatureVersionBounds, + pub balance: FeatureVersionBounds, + pub identities_balances: FeatureVersionBounds, + pub balance_and_revision: FeatureVersionBounds, + pub identity_by_public_key_hash: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryValidatorVersions { + pub proposed_block_counts_by_evonode_ids: FeatureVersionBounds, + pub proposed_block_counts_by_range: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryVotingVersions { + pub vote_polls_by_end_date_query: FeatureVersionBounds, + pub contested_resource_vote_state: FeatureVersionBounds, + pub contested_resource_voters_for_identity: FeatureVersionBounds, + pub contested_resource_identity_vote_status: FeatureVersionBounds, + pub contested_resources: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQueryDataContractVersions { + pub data_contract: FeatureVersionBounds, + pub data_contract_history: FeatureVersionBounds, + pub data_contracts: FeatureVersionBounds, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciQuerySystemVersions { + pub version_upgrade_state: FeatureVersionBounds, + pub version_upgrade_vote_status: FeatureVersionBounds, + pub epoch_infos: FeatureVersionBounds, + pub current_quorums_info: FeatureVersionBounds, + pub partial_status: FeatureVersionBounds, + pub path_elements: FeatureVersionBounds, + pub total_credits_in_platform: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs new file mode 100644 index 0000000000..b6af08405c --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs @@ -0,0 +1,168 @@ +use crate::version::drive_abci_versions::drive_abci_query_versions::{ + DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, + DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, + DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, +}; +use versioned_feature_core::FeatureVersionBounds; + +pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryVersions { + max_returned_elements: 100, + response_metadata: 0, + proofs_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + document_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + identity_based_queries: DriveAbciQueryIdentityVersions { + identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_contract_keys: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_contract_nonce: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identities_balances: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + balance_and_revision: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_by_public_key_hash: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + validator_queries: DriveAbciQueryValidatorVersions { + proposed_block_counts_by_evonode_ids: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + proposed_block_counts_by_range: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + data_contract_based_queries: DriveAbciQueryDataContractVersions { + data_contract: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contract_history: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + data_contracts: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + voting_based_queries: DriveAbciQueryVotingVersions { + vote_polls_by_end_date_query: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_vote_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_voters_for_identity: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resource_identity_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + contested_resources: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, + system: DriveAbciQuerySystemVersions { + version_upgrade_state: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + version_upgrade_vote_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + epoch_infos: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + current_quorums_info: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + partial_status: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + path_elements: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + total_credits_in_platform: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs new file mode 100644 index 0000000000..d00c9187ae --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/mod.rs @@ -0,0 +1,13 @@ +pub mod v1; + +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStructureVersions { + pub platform_state_structure: FeatureVersion, + pub platform_state_for_saving_structure_default: FeatureVersion, + pub state_transition_execution_context: FeatureVersion, + pub commit: FeatureVersion, + pub masternode: FeatureVersion, + pub signature_verification_quorum_set: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs new file mode 100644 index 0000000000..b8e6725281 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_structure_versions/v1.rs @@ -0,0 +1,11 @@ +use crate::version::drive_abci_versions::drive_abci_structure_versions::DriveAbciStructureVersions; + +pub const DRIVE_ABCI_STRUCTURE_VERSIONS_V1: DriveAbciStructureVersions = + DriveAbciStructureVersions { + platform_state_structure: 0, + platform_state_for_saving_structure_default: 0, + state_transition_execution_context: 0, + commit: 0, + masternode: 0, + signature_verification_quorum_set: 0, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs new file mode 100644 index 0000000000..c2044bb829 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs @@ -0,0 +1,115 @@ +pub mod v1; +pub mod v2; +pub mod v3; + +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationVersions { + pub state_transitions: DriveAbciStateTransitionValidationVersions, + pub process_state_transition: FeatureVersion, + pub state_transition_to_execution_event_for_check_tx: FeatureVersion, + pub penalties: PenaltyAmounts, + pub event_constants: DriveAbciValidationConstants, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationConstants { + pub maximum_vote_polls_to_process: u16, + pub maximum_contenders_to_consider: u16, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionValidationVersion { + pub basic_structure: OptionalFeatureVersion, + pub advanced_structure: OptionalFeatureVersion, + pub identity_signatures: OptionalFeatureVersion, + pub advanced_minimum_balance_pre_check: OptionalFeatureVersion, + pub nonce: OptionalFeatureVersion, + pub state: FeatureVersion, + pub transform_into_action: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionValidationVersions { + pub common_validation_methods: DriveAbciStateTransitionCommonValidationVersions, + pub max_asset_lock_usage_attempts: u16, + pub identity_create_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_update_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_credit_withdrawal_state_transition: DriveAbciStateTransitionValidationVersion, + pub identity_credit_withdrawal_state_transition_purpose_matches_requirements: FeatureVersion, + pub identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion, + pub masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion, + pub contract_create_state_transition: DriveAbciStateTransitionValidationVersion, + pub contract_update_state_transition: DriveAbciStateTransitionValidationVersion, + pub documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciStateTransitionCommonValidationVersions { + pub asset_locks: DriveAbciAssetLockValidationVersions, + pub validate_identity_public_key_contract_bounds: FeatureVersion, + pub validate_identity_public_key_ids_dont_exist_in_state: FeatureVersion, + pub validate_identity_public_key_ids_exist_in_state: FeatureVersion, + pub validate_state_transition_identity_signed: FeatureVersion, + pub validate_unique_identity_public_key_hashes_in_state: FeatureVersion, + pub validate_master_key_uniqueness: FeatureVersion, + pub validate_simple_pre_check_balance: FeatureVersion, +} + +/// All of these penalty amounts are in credits +#[derive(Clone, Debug, Default)] +pub struct PenaltyAmounts { + pub identity_id_not_correct: u64, + pub unique_key_already_present: u64, + pub validation_of_added_keys_structure_failure: u64, + pub validation_of_added_keys_proof_of_possession_failure: u64, +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct DriveAbciAssetLockValidationVersions { + pub fetch_asset_lock_transaction_output_sync: FeatureVersion, + pub verify_asset_lock_is_not_spent_and_has_enough_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciDocumentsStateTransitionValidationVersions { + pub balance_pre_check: FeatureVersion, + pub basic_structure: FeatureVersion, + pub advanced_structure: FeatureVersion, + pub revision: FeatureVersion, + pub state: FeatureVersion, + pub transform_into_action: FeatureVersion, + pub data_triggers: DriveAbciValidationDataTriggerAndBindingVersions, + pub is_allowed: FeatureVersion, + pub document_create_transition_structure_validation: FeatureVersion, + pub document_delete_transition_structure_validation: FeatureVersion, + pub document_replace_transition_structure_validation: FeatureVersion, + pub document_transfer_transition_structure_validation: FeatureVersion, + pub document_purchase_transition_structure_validation: FeatureVersion, + pub document_update_price_transition_structure_validation: FeatureVersion, + pub document_create_transition_state_validation: FeatureVersion, + pub document_delete_transition_state_validation: FeatureVersion, + pub document_replace_transition_state_validation: FeatureVersion, + pub document_transfer_transition_state_validation: FeatureVersion, + pub document_purchase_transition_state_validation: FeatureVersion, + pub document_update_price_transition_state_validation: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationDataTriggerAndBindingVersions { + pub bindings: FeatureVersion, + pub triggers: DriveAbciValidationDataTriggerVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciValidationDataTriggerVersions { + pub create_contact_request_data_trigger: FeatureVersion, + pub create_domain_data_trigger: FeatureVersion, + pub create_identity_data_trigger: FeatureVersion, + pub create_feature_flag_data_trigger: FeatureVersion, + pub create_masternode_reward_shares_data_trigger: FeatureVersion, + pub delete_withdrawal_data_trigger: FeatureVersion, + pub reject_data_trigger: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs new file mode 100644 index 0000000000..a617c54afb --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V1: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 0, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs new file mode 100644 index 0000000000..577fc0c74b --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V2: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 1, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs new file mode 100644 index 0000000000..76197377e6 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs @@ -0,0 +1,146 @@ +use crate::version::drive_abci_versions::drive_abci_validation_versions::{ + DriveAbciAssetLockValidationVersions, DriveAbciDocumentsStateTransitionValidationVersions, + DriveAbciStateTransitionCommonValidationVersions, DriveAbciStateTransitionValidationVersion, + DriveAbciStateTransitionValidationVersions, DriveAbciValidationConstants, + DriveAbciValidationDataTriggerAndBindingVersions, DriveAbciValidationDataTriggerVersions, + DriveAbciValidationVersions, PenaltyAmounts, +}; + +pub const DRIVE_ABCI_VALIDATION_VERSIONS_V3: DriveAbciValidationVersions = + DriveAbciValidationVersions { + state_transitions: DriveAbciStateTransitionValidationVersions { + common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { + asset_locks: DriveAbciAssetLockValidationVersions { + fetch_asset_lock_transaction_output_sync: 0, + verify_asset_lock_is_not_spent_and_has_enough_balance: 0, + }, + validate_identity_public_key_contract_bounds: 0, + validate_identity_public_key_ids_dont_exist_in_state: 0, + validate_identity_public_key_ids_exist_in_state: 0, + validate_state_transition_identity_signed: 0, + validate_unique_identity_public_key_hashes_in_state: 0, + validate_master_key_uniqueness: 0, + validate_simple_pre_check_balance: 0, + }, + max_asset_lock_usage_attempts: 16, + identity_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: Some(0), + identity_signatures: Some(0), + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: None, + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition: + DriveAbciStateTransitionValidationVersion { + basic_structure: Some(1), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, + identity_credit_transfer_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: Some(0), + identity_signatures: None, + advanced_minimum_balance_pre_check: Some(0), + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_create_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: Some(0), + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + contract_update_state_transition: DriveAbciStateTransitionValidationVersion { + basic_structure: None, + advanced_structure: None, + identity_signatures: None, + advanced_minimum_balance_pre_check: None, + nonce: Some(0), + state: 0, + transform_into_action: 0, + }, + documents_batch_state_transition: DriveAbciDocumentsStateTransitionValidationVersions { + balance_pre_check: 0, + basic_structure: 0, + advanced_structure: 0, + state: 0, + revision: 0, + transform_into_action: 0, + data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { + bindings: 0, + triggers: DriveAbciValidationDataTriggerVersions { + create_contact_request_data_trigger: 0, + create_domain_data_trigger: 0, + create_identity_data_trigger: 0, + create_feature_flag_data_trigger: 0, + create_masternode_reward_shares_data_trigger: 0, + delete_withdrawal_data_trigger: 0, + reject_data_trigger: 0, + }, + }, + is_allowed: 0, + document_create_transition_structure_validation: 0, + document_delete_transition_structure_validation: 0, + document_replace_transition_structure_validation: 0, + document_transfer_transition_structure_validation: 0, + document_purchase_transition_structure_validation: 0, + document_update_price_transition_structure_validation: 0, + document_create_transition_state_validation: 1, + document_delete_transition_state_validation: 0, + document_replace_transition_state_validation: 0, + document_transfer_transition_state_validation: 0, + document_purchase_transition_state_validation: 0, + document_update_price_transition_state_validation: 0, + }, + }, + process_state_transition: 0, + state_transition_to_execution_event_for_check_tx: 0, + penalties: PenaltyAmounts { + identity_id_not_correct: 50000000, + unique_key_already_present: 10000000, + validation_of_added_keys_structure_failure: 10000000, + validation_of_added_keys_proof_of_possession_failure: 50000000, + }, + event_constants: DriveAbciValidationConstants { + maximum_vote_polls_to_process: 2, + maximum_contenders_to_consider: 100, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs new file mode 100644 index 0000000000..b20f85efde --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/mod.rs @@ -0,0 +1,8 @@ +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveAbciWithdrawalConstants { + pub core_expiration_blocks: u32, + pub cleanup_expired_locks_of_withdrawal_amounts_limit: u16, +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs new file mode 100644 index 0000000000..73bc3f93f9 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v1.rs @@ -0,0 +1,7 @@ +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; + +pub const DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1: DriveAbciWithdrawalConstants = + DriveAbciWithdrawalConstants { + core_expiration_blocks: 48, + cleanup_expired_locks_of_withdrawal_amounts_limit: 0, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs new file mode 100644 index 0000000000..41cdd51f69 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_withdrawal_constants/v2.rs @@ -0,0 +1,7 @@ +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; + +pub const DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2: DriveAbciWithdrawalConstants = + DriveAbciWithdrawalConstants { + core_expiration_blocks: 48, + cleanup_expired_locks_of_withdrawal_amounts_limit: 64, + }; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs new file mode 100644 index 0000000000..a6168ce9db --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_abci_versions/mod.rs @@ -0,0 +1,19 @@ +pub mod drive_abci_method_versions; +pub mod drive_abci_query_versions; +pub mod drive_abci_structure_versions; +pub mod drive_abci_validation_versions; +pub mod drive_abci_withdrawal_constants; + +use drive_abci_method_versions::DriveAbciMethodVersions; +use drive_abci_query_versions::DriveAbciQueryVersions; +use drive_abci_structure_versions::DriveAbciStructureVersions; +use drive_abci_validation_versions::DriveAbciValidationVersions; +use drive_abci_withdrawal_constants::DriveAbciWithdrawalConstants; +#[derive(Clone, Debug, Default)] +pub struct DriveAbciVersion { + pub structs: DriveAbciStructureVersions, + pub methods: DriveAbciMethodVersions, + pub validation_and_processing: DriveAbciValidationVersions, + pub withdrawal_constants: DriveAbciWithdrawalConstants, + pub query: DriveAbciQueryVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_versions.rs b/packages/rs-platform-version/src/version/drive_versions.rs deleted file mode 100644 index 2deecab9de..0000000000 --- a/packages/rs-platform-version/src/version/drive_versions.rs +++ /dev/null @@ -1,756 +0,0 @@ -use crate::version::{FeatureVersion, FeatureVersionBounds, OptionalFeatureVersion}; -use grovedb_version::version::GroveVersion; - -#[derive(Clone, Debug, Default)] -pub struct DriveVersion { - pub structure: DriveStructureVersion, - pub methods: DriveMethodVersions, - pub grove_methods: DriveGroveMethodVersions, - pub grove_version: GroveVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveMethodVersions { - pub initialization: DriveInitializationMethodVersions, - pub credit_pools: DriveCreditPoolMethodVersions, - pub protocol_upgrade: DriveProtocolUpgradeVersions, - pub prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions, - pub balances: DriveBalancesMethodVersions, - pub document: DriveDocumentMethodVersions, - pub vote: DriveVoteMethodVersions, - pub contract: DriveContractMethodVersions, - pub fees: DriveFeesMethodVersions, - pub estimated_costs: DriveEstimatedCostsMethodVersions, - pub asset_lock: DriveAssetLockMethodVersions, - pub verify: DriveVerifyMethodVersions, - pub identity: DriveIdentityMethodVersions, - pub platform_system: DrivePlatformSystemMethodVersions, - pub operations: DriveOperationsMethodVersion, - pub batch_operations: DriveBatchOperationsMethodVersion, - pub fetch: DriveFetchMethodVersions, - pub prove: DriveProveMethodVersions, - pub state_transitions: DriveStateTransitionMethodVersions, - pub platform_state: DrivePlatformStateMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePlatformStateMethodVersions { - pub fetch_platform_state_bytes: FeatureVersion, - pub store_platform_state_bytes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionMethodVersions { - pub operations: DriveStateTransitionOperationMethodVersions, - pub convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - pub data_contract_create_transition: FeatureVersion, - pub data_contract_update_transition: FeatureVersion, - pub document_create_transition: FeatureVersion, - pub document_delete_transition: FeatureVersion, - pub document_purchase_transition: FeatureVersion, - pub document_replace_transition: FeatureVersion, - pub document_transfer_transition: FeatureVersion, - pub document_update_price_transition: FeatureVersion, - pub documents_batch_transition: FeatureVersion, - pub identity_create_transition: FeatureVersion, - pub identity_credit_transfer_transition: FeatureVersion, - pub identity_credit_withdrawal_transition: FeatureVersion, - pub identity_top_up_transition: FeatureVersion, - pub identity_update_transition: FeatureVersion, - pub masternode_vote_transition: FeatureVersion, - pub bump_identity_data_contract_nonce: FeatureVersion, - pub bump_identity_nonce: FeatureVersion, - pub partially_use_asset_lock: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStateTransitionOperationMethodVersions { - pub finalization_tasks: FeatureVersion, - pub contracts: DriveDataContractOperationMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDataContractOperationMethodVersions { - pub finalization_tasks: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveFetchMethodVersions { - pub fetch_elements: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveProveMethodVersions { - pub prove_elements: FeatureVersion, - pub prove_multiple_state_transition_results: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyMethodVersions { - pub contract: DriveVerifyContractMethodVersions, - pub document: DriveVerifyDocumentMethodVersions, - pub identity: DriveVerifyIdentityMethodVersions, - pub single_document: DriveVerifySingleDocumentMethodVersions, - pub system: DriveVerifySystemMethodVersions, - pub voting: DriveVerifyVoteMethodVersions, - pub state_transition: DriveVerifyStateTransitionMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyContractMethodVersions { - pub verify_contract: FeatureVersion, - pub verify_contract_history: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyDocumentMethodVersions { - pub verify_proof: FeatureVersion, - pub verify_proof_keep_serialized: FeatureVersion, - pub verify_start_at_document_in_proof: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyIdentityMethodVersions { - pub verify_full_identities_by_public_key_hashes: FeatureVersion, - pub verify_full_identity_by_identity_id: FeatureVersion, - pub verify_full_identity_by_public_key_hash: FeatureVersion, - pub verify_identity_balance_for_identity_id: FeatureVersion, - pub verify_identity_balances_for_identity_ids: FeatureVersion, - pub verify_identity_id_by_public_key_hash: FeatureVersion, - pub verify_identity_ids_by_public_key_hashes: FeatureVersion, - pub verify_identity_keys_by_identity_id: FeatureVersion, - pub verify_identity_nonce: FeatureVersion, - pub verify_identity_contract_nonce: FeatureVersion, - pub verify_identities_contract_keys: FeatureVersion, - pub verify_identity_revision_for_identity_id: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyVoteMethodVersions { - pub verify_masternode_vote: FeatureVersion, - pub verify_start_at_contender_in_proof: FeatureVersion, - pub verify_vote_poll_votes_proof: FeatureVersion, - pub verify_identity_votes_given_proof: FeatureVersion, - pub verify_vote_poll_vote_state_proof: FeatureVersion, - pub verify_contests_proof: FeatureVersion, - pub verify_vote_polls_by_end_date_proof: FeatureVersion, - pub verify_specialized_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifySystemMethodVersions { - pub verify_epoch_infos: FeatureVersion, - pub verify_epoch_proposers: FeatureVersion, - pub verify_elements: FeatureVersion, - pub verify_total_credits_in_system: FeatureVersion, - pub verify_upgrade_state: FeatureVersion, - pub verify_upgrade_vote_status: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifySingleDocumentMethodVersions { - pub verify_proof: FeatureVersion, - pub verify_proof_keep_serialized: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVerifyStateTransitionMethodVersions { - pub verify_state_transition_was_executed_with_proof: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveMethodVersions { - pub basic: DriveGroveBasicMethodVersions, - pub batch: DriveGroveBatchMethodVersions, - pub apply: DriveGroveApplyMethodVersions, - pub costs: DriveGroveCostMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePrefundedSpecializedMethodVersions { - pub fetch_single: FeatureVersion, - pub prove_single: FeatureVersion, - pub add_prefunded_specialized_balance: FeatureVersion, - pub add_prefunded_specialized_balance_operations: FeatureVersion, - pub deduct_from_prefunded_specialized_balance: FeatureVersion, - pub deduct_from_prefunded_specialized_balance_operations: FeatureVersion, - pub estimated_cost_for_prefunded_specialized_balance_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveBalancesMethodVersions { - pub add_to_system_credits: FeatureVersion, - pub add_to_system_credits_operations: FeatureVersion, - pub remove_from_system_credits: FeatureVersion, - pub remove_from_system_credits_operations: FeatureVersion, - pub calculate_total_credits_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveAssetLockMethodVersions { - pub add_asset_lock_outpoint: FeatureVersion, - pub add_estimation_costs_for_adding_asset_lock: FeatureVersion, - pub fetch_asset_lock_outpoint_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveFeesMethodVersions { - pub calculate_fee: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractMethodVersions { - pub prove: DriveContractProveMethodVersions, - pub apply: DriveContractApplyMethodVersions, - pub insert: DriveContractInsertMethodVersions, - pub update: DriveContractUpdateMethodVersions, - pub costs: DriveContractCostsMethodVersions, - pub get: DriveContractGetMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractProveMethodVersions { - pub prove_contract: FeatureVersion, - pub prove_contract_history: FeatureVersion, - pub prove_contracts: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractApplyMethodVersions { - pub apply_contract: FeatureVersion, - pub apply_contract_with_serialization: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractInsertMethodVersions { - pub add_contract_to_storage: FeatureVersion, - pub insert_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractUpdateMethodVersions { - pub update_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractGetMethodVersions { - pub fetch_contract: FeatureVersion, - pub fetch_contract_with_history: FeatureVersion, - pub get_cached_contract_with_fetch_info: FeatureVersion, - pub get_contract_with_fetch_info: FeatureVersion, - pub get_contracts_with_fetch_info: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractQueryMethodVersions { - pub fetch_contract_query: FeatureVersion, - pub fetch_contract_with_history_latest_query: FeatureVersion, - pub fetch_contracts_query: FeatureVersion, - pub fetch_contract_history_query: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveContractCostsMethodVersions { - pub add_estimation_costs_for_contract_insertion: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DrivePlatformSystemMethodVersions { - pub estimation_costs: DriveSystemEstimationCostsMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveOperationsMethodVersion { - pub rollback_transaction: FeatureVersion, - pub drop_cache: FeatureVersion, - pub commit_transaction: FeatureVersion, - pub apply_partial_batch_low_level_drive_operations: FeatureVersion, - pub apply_partial_batch_grovedb_operations: FeatureVersion, - pub apply_batch_low_level_drive_operations: FeatureVersion, - pub apply_batch_grovedb_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveBatchOperationsMethodVersion { - pub convert_drive_operations_to_grove_operations: FeatureVersion, - pub apply_drive_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveSystemEstimationCostsMethodVersions { - pub for_total_system_credits_update: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteMethodVersions { - pub insert: DriveVoteInsertMethodVersions, - pub contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions, - pub cleanup: DriveVoteCleanupMethodVersions, - pub setup: DriveVoteSetupMethodVersions, - pub storage_form: DriveVoteStorageFormMethodVersions, - pub fetch: DriveVoteFetchMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteFetchMethodVersions { - pub fetch_identities_voting_for_contenders: FeatureVersion, - pub fetch_contested_document_vote_poll_stored_info: FeatureVersion, - pub fetch_identity_contested_resource_vote: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteStorageFormMethodVersions { - pub resolve_with_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteSetupMethodVersions { - pub add_initial_vote_tree_main_structure_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteCleanupMethodVersions { - pub remove_specific_vote_references_given_by_identity: FeatureVersion, - pub remove_specific_votes_given_by_identity: FeatureVersion, - pub remove_contested_resource_vote_poll_end_date_query_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_votes_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_documents_operations: FeatureVersion, - pub remove_contested_resource_vote_poll_contenders_operations: FeatureVersion, - pub remove_contested_resource_top_level_index_operations: FeatureVersion, - pub remove_contested_resource_info_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteInsertMethodVersions { - pub register_identity_vote: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveVoteContestedResourceInsertMethodVersions { - pub register_contested_resource_identity_vote: FeatureVersion, - pub insert_stored_info_for_contested_resource_vote_poll: FeatureVersion, - pub register_identity_vote: FeatureVersion, - pub add_vote_poll_end_date_query_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentMethodVersions { - pub query: DriveDocumentQueryMethodVersions, - pub delete: DriveDocumentDeleteMethodVersions, - pub insert: DriveDocumentInsertMethodVersions, - pub insert_contested: DriveDocumentInsertContestedMethodVersions, - pub update: DriveDocumentUpdateMethodVersions, - pub estimation_costs: DriveDocumentEstimationCostsMethodVersions, - pub index_uniqueness: DriveDocumentIndexUniquenessMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentQueryMethodVersions { - pub query_documents: FeatureVersion, - pub query_contested_documents: FeatureVersion, - pub query_contested_documents_vote_state: FeatureVersion, - pub query_documents_with_flags: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentEstimationCostsMethodVersions { - pub add_estimation_costs_for_add_document_to_primary_storage: FeatureVersion, - pub add_estimation_costs_for_add_contested_document_to_primary_storage: FeatureVersion, - pub stateless_delete_of_non_tree_for_costs: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentInsertMethodVersions { - pub add_document: FeatureVersion, - pub add_document_for_contract: FeatureVersion, - pub add_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub add_document_for_contract_operations: FeatureVersion, - pub add_document_to_primary_storage: FeatureVersion, - pub add_indices_for_index_level_for_contract_operations: FeatureVersion, - pub add_indices_for_top_index_level_for_contract_operations: FeatureVersion, - pub add_reference_for_index_level_for_contract_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentInsertContestedMethodVersions { - pub add_contested_document: FeatureVersion, - pub add_contested_document_for_contract: FeatureVersion, - pub add_contested_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub add_contested_document_for_contract_operations: FeatureVersion, - pub add_contested_document_to_primary_storage: FeatureVersion, - pub add_contested_indices_for_contract_operations: FeatureVersion, - pub add_contested_reference_and_vote_subtree_to_document_operations: FeatureVersion, - pub add_contested_vote_subtree_for_non_identities_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentUpdateMethodVersions { - pub add_update_multiple_documents_operations: FeatureVersion, - pub update_document_for_contract: FeatureVersion, - pub update_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub update_document_for_contract_id: FeatureVersion, - pub update_document_for_contract_operations: FeatureVersion, - pub update_document_with_serialization_for_contract: FeatureVersion, - pub update_serialized_document_for_contract: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentDeleteMethodVersions { - pub add_estimation_costs_for_remove_document_to_primary_storage: FeatureVersion, - pub delete_document_for_contract: FeatureVersion, - pub delete_document_for_contract_id: FeatureVersion, - pub delete_document_for_contract_apply_and_add_to_operations: FeatureVersion, - pub remove_document_from_primary_storage: FeatureVersion, - pub remove_reference_for_index_level_for_contract_operations: FeatureVersion, - pub remove_indices_for_index_level_for_contract_operations: FeatureVersion, - pub remove_indices_for_top_index_level_for_contract_operations: FeatureVersion, - pub delete_document_for_contract_id_with_named_type_operations: FeatureVersion, - pub delete_document_for_contract_with_named_type_operations: FeatureVersion, - pub delete_document_for_contract_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveDocumentIndexUniquenessMethodVersions { - pub validate_document_uniqueness: FeatureVersion, - pub validate_document_create_transition_action_uniqueness: FeatureVersion, - pub validate_document_replace_transition_action_uniqueness: FeatureVersion, - pub validate_document_transfer_transition_action_uniqueness: FeatureVersion, - pub validate_document_purchase_transition_action_uniqueness: FeatureVersion, - pub validate_document_update_price_transition_action_uniqueness: FeatureVersion, - pub validate_uniqueness_of_data: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveBasicMethodVersions { - pub grove_insert: FeatureVersion, - pub grove_insert_empty_tree: FeatureVersion, - pub grove_insert_empty_sum_tree: FeatureVersion, - pub grove_insert_if_not_exists: FeatureVersion, - pub grove_insert_if_not_exists_return_existing_element: FeatureVersion, - pub grove_clear: FeatureVersion, - pub grove_delete: FeatureVersion, - pub grove_get_raw: FeatureVersion, - pub grove_get_raw_optional: FeatureVersion, - pub grove_get_raw_value_u64_from_encoded_var_vec: FeatureVersion, - pub grove_get: FeatureVersion, - pub grove_get_path_query_serialized_results: FeatureVersion, - pub grove_get_path_query_serialized_or_sum_results: FeatureVersion, - pub grove_get_path_query: FeatureVersion, - pub grove_get_path_query_with_optional: FeatureVersion, - pub grove_get_raw_path_query_with_optional: FeatureVersion, - pub grove_get_raw_path_query: FeatureVersion, - pub grove_get_proved_path_query: FeatureVersion, - pub grove_get_proved_path_query_with_conditional: FeatureVersion, - pub grove_get_sum_tree_total_value: FeatureVersion, - pub grove_has_raw: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveBatchMethodVersions { - pub batch_insert_empty_tree: FeatureVersion, - pub batch_insert_empty_tree_if_not_exists: FeatureVersion, - pub batch_insert_empty_tree_if_not_exists_check_existing_operations: FeatureVersion, - pub batch_insert_sum_item_or_add_to_if_already_exists: FeatureVersion, - pub batch_insert: FeatureVersion, - pub batch_insert_if_not_exists: FeatureVersion, - pub batch_insert_if_changed_value: FeatureVersion, - pub batch_replace: FeatureVersion, - pub batch_delete: FeatureVersion, - pub batch_delete_items_in_path_query: FeatureVersion, - pub batch_move_items_in_path_query: FeatureVersion, - pub batch_remove_raw: FeatureVersion, - pub batch_delete_up_tree_while_empty: FeatureVersion, - pub batch_refresh_reference: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveApplyMethodVersions { - pub grove_apply_operation: FeatureVersion, - pub grove_apply_batch: FeatureVersion, - pub grove_apply_partial_batch: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveGroveCostMethodVersions { - pub grove_batch_operations_costs: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveInitializationMethodVersions { - pub create_initial_state_structure: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolMethodVersions { - pub epochs: DriveCreditPoolEpochsMethodVersions, - pub pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions, - pub storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - pub unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolEpochsMethodVersions { - pub get_epochs_infos: FeatureVersion, - pub get_epochs_protocol_versions: FeatureVersion, - pub prove_epochs_infos: FeatureVersion, - pub get_epoch_fee_multiplier: FeatureVersion, - pub get_epoch_processing_credits_for_distribution: FeatureVersion, - pub get_epoch_storage_credits_for_distribution: FeatureVersion, - pub get_epoch_total_credits_for_distribution: FeatureVersion, - pub get_storage_credits_for_distribution_for_epochs_in_range: FeatureVersion, - pub get_epoch_start_time: FeatureVersion, - pub get_epoch_start_block_core_height: FeatureVersion, - pub get_epoch_start_block_height: FeatureVersion, - pub get_first_epoch_start_block_info_between_epochs: FeatureVersion, - pub fetch_epoch_proposers: FeatureVersion, - pub prove_epoch_proposers: FeatureVersion, - pub get_epochs_proposer_block_count: FeatureVersion, - pub add_update_pending_epoch_refunds_operations: FeatureVersion, - pub is_epochs_proposers_tree_empty: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolUnpaidEpochMethodVersions { - pub get_unpaid_epoch_index: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolPendingEpochRefundsMethodVersions { - pub add_delete_pending_epoch_refunds_except_specified: FeatureVersion, - pub fetch_and_add_pending_epoch_refunds_to_collection: FeatureVersion, - pub fetch_pending_epoch_refunds: FeatureVersion, - pub add_update_pending_epoch_refunds_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - pub get_storage_fees_from_distribution_pool: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveProtocolUpgradeVersions { - pub clear_version_information: FeatureVersion, - pub fetch_versions_with_counter: FeatureVersion, - pub fetch_proved_versions_with_counter: FeatureVersion, - pub fetch_validator_version_votes: FeatureVersion, - pub fetch_proved_validator_version_votes: FeatureVersion, - pub remove_validators_proposed_app_versions: FeatureVersion, - pub update_validator_proposed_app_version: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveStructureVersion { - pub document_indexes: FeatureVersionBounds, - pub identity_indexes: FeatureVersionBounds, - pub pools: FeatureVersionBounds, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityMethodVersions { - pub fetch: DriveIdentityFetchMethodVersions, - pub prove: DriveIdentityProveMethodVersions, - pub keys: DriveIdentityKeysMethodVersions, - pub update: DriveIdentityUpdateMethodVersions, - pub insert: DriveIdentityInsertMethodVersions, - pub contract_info: DriveIdentityContractInfoMethodVersions, - pub cost_estimation: DriveIdentityCostEstimationMethodVersions, - pub withdrawals: DriveIdentityWithdrawalMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalMethodVersions { - pub document: DriveIdentityWithdrawalDocumentMethodVersions, - pub transaction: DriveIdentityWithdrawalTransactionMethodVersions, - pub calculate_current_withdrawal_limit: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalDocumentMethodVersions { - pub fetch_oldest_withdrawal_documents_by_status: FeatureVersion, - pub find_withdrawal_documents_by_status_and_transaction_indices: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionMethodVersions { - pub index: DriveIdentityWithdrawalTransactionIndexMethodVersions, - pub queue: DriveIdentityWithdrawalTransactionQueueMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionIndexMethodVersions { - pub fetch_next_withdrawal_transaction_index: FeatureVersion, - pub add_update_next_withdrawal_transaction_index_operation: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityWithdrawalTransactionQueueMethodVersions { - pub add_enqueue_untied_withdrawal_transaction_operations: FeatureVersion, - pub dequeue_untied_withdrawal_transactions: FeatureVersion, - pub remove_broadcasted_withdrawal_transactions_after_completion_operations: FeatureVersion, - pub move_broadcasted_withdrawal_transactions_back_to_queue_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityContractInfoMethodVersions { - pub add_potential_contract_info_for_contract_bounded_key: FeatureVersion, - pub refresh_potential_contract_info_key_references: FeatureVersion, - pub merge_identity_contract_nonce: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityCostEstimationMethodVersions { - pub for_authentication_keys_security_level_in_key_reference_tree: FeatureVersion, - pub for_balances: FeatureVersion, - pub for_contract_info: FeatureVersion, - pub for_contract_info_group: FeatureVersion, - pub for_contract_info_group_keys: FeatureVersion, - pub for_contract_info_group_key_purpose: FeatureVersion, - pub for_keys_for_identity_id: FeatureVersion, - pub for_negative_credit: FeatureVersion, - pub for_purpose_in_key_reference_tree: FeatureVersion, - pub for_root_key_reference_tree: FeatureVersion, - pub for_update_revision: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchMethodVersions { - pub public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions, - pub attributes: DriveIdentityFetchAttributesMethodVersions, - pub partial_identity: DriveIdentityFetchPartialIdentityMethodVersions, - pub full_identity: DriveIdentityFetchFullIdentityMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchPublicKeyHashesMethodVersions { - pub fetch_full_identities_by_unique_public_key_hashes: FeatureVersion, - pub fetch_full_identity_by_unique_public_key_hash: FeatureVersion, - pub fetch_identity_id_by_unique_public_key_hash: FeatureVersion, - pub fetch_identity_ids_by_non_unique_public_key_hash: FeatureVersion, - pub fetch_identity_ids_by_unique_public_key_hashes: FeatureVersion, - pub fetch_serialized_full_identity_by_unique_public_key_hash: FeatureVersion, - pub has_any_of_unique_public_key_hashes: FeatureVersion, - pub has_non_unique_public_key_hash: FeatureVersion, - pub has_non_unique_public_key_hash_already_for_identity: FeatureVersion, - pub has_unique_public_key_hash: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchAttributesMethodVersions { - pub revision: FeatureVersion, - pub nonce: FeatureVersion, - pub identity_contract_nonce: FeatureVersion, - pub balance: FeatureVersion, - pub balance_include_debt: FeatureVersion, - pub negative_balance: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchFullIdentityMethodVersions { - pub fetch_full_identity: OptionalFeatureVersion, - pub fetch_full_identities: OptionalFeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityFetchPartialIdentityMethodVersions { - pub fetch_identity_revision_with_keys: FeatureVersion, - pub fetch_identity_balance_with_keys: FeatureVersion, - pub fetch_identity_balance_with_keys_and_revision: FeatureVersion, - pub fetch_identity_with_balance: FeatureVersion, - pub fetch_identity_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityProveMethodVersions { - pub full_identity: FeatureVersion, - pub full_identities: FeatureVersion, - pub identity_nonce: FeatureVersion, - pub identity_contract_nonce: FeatureVersion, - pub identities_contract_keys: FeatureVersion, - pub prove_full_identities_by_unique_public_key_hashes: FeatureVersion, - pub prove_full_identity_by_unique_public_key_hash: FeatureVersion, - pub prove_identity_id_by_unique_public_key_hash: FeatureVersion, - pub prove_identity_ids_by_unique_public_key_hashes: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysMethodVersions { - pub fetch: DriveIdentityKeysFetchMethodVersions, - pub prove: DriveIdentityKeysProveMethodVersions, - pub insert: DriveIdentityKeysInsertMethodVersions, - pub insert_key_hash_identity_reference: DriveIdentityKeyHashesToIdentityInsertMethodVersions, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysFetchMethodVersions { - pub fetch_all_current_identity_keys: FeatureVersion, - pub fetch_all_identity_keys: FeatureVersion, - pub fetch_identities_all_keys: FeatureVersion, - pub fetch_identity_keys: FeatureVersion, - pub fetch_identities_contract_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysProveMethodVersions { - pub prove_identities_all_keys: FeatureVersion, - pub prove_identity_keys: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeysInsertMethodVersions { - pub create_key_tree_with_keys: FeatureVersion, - pub create_new_identity_key_query_trees: FeatureVersion, - pub insert_key_searchable_references: FeatureVersion, - pub insert_key_to_storage: FeatureVersion, - pub insert_new_non_unique_key: FeatureVersion, - pub insert_new_unique_key: FeatureVersion, - pub replace_key_in_storage: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityKeyHashesToIdentityInsertMethodVersions { - pub add_estimation_costs_for_insert_non_unique_public_key_hash_reference: FeatureVersion, - pub add_estimation_costs_for_insert_unique_public_key_hash_reference: FeatureVersion, - pub insert_non_unique_public_key_hash_reference_to_identity: FeatureVersion, - pub insert_reference_to_non_unique_key: FeatureVersion, - pub insert_reference_to_unique_key: FeatureVersion, - pub insert_unique_public_key_hash_reference_to_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityInsertMethodVersions { - pub add_new_identity: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveIdentityUpdateMethodVersions { - pub update_identity_revision: FeatureVersion, - pub merge_identity_nonce: FeatureVersion, - pub update_identity_negative_credit_operation: FeatureVersion, - pub initialize_identity_revision: FeatureVersion, - pub disable_identity_keys: FeatureVersion, - pub re_enable_identity_keys: FeatureVersion, - pub add_new_non_unique_keys_to_identity: FeatureVersion, - pub add_new_unique_keys_to_identity: FeatureVersion, - pub add_new_keys_to_identity: FeatureVersion, - pub insert_identity_balance: FeatureVersion, - pub initialize_negative_identity_balance: FeatureVersion, - pub add_to_identity_balance: FeatureVersion, - pub add_to_previous_balance: FeatureVersion, - pub apply_balance_change_from_fee_to_identity: FeatureVersion, - pub remove_from_identity_balance: FeatureVersion, - pub refresh_identity_key_reference_operations: FeatureVersion, -} - -#[derive(Clone, Debug, Default)] -pub struct DriveEstimatedCostsMethodVersions { - pub add_estimation_costs_for_levels_up_to_contract: FeatureVersion, - pub add_estimation_costs_for_levels_up_to_contract_document_type_excluded: FeatureVersion, - pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract: FeatureVersion, - pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: - FeatureVersion, -} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs new file mode 100644 index 0000000000..18cf2d3a4f --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs @@ -0,0 +1,59 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveContractMethodVersions { + pub prove: DriveContractProveMethodVersions, + pub apply: DriveContractApplyMethodVersions, + pub insert: DriveContractInsertMethodVersions, + pub update: DriveContractUpdateMethodVersions, + pub costs: DriveContractCostsMethodVersions, + pub get: DriveContractGetMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractProveMethodVersions { + pub prove_contract: FeatureVersion, + pub prove_contract_history: FeatureVersion, + pub prove_contracts: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractApplyMethodVersions { + pub apply_contract: FeatureVersion, + pub apply_contract_with_serialization: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractInsertMethodVersions { + pub add_contract_to_storage: FeatureVersion, + pub insert_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractUpdateMethodVersions { + pub update_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractGetMethodVersions { + pub fetch_contract: FeatureVersion, + pub fetch_contract_with_history: FeatureVersion, + pub get_cached_contract_with_fetch_info: FeatureVersion, + pub get_contract_with_fetch_info: FeatureVersion, + pub get_contracts_with_fetch_info: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractQueryMethodVersions { + pub fetch_contract_query: FeatureVersion, + pub fetch_contract_with_history_latest_query: FeatureVersion, + pub fetch_contracts_query: FeatureVersion, + pub fetch_contract_history_query: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveContractCostsMethodVersions { + pub add_estimation_costs_for_contract_insertion: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs new file mode 100644 index 0000000000..67824dafea --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs @@ -0,0 +1,33 @@ +use crate::version::drive_versions::drive_contract_method_versions::{ + DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, + DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, + DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, +}; + +pub const DRIVE_CONTRACT_METHOD_VERSIONS_V1: DriveContractMethodVersions = + DriveContractMethodVersions { + prove: DriveContractProveMethodVersions { + prove_contract: 0, + prove_contract_history: 0, + prove_contracts: 0, + }, + apply: DriveContractApplyMethodVersions { + apply_contract: 0, + apply_contract_with_serialization: 0, + }, + insert: DriveContractInsertMethodVersions { + add_contract_to_storage: 0, + insert_contract: 0, + }, + update: DriveContractUpdateMethodVersions { update_contract: 0 }, + costs: DriveContractCostsMethodVersions { + add_estimation_costs_for_contract_insertion: 0, + }, + get: DriveContractGetMethodVersions { + fetch_contract: 0, + fetch_contract_with_history: 0, + get_cached_contract_with_fetch_info: 0, + get_contract_with_fetch_info: 0, + get_contracts_with_fetch_info: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs new file mode 100644 index 0000000000..0d116b4104 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/mod.rs @@ -0,0 +1,49 @@ +use versioned_feature_core::FeatureVersion; +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolMethodVersions { + pub epochs: DriveCreditPoolEpochsMethodVersions, + pub pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions, + pub storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions, + pub unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolEpochsMethodVersions { + pub get_epochs_infos: FeatureVersion, + pub get_epochs_protocol_versions: FeatureVersion, + pub prove_epochs_infos: FeatureVersion, + pub get_epoch_fee_multiplier: FeatureVersion, + pub get_epoch_processing_credits_for_distribution: FeatureVersion, + pub get_epoch_storage_credits_for_distribution: FeatureVersion, + pub get_epoch_total_credits_for_distribution: FeatureVersion, + pub get_storage_credits_for_distribution_for_epochs_in_range: FeatureVersion, + pub get_epoch_start_time: FeatureVersion, + pub get_epoch_start_block_core_height: FeatureVersion, + pub get_epoch_start_block_height: FeatureVersion, + pub get_first_epoch_start_block_info_between_epochs: FeatureVersion, + pub fetch_epoch_proposers: FeatureVersion, + pub prove_epoch_proposers: FeatureVersion, + pub get_epochs_proposer_block_count: FeatureVersion, + pub add_update_pending_epoch_refunds_operations: FeatureVersion, + pub is_epochs_proposers_tree_empty: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolUnpaidEpochMethodVersions { + pub get_unpaid_epoch_index: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolPendingEpochRefundsMethodVersions { + pub add_delete_pending_epoch_refunds_except_specified: FeatureVersion, + pub fetch_and_add_pending_epoch_refunds_to_collection: FeatureVersion, + pub fetch_pending_epoch_refunds: FeatureVersion, + pub add_update_pending_epoch_refunds_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveCreditPoolStorageFeeDistributionPoolMethodVersions { + pub get_storage_fees_from_distribution_pool: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs new file mode 100644 index 0000000000..4311729886 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_credit_pool_method_versions/v1.rs @@ -0,0 +1,41 @@ +use crate::version::drive_versions::drive_credit_pool_method_versions::{ + DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, + DriveCreditPoolPendingEpochRefundsMethodVersions, + DriveCreditPoolStorageFeeDistributionPoolMethodVersions, + DriveCreditPoolUnpaidEpochMethodVersions, +}; + +pub const CREDIT_POOL_METHOD_VERSIONS_V1: DriveCreditPoolMethodVersions = + DriveCreditPoolMethodVersions { + epochs: DriveCreditPoolEpochsMethodVersions { + get_epochs_infos: 0, + get_epochs_protocol_versions: 0, + prove_epochs_infos: 0, + get_epoch_fee_multiplier: 0, + get_epoch_processing_credits_for_distribution: 0, + get_epoch_storage_credits_for_distribution: 0, + get_epoch_total_credits_for_distribution: 0, + get_storage_credits_for_distribution_for_epochs_in_range: 0, + get_epoch_start_time: 0, + get_epoch_start_block_core_height: 0, + get_epoch_start_block_height: 0, + get_first_epoch_start_block_info_between_epochs: 0, + fetch_epoch_proposers: 0, + prove_epoch_proposers: 0, + get_epochs_proposer_block_count: 0, + add_update_pending_epoch_refunds_operations: 0, + is_epochs_proposers_tree_empty: 0, + }, + pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { + add_delete_pending_epoch_refunds_except_specified: 0, + fetch_and_add_pending_epoch_refunds_to_collection: 0, + fetch_pending_epoch_refunds: 0, + add_update_pending_epoch_refunds_operations: 0, + }, + storage_fee_distribution_pool: DriveCreditPoolStorageFeeDistributionPoolMethodVersions { + get_storage_fees_from_distribution_pool: 0, + }, + unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { + get_unpaid_epoch_index: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs new file mode 100644 index 0000000000..12eebc7386 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs @@ -0,0 +1,90 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentMethodVersions { + pub query: DriveDocumentQueryMethodVersions, + pub delete: DriveDocumentDeleteMethodVersions, + pub insert: DriveDocumentInsertMethodVersions, + pub insert_contested: DriveDocumentInsertContestedMethodVersions, + pub update: DriveDocumentUpdateMethodVersions, + pub estimation_costs: DriveDocumentEstimationCostsMethodVersions, + pub index_uniqueness: DriveDocumentIndexUniquenessMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentQueryMethodVersions { + pub query_documents: FeatureVersion, + pub query_contested_documents: FeatureVersion, + pub query_contested_documents_vote_state: FeatureVersion, + pub query_documents_with_flags: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentEstimationCostsMethodVersions { + pub add_estimation_costs_for_add_document_to_primary_storage: FeatureVersion, + pub add_estimation_costs_for_add_contested_document_to_primary_storage: FeatureVersion, + pub stateless_delete_of_non_tree_for_costs: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentInsertMethodVersions { + pub add_document: FeatureVersion, + pub add_document_for_contract: FeatureVersion, + pub add_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub add_document_for_contract_operations: FeatureVersion, + pub add_document_to_primary_storage: FeatureVersion, + pub add_indices_for_index_level_for_contract_operations: FeatureVersion, + pub add_indices_for_top_index_level_for_contract_operations: FeatureVersion, + pub add_reference_for_index_level_for_contract_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentInsertContestedMethodVersions { + pub add_contested_document: FeatureVersion, + pub add_contested_document_for_contract: FeatureVersion, + pub add_contested_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub add_contested_document_for_contract_operations: FeatureVersion, + pub add_contested_document_to_primary_storage: FeatureVersion, + pub add_contested_indices_for_contract_operations: FeatureVersion, + pub add_contested_reference_and_vote_subtree_to_document_operations: FeatureVersion, + pub add_contested_vote_subtree_for_non_identities_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentUpdateMethodVersions { + pub add_update_multiple_documents_operations: FeatureVersion, + pub update_document_for_contract: FeatureVersion, + pub update_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub update_document_for_contract_id: FeatureVersion, + pub update_document_for_contract_operations: FeatureVersion, + pub update_document_with_serialization_for_contract: FeatureVersion, + pub update_serialized_document_for_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentDeleteMethodVersions { + pub add_estimation_costs_for_remove_document_to_primary_storage: FeatureVersion, + pub delete_document_for_contract: FeatureVersion, + pub delete_document_for_contract_id: FeatureVersion, + pub delete_document_for_contract_apply_and_add_to_operations: FeatureVersion, + pub remove_document_from_primary_storage: FeatureVersion, + pub remove_reference_for_index_level_for_contract_operations: FeatureVersion, + pub remove_indices_for_index_level_for_contract_operations: FeatureVersion, + pub remove_indices_for_top_index_level_for_contract_operations: FeatureVersion, + pub delete_document_for_contract_id_with_named_type_operations: FeatureVersion, + pub delete_document_for_contract_with_named_type_operations: FeatureVersion, + pub delete_document_for_contract_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDocumentIndexUniquenessMethodVersions { + pub validate_document_uniqueness: FeatureVersion, + pub validate_document_create_transition_action_uniqueness: FeatureVersion, + pub validate_document_replace_transition_action_uniqueness: FeatureVersion, + pub validate_document_transfer_transition_action_uniqueness: FeatureVersion, + pub validate_document_purchase_transition_action_uniqueness: FeatureVersion, + pub validate_document_update_price_transition_action_uniqueness: FeatureVersion, + pub validate_uniqueness_of_data: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs new file mode 100644 index 0000000000..05479b23e9 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs @@ -0,0 +1,72 @@ +use crate::version::drive_versions::drive_document_method_versions::{ + DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, + DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, + DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, + DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, +}; + +pub const DRIVE_DOCUMENT_METHOD_VERSIONS_V1: DriveDocumentMethodVersions = + DriveDocumentMethodVersions { + query: DriveDocumentQueryMethodVersions { + query_documents: 0, + query_contested_documents: 0, + query_contested_documents_vote_state: 0, + query_documents_with_flags: 0, + }, + delete: DriveDocumentDeleteMethodVersions { + add_estimation_costs_for_remove_document_to_primary_storage: 0, + delete_document_for_contract: 0, + delete_document_for_contract_id: 0, + delete_document_for_contract_apply_and_add_to_operations: 0, + remove_document_from_primary_storage: 0, + remove_reference_for_index_level_for_contract_operations: 0, + remove_indices_for_index_level_for_contract_operations: 0, + remove_indices_for_top_index_level_for_contract_operations: 0, + delete_document_for_contract_id_with_named_type_operations: 0, + delete_document_for_contract_with_named_type_operations: 0, + delete_document_for_contract_operations: 0, + }, + insert: DriveDocumentInsertMethodVersions { + add_document: 0, + add_document_for_contract: 0, + add_document_for_contract_apply_and_add_to_operations: 0, + add_document_for_contract_operations: 0, + add_document_to_primary_storage: 0, + add_indices_for_index_level_for_contract_operations: 0, + add_indices_for_top_index_level_for_contract_operations: 0, + add_reference_for_index_level_for_contract_operations: 0, + }, + insert_contested: DriveDocumentInsertContestedMethodVersions { + add_contested_document: 0, + add_contested_document_for_contract: 0, + add_contested_document_for_contract_apply_and_add_to_operations: 0, + add_contested_document_for_contract_operations: 0, + add_contested_document_to_primary_storage: 0, + add_contested_indices_for_contract_operations: 0, + add_contested_reference_and_vote_subtree_to_document_operations: 0, + add_contested_vote_subtree_for_non_identities_operations: 0, + }, + update: DriveDocumentUpdateMethodVersions { + add_update_multiple_documents_operations: 0, + update_document_for_contract: 0, + update_document_for_contract_apply_and_add_to_operations: 0, + update_document_for_contract_id: 0, + update_document_for_contract_operations: 0, + update_document_with_serialization_for_contract: 0, + update_serialized_document_for_contract: 0, + }, + estimation_costs: DriveDocumentEstimationCostsMethodVersions { + add_estimation_costs_for_add_document_to_primary_storage: 0, + add_estimation_costs_for_add_contested_document_to_primary_storage: 0, + stateless_delete_of_non_tree_for_costs: 0, + }, + index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { + validate_document_uniqueness: 0, + validate_document_create_transition_action_uniqueness: 0, + validate_document_replace_transition_action_uniqueness: 0, + validate_document_transfer_transition_action_uniqueness: 0, + validate_document_purchase_transition_action_uniqueness: 0, + validate_document_update_price_transition_action_uniqueness: 0, + validate_uniqueness_of_data: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs new file mode 100644 index 0000000000..c61b52f250 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/mod.rs @@ -0,0 +1,66 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveMethodVersions { + pub basic: DriveGroveBasicMethodVersions, + pub batch: DriveGroveBatchMethodVersions, + pub apply: DriveGroveApplyMethodVersions, + pub costs: DriveGroveCostMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveBasicMethodVersions { + pub grove_insert: FeatureVersion, + pub grove_insert_empty_tree: FeatureVersion, + pub grove_insert_empty_sum_tree: FeatureVersion, + pub grove_insert_if_not_exists: FeatureVersion, + pub grove_insert_if_not_exists_return_existing_element: FeatureVersion, + pub grove_clear: FeatureVersion, + pub grove_delete: FeatureVersion, + pub grove_get_raw: FeatureVersion, + pub grove_get_raw_optional: FeatureVersion, + pub grove_get_raw_value_u64_from_encoded_var_vec: FeatureVersion, + pub grove_get: FeatureVersion, + pub grove_get_path_query_serialized_results: FeatureVersion, + pub grove_get_path_query_serialized_or_sum_results: FeatureVersion, + pub grove_get_path_query: FeatureVersion, + pub grove_get_path_query_with_optional: FeatureVersion, + pub grove_get_raw_path_query_with_optional: FeatureVersion, + pub grove_get_raw_path_query: FeatureVersion, + pub grove_get_proved_path_query: FeatureVersion, + pub grove_get_proved_path_query_with_conditional: FeatureVersion, + pub grove_get_sum_tree_total_value: FeatureVersion, + pub grove_has_raw: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveBatchMethodVersions { + pub batch_insert_empty_tree: FeatureVersion, + pub batch_insert_empty_tree_if_not_exists: FeatureVersion, + pub batch_insert_empty_tree_if_not_exists_check_existing_operations: FeatureVersion, + pub batch_insert_sum_item_or_add_to_if_already_exists: FeatureVersion, + pub batch_insert: FeatureVersion, + pub batch_insert_if_not_exists: FeatureVersion, + pub batch_insert_if_changed_value: FeatureVersion, + pub batch_replace: FeatureVersion, + pub batch_delete: FeatureVersion, + pub batch_delete_items_in_path_query: FeatureVersion, + pub batch_move_items_in_path_query: FeatureVersion, + pub batch_remove_raw: FeatureVersion, + pub batch_delete_up_tree_while_empty: FeatureVersion, + pub batch_refresh_reference: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveApplyMethodVersions { + pub grove_apply_operation: FeatureVersion, + pub grove_apply_batch: FeatureVersion, + pub grove_apply_partial_batch: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveGroveCostMethodVersions { + pub grove_batch_operations_costs: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs new file mode 100644 index 0000000000..6dc9b44503 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_grove_method_versions/v1.rs @@ -0,0 +1,54 @@ +use crate::version::drive_versions::drive_grove_method_versions::{ + DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, + DriveGroveCostMethodVersions, DriveGroveMethodVersions, +}; + +pub const DRIVE_GROVE_METHOD_VERSIONS_V1: DriveGroveMethodVersions = DriveGroveMethodVersions { + basic: DriveGroveBasicMethodVersions { + grove_insert: 0, + grove_insert_empty_tree: 0, + grove_insert_empty_sum_tree: 0, + grove_insert_if_not_exists: 0, + grove_insert_if_not_exists_return_existing_element: 0, + grove_clear: 0, + grove_delete: 0, + grove_get_raw: 0, + grove_get_raw_optional: 0, + grove_get_raw_value_u64_from_encoded_var_vec: 0, + grove_get: 0, + grove_get_path_query_serialized_results: 0, + grove_get_path_query_serialized_or_sum_results: 0, + grove_get_path_query: 0, + grove_get_path_query_with_optional: 0, + grove_get_raw_path_query_with_optional: 0, + grove_get_raw_path_query: 0, + grove_get_proved_path_query: 0, + grove_get_proved_path_query_with_conditional: 0, + grove_get_sum_tree_total_value: 0, + grove_has_raw: 0, + }, + batch: DriveGroveBatchMethodVersions { + batch_insert_empty_tree: 0, + batch_insert_empty_tree_if_not_exists: 0, + batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, + batch_insert_sum_item_or_add_to_if_already_exists: 0, + batch_insert: 0, + batch_insert_if_not_exists: 0, + batch_insert_if_changed_value: 0, + batch_replace: 0, + batch_delete: 0, + batch_delete_items_in_path_query: 0, + batch_move_items_in_path_query: 0, + batch_remove_raw: 0, + batch_delete_up_tree_while_empty: 0, + batch_refresh_reference: 0, + }, + apply: DriveGroveApplyMethodVersions { + grove_apply_operation: 0, + grove_apply_batch: 0, + grove_apply_partial_batch: 0, + }, + costs: DriveGroveCostMethodVersions { + grove_batch_operations_costs: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs new file mode 100644 index 0000000000..c44788e4c3 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs @@ -0,0 +1,199 @@ +use versioned_feature_core::{FeatureVersion, OptionalFeatureVersion}; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityMethodVersions { + pub fetch: DriveIdentityFetchMethodVersions, + pub prove: DriveIdentityProveMethodVersions, + pub keys: DriveIdentityKeysMethodVersions, + pub update: DriveIdentityUpdateMethodVersions, + pub insert: DriveIdentityInsertMethodVersions, + pub contract_info: DriveIdentityContractInfoMethodVersions, + pub cost_estimation: DriveIdentityCostEstimationMethodVersions, + pub withdrawals: DriveIdentityWithdrawalMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalMethodVersions { + pub document: DriveIdentityWithdrawalDocumentMethodVersions, + pub transaction: DriveIdentityWithdrawalTransactionMethodVersions, + pub calculate_current_withdrawal_limit: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalDocumentMethodVersions { + pub fetch_oldest_withdrawal_documents_by_status: FeatureVersion, + pub find_withdrawal_documents_by_status_and_transaction_indices: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionMethodVersions { + pub index: DriveIdentityWithdrawalTransactionIndexMethodVersions, + pub queue: DriveIdentityWithdrawalTransactionQueueMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionIndexMethodVersions { + pub fetch_next_withdrawal_transaction_index: FeatureVersion, + pub add_update_next_withdrawal_transaction_index_operation: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityWithdrawalTransactionQueueMethodVersions { + pub add_enqueue_untied_withdrawal_transaction_operations: FeatureVersion, + pub dequeue_untied_withdrawal_transactions: FeatureVersion, + pub remove_broadcasted_withdrawal_transactions_after_completion_operations: FeatureVersion, + pub move_broadcasted_withdrawal_transactions_back_to_queue_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityContractInfoMethodVersions { + pub add_potential_contract_info_for_contract_bounded_key: FeatureVersion, + pub refresh_potential_contract_info_key_references: FeatureVersion, + pub merge_identity_contract_nonce: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityCostEstimationMethodVersions { + pub for_authentication_keys_security_level_in_key_reference_tree: FeatureVersion, + pub for_balances: FeatureVersion, + pub for_contract_info: FeatureVersion, + pub for_contract_info_group: FeatureVersion, + pub for_contract_info_group_keys: FeatureVersion, + pub for_contract_info_group_key_purpose: FeatureVersion, + pub for_keys_for_identity_id: FeatureVersion, + pub for_negative_credit: FeatureVersion, + pub for_purpose_in_key_reference_tree: FeatureVersion, + pub for_root_key_reference_tree: FeatureVersion, + pub for_update_revision: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchMethodVersions { + pub public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions, + pub attributes: DriveIdentityFetchAttributesMethodVersions, + pub partial_identity: DriveIdentityFetchPartialIdentityMethodVersions, + pub full_identity: DriveIdentityFetchFullIdentityMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchPublicKeyHashesMethodVersions { + pub fetch_full_identities_by_unique_public_key_hashes: FeatureVersion, + pub fetch_full_identity_by_unique_public_key_hash: FeatureVersion, + pub fetch_identity_id_by_unique_public_key_hash: FeatureVersion, + pub fetch_identity_ids_by_non_unique_public_key_hash: FeatureVersion, + pub fetch_identity_ids_by_unique_public_key_hashes: FeatureVersion, + pub fetch_serialized_full_identity_by_unique_public_key_hash: FeatureVersion, + pub has_any_of_unique_public_key_hashes: FeatureVersion, + pub has_non_unique_public_key_hash: FeatureVersion, + pub has_non_unique_public_key_hash_already_for_identity: FeatureVersion, + pub has_unique_public_key_hash: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchAttributesMethodVersions { + pub revision: FeatureVersion, + pub nonce: FeatureVersion, + pub identity_contract_nonce: FeatureVersion, + pub balance: FeatureVersion, + pub balance_include_debt: FeatureVersion, + pub negative_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchFullIdentityMethodVersions { + pub fetch_full_identity: OptionalFeatureVersion, + pub fetch_full_identities: OptionalFeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityFetchPartialIdentityMethodVersions { + pub fetch_identity_revision_with_keys: FeatureVersion, + pub fetch_identity_balance_with_keys: FeatureVersion, + pub fetch_identity_balance_with_keys_and_revision: FeatureVersion, + pub fetch_identity_with_balance: FeatureVersion, + pub fetch_identity_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityProveMethodVersions { + pub full_identity: FeatureVersion, + pub full_identities: FeatureVersion, + pub identity_nonce: FeatureVersion, + pub identity_contract_nonce: FeatureVersion, + pub identities_contract_keys: FeatureVersion, + pub prove_full_identities_by_unique_public_key_hashes: FeatureVersion, + pub prove_full_identity_by_unique_public_key_hash: FeatureVersion, + pub prove_identity_id_by_unique_public_key_hash: FeatureVersion, + pub prove_identity_ids_by_unique_public_key_hashes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysMethodVersions { + pub fetch: DriveIdentityKeysFetchMethodVersions, + pub prove: DriveIdentityKeysProveMethodVersions, + pub insert: DriveIdentityKeysInsertMethodVersions, + pub insert_key_hash_identity_reference: DriveIdentityKeyHashesToIdentityInsertMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysFetchMethodVersions { + pub fetch_all_current_identity_keys: FeatureVersion, + pub fetch_all_identity_keys: FeatureVersion, + pub fetch_identities_all_keys: FeatureVersion, + pub fetch_identity_keys: FeatureVersion, + pub fetch_identities_contract_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysProveMethodVersions { + pub prove_identities_all_keys: FeatureVersion, + pub prove_identity_keys: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeysInsertMethodVersions { + pub create_key_tree_with_keys: FeatureVersion, + pub create_new_identity_key_query_trees: FeatureVersion, + pub insert_key_searchable_references: FeatureVersion, + pub insert_key_to_storage: FeatureVersion, + pub insert_new_non_unique_key: FeatureVersion, + pub insert_new_unique_key: FeatureVersion, + pub replace_key_in_storage: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityKeyHashesToIdentityInsertMethodVersions { + pub add_estimation_costs_for_insert_non_unique_public_key_hash_reference: FeatureVersion, + pub add_estimation_costs_for_insert_unique_public_key_hash_reference: FeatureVersion, + pub insert_non_unique_public_key_hash_reference_to_identity: FeatureVersion, + pub insert_reference_to_non_unique_key: FeatureVersion, + pub insert_reference_to_unique_key: FeatureVersion, + pub insert_unique_public_key_hash_reference_to_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityInsertMethodVersions { + pub add_new_identity: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveIdentityUpdateMethodVersions { + pub update_identity_revision: FeatureVersion, + pub merge_identity_nonce: FeatureVersion, + pub update_identity_negative_credit_operation: FeatureVersion, + pub initialize_identity_revision: FeatureVersion, + pub disable_identity_keys: FeatureVersion, + pub re_enable_identity_keys: FeatureVersion, + pub add_new_non_unique_keys_to_identity: FeatureVersion, + pub add_new_unique_keys_to_identity: FeatureVersion, + pub add_new_keys_to_identity: FeatureVersion, + pub insert_identity_balance: FeatureVersion, + pub initialize_negative_identity_balance: FeatureVersion, + pub add_to_identity_balance: FeatureVersion, + pub add_to_previous_balance: FeatureVersion, + pub apply_balance_change_from_fee_to_identity: FeatureVersion, + pub remove_from_identity_balance: FeatureVersion, + pub refresh_identity_key_reference_operations: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs new file mode 100644 index 0000000000..098f38ab7c --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs @@ -0,0 +1,151 @@ +use crate::version::drive_versions::drive_identity_method_versions::{ + DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, + DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, + DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, + DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, + DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, + DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, + DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, + DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, + DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, + DriveIdentityWithdrawalTransactionIndexMethodVersions, + DriveIdentityWithdrawalTransactionMethodVersions, + DriveIdentityWithdrawalTransactionQueueMethodVersions, +}; + +pub const DRIVE_IDENTITY_METHOD_VERSIONS_V1: DriveIdentityMethodVersions = + DriveIdentityMethodVersions { + fetch: DriveIdentityFetchMethodVersions { + public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { + fetch_full_identities_by_unique_public_key_hashes: 0, + fetch_full_identity_by_unique_public_key_hash: 0, + fetch_identity_id_by_unique_public_key_hash: 0, + fetch_identity_ids_by_non_unique_public_key_hash: 0, + fetch_identity_ids_by_unique_public_key_hashes: 0, + fetch_serialized_full_identity_by_unique_public_key_hash: 0, + has_any_of_unique_public_key_hashes: 0, + has_non_unique_public_key_hash: 0, + has_non_unique_public_key_hash_already_for_identity: 0, + has_unique_public_key_hash: 0, + }, + attributes: DriveIdentityFetchAttributesMethodVersions { + revision: 0, + nonce: 0, + identity_contract_nonce: 0, + balance: 0, + balance_include_debt: 0, + negative_balance: 0, + }, + partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { + fetch_identity_revision_with_keys: 0, + fetch_identity_balance_with_keys: 0, + fetch_identity_balance_with_keys_and_revision: 0, + fetch_identity_with_balance: 0, + fetch_identity_keys: 0, + }, + full_identity: DriveIdentityFetchFullIdentityMethodVersions { + fetch_full_identity: Some(0), + fetch_full_identities: Some(0), + }, + }, + prove: DriveIdentityProveMethodVersions { + full_identity: 0, + full_identities: 0, + identity_nonce: 0, + identity_contract_nonce: 0, + identities_contract_keys: 0, + prove_full_identities_by_unique_public_key_hashes: 0, + prove_full_identity_by_unique_public_key_hash: 0, + prove_identity_id_by_unique_public_key_hash: 0, + prove_identity_ids_by_unique_public_key_hashes: 0, + }, + keys: DriveIdentityKeysMethodVersions { + fetch: DriveIdentityKeysFetchMethodVersions { + fetch_all_current_identity_keys: 0, + fetch_all_identity_keys: 0, + fetch_identities_all_keys: 0, + fetch_identity_keys: 0, + fetch_identities_contract_keys: 0, + }, + prove: DriveIdentityKeysProveMethodVersions { + prove_identities_all_keys: 0, + prove_identity_keys: 0, + }, + insert: DriveIdentityKeysInsertMethodVersions { + create_key_tree_with_keys: 0, + create_new_identity_key_query_trees: 0, + insert_key_searchable_references: 0, + insert_key_to_storage: 0, + insert_new_non_unique_key: 0, + insert_new_unique_key: 0, + replace_key_in_storage: 0, + }, + insert_key_hash_identity_reference: + DriveIdentityKeyHashesToIdentityInsertMethodVersions { + add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, + add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, + insert_non_unique_public_key_hash_reference_to_identity: 0, + insert_reference_to_non_unique_key: 0, + insert_reference_to_unique_key: 0, + insert_unique_public_key_hash_reference_to_identity: 0, + }, + }, + update: DriveIdentityUpdateMethodVersions { + update_identity_revision: 0, + merge_identity_nonce: 0, + update_identity_negative_credit_operation: 0, + initialize_identity_revision: 0, + disable_identity_keys: 0, + re_enable_identity_keys: 0, + add_new_non_unique_keys_to_identity: 0, + add_new_unique_keys_to_identity: 0, + add_new_keys_to_identity: 0, + insert_identity_balance: 0, + initialize_negative_identity_balance: 0, + add_to_identity_balance: 0, + add_to_previous_balance: 0, + apply_balance_change_from_fee_to_identity: 0, + remove_from_identity_balance: 0, + refresh_identity_key_reference_operations: 0, + }, + insert: DriveIdentityInsertMethodVersions { + add_new_identity: 0, + }, + contract_info: DriveIdentityContractInfoMethodVersions { + add_potential_contract_info_for_contract_bounded_key: 0, + refresh_potential_contract_info_key_references: 0, + merge_identity_contract_nonce: 0, + }, + cost_estimation: DriveIdentityCostEstimationMethodVersions { + for_authentication_keys_security_level_in_key_reference_tree: 0, + for_balances: 0, + for_contract_info: 0, + for_contract_info_group: 0, + for_contract_info_group_keys: 0, + for_contract_info_group_key_purpose: 0, + for_keys_for_identity_id: 0, + for_negative_credit: 0, + for_purpose_in_key_reference_tree: 0, + for_root_key_reference_tree: 0, + for_update_revision: 0, + }, + withdrawals: DriveIdentityWithdrawalMethodVersions { + document: DriveIdentityWithdrawalDocumentMethodVersions { + fetch_oldest_withdrawal_documents_by_status: 0, + find_withdrawal_documents_by_status_and_transaction_indices: 0, + }, + transaction: DriveIdentityWithdrawalTransactionMethodVersions { + index: DriveIdentityWithdrawalTransactionIndexMethodVersions { + fetch_next_withdrawal_transaction_index: 0, + add_update_next_withdrawal_transaction_index_operation: 0, + }, + queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { + add_enqueue_untied_withdrawal_transaction_operations: 0, + dequeue_untied_withdrawal_transactions: 0, + remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, + move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, + }, + }, + calculate_current_withdrawal_limit: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs new file mode 100644 index 0000000000..c482548908 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs @@ -0,0 +1,39 @@ +pub mod v1; + +use crate::version::drive_versions::DriveDataContractOperationMethodVersions; +use versioned_feature_core::FeatureVersion; + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionMethodVersions { + pub operations: DriveStateTransitionOperationMethodVersions, + pub convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + pub data_contract_create_transition: FeatureVersion, + pub data_contract_update_transition: FeatureVersion, + pub document_create_transition: FeatureVersion, + pub document_delete_transition: FeatureVersion, + pub document_purchase_transition: FeatureVersion, + pub document_replace_transition: FeatureVersion, + pub document_transfer_transition: FeatureVersion, + pub document_update_price_transition: FeatureVersion, + pub documents_batch_transition: FeatureVersion, + pub identity_create_transition: FeatureVersion, + pub identity_credit_transfer_transition: FeatureVersion, + pub identity_credit_withdrawal_transition: FeatureVersion, + pub identity_top_up_transition: FeatureVersion, + pub identity_update_transition: FeatureVersion, + pub masternode_vote_transition: FeatureVersion, + pub bump_identity_data_contract_nonce: FeatureVersion, + pub bump_identity_nonce: FeatureVersion, + pub partially_use_asset_lock: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveStateTransitionOperationMethodVersions { + pub finalization_tasks: FeatureVersion, + pub contracts: DriveDataContractOperationMethodVersions, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs new file mode 100644 index 0000000000..45e732c99c --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs @@ -0,0 +1,36 @@ +use crate::version::drive_versions::drive_state_transition_method_versions::{ + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, + DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, +}; +use crate::version::drive_versions::DriveDataContractOperationMethodVersions; + +pub const DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1: DriveStateTransitionMethodVersions = + DriveStateTransitionMethodVersions { + operations: DriveStateTransitionOperationMethodVersions { + finalization_tasks: 0, + contracts: DriveDataContractOperationMethodVersions { + finalization_tasks: 0, + }, + }, + convert_to_high_level_operations: + DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { + data_contract_create_transition: 0, + data_contract_update_transition: 0, + document_create_transition: 0, + document_delete_transition: 0, + document_purchase_transition: 0, + document_replace_transition: 0, + document_transfer_transition: 0, + document_update_price_transition: 0, + documents_batch_transition: 0, + identity_create_transition: 0, + identity_credit_transfer_transition: 0, + identity_credit_withdrawal_transition: 0, + identity_top_up_transition: 0, + identity_update_transition: 0, + masternode_vote_transition: 0, + bump_identity_data_contract_nonce: 0, + bump_identity_nonce: 0, + partially_use_asset_lock: 0, + }, + }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs new file mode 100644 index 0000000000..474942c469 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/mod.rs @@ -0,0 +1,10 @@ +use versioned_feature_core::FeatureVersionBounds; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveStructureVersion { + pub document_indexes: FeatureVersionBounds, + pub identity_indexes: FeatureVersionBounds, + pub pools: FeatureVersionBounds, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs new file mode 100644 index 0000000000..be8dc19b27 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_structure_version/v1.rs @@ -0,0 +1,20 @@ +use crate::version::drive_versions::drive_structure_version::DriveStructureVersion; +use versioned_feature_core::FeatureVersionBounds; + +pub const DRIVE_STRUCTURE_V1: DriveStructureVersion = DriveStructureVersion { + document_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + identity_indexes: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, + pools: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs new file mode 100644 index 0000000000..39d4255136 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs @@ -0,0 +1,76 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyMethodVersions { + pub contract: DriveVerifyContractMethodVersions, + pub document: DriveVerifyDocumentMethodVersions, + pub identity: DriveVerifyIdentityMethodVersions, + pub single_document: DriveVerifySingleDocumentMethodVersions, + pub system: DriveVerifySystemMethodVersions, + pub voting: DriveVerifyVoteMethodVersions, + pub state_transition: DriveVerifyStateTransitionMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyContractMethodVersions { + pub verify_contract: FeatureVersion, + pub verify_contract_history: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyDocumentMethodVersions { + pub verify_proof: FeatureVersion, + pub verify_proof_keep_serialized: FeatureVersion, + pub verify_start_at_document_in_proof: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyIdentityMethodVersions { + pub verify_full_identities_by_public_key_hashes: FeatureVersion, + pub verify_full_identity_by_identity_id: FeatureVersion, + pub verify_full_identity_by_public_key_hash: FeatureVersion, + pub verify_identity_balance_for_identity_id: FeatureVersion, + pub verify_identity_balances_for_identity_ids: FeatureVersion, + pub verify_identity_id_by_public_key_hash: FeatureVersion, + pub verify_identity_ids_by_public_key_hashes: FeatureVersion, + pub verify_identity_keys_by_identity_id: FeatureVersion, + pub verify_identity_nonce: FeatureVersion, + pub verify_identity_contract_nonce: FeatureVersion, + pub verify_identities_contract_keys: FeatureVersion, + pub verify_identity_revision_for_identity_id: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyVoteMethodVersions { + pub verify_masternode_vote: FeatureVersion, + pub verify_start_at_contender_in_proof: FeatureVersion, + pub verify_vote_poll_votes_proof: FeatureVersion, + pub verify_identity_votes_given_proof: FeatureVersion, + pub verify_vote_poll_vote_state_proof: FeatureVersion, + pub verify_contests_proof: FeatureVersion, + pub verify_vote_polls_by_end_date_proof: FeatureVersion, + pub verify_specialized_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifySystemMethodVersions { + pub verify_epoch_infos: FeatureVersion, + pub verify_epoch_proposers: FeatureVersion, + pub verify_elements: FeatureVersion, + pub verify_total_credits_in_system: FeatureVersion, + pub verify_upgrade_state: FeatureVersion, + pub verify_upgrade_vote_status: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifySingleDocumentMethodVersions { + pub verify_proof: FeatureVersion, + pub verify_proof_keep_serialized: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVerifyStateTransitionMethodVersions { + pub verify_state_transition_was_executed_with_proof: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs new file mode 100644 index 0000000000..4c40371f83 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs @@ -0,0 +1,57 @@ +use crate::version::drive_versions::drive_verify_method_versions::{ + DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, + DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, + DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, + DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, +}; + +pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVerifyMethodVersions { + contract: DriveVerifyContractMethodVersions { + verify_contract: 0, + verify_contract_history: 0, + }, + document: DriveVerifyDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + verify_start_at_document_in_proof: 0, + }, + identity: DriveVerifyIdentityMethodVersions { + verify_full_identities_by_public_key_hashes: 0, + verify_full_identity_by_identity_id: 0, + verify_full_identity_by_public_key_hash: 0, + verify_identity_balance_for_identity_id: 0, + verify_identity_balances_for_identity_ids: 0, + verify_identity_id_by_public_key_hash: 0, + verify_identity_ids_by_public_key_hashes: 0, + verify_identity_keys_by_identity_id: 0, + verify_identity_nonce: 0, + verify_identity_contract_nonce: 0, + verify_identities_contract_keys: 0, + verify_identity_revision_for_identity_id: 0, + }, + single_document: DriveVerifySingleDocumentMethodVersions { + verify_proof: 0, + verify_proof_keep_serialized: 0, + }, + system: DriveVerifySystemMethodVersions { + verify_epoch_infos: 0, + verify_epoch_proposers: 0, + verify_elements: 0, + verify_total_credits_in_system: 0, + verify_upgrade_state: 0, + verify_upgrade_vote_status: 0, + }, + voting: DriveVerifyVoteMethodVersions { + verify_masternode_vote: 0, + verify_start_at_contender_in_proof: 0, + verify_vote_poll_votes_proof: 0, + verify_identity_votes_given_proof: 0, + verify_vote_poll_vote_state_proof: 0, + verify_contests_proof: 0, + verify_vote_polls_by_end_date_proof: 0, + verify_specialized_balance: 0, + }, + state_transition: DriveVerifyStateTransitionMethodVersions { + verify_state_transition_was_executed_with_proof: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs new file mode 100644 index 0000000000..825b062905 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/mod.rs @@ -0,0 +1,56 @@ +use versioned_feature_core::FeatureVersion; + +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteMethodVersions { + pub insert: DriveVoteInsertMethodVersions, + pub contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions, + pub cleanup: DriveVoteCleanupMethodVersions, + pub setup: DriveVoteSetupMethodVersions, + pub storage_form: DriveVoteStorageFormMethodVersions, + pub fetch: DriveVoteFetchMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteFetchMethodVersions { + pub fetch_identities_voting_for_contenders: FeatureVersion, + pub fetch_contested_document_vote_poll_stored_info: FeatureVersion, + pub fetch_identity_contested_resource_vote: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteStorageFormMethodVersions { + pub resolve_with_contract: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteSetupMethodVersions { + pub add_initial_vote_tree_main_structure_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteCleanupMethodVersions { + pub remove_specific_vote_references_given_by_identity: FeatureVersion, + pub remove_specific_votes_given_by_identity: FeatureVersion, + pub remove_contested_resource_vote_poll_end_date_query_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_votes_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_documents_operations: FeatureVersion, + pub remove_contested_resource_vote_poll_contenders_operations: FeatureVersion, + pub remove_contested_resource_top_level_index_operations: FeatureVersion, + pub remove_contested_resource_info_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteInsertMethodVersions { + pub register_identity_vote: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveVoteContestedResourceInsertMethodVersions { + pub register_contested_resource_identity_vote: FeatureVersion, + pub insert_stored_info_for_contested_resource_vote_poll: FeatureVersion, + pub register_identity_vote: FeatureVersion, + pub add_vote_poll_end_date_query_operations: FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs new file mode 100644 index 0000000000..1e7a59dd95 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v1.rs @@ -0,0 +1,38 @@ +use crate::version::drive_versions::drive_vote_method_versions::{ + DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, + DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, + DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, +}; + +pub const DRIVE_VOTE_METHOD_VERSIONS_V1: DriveVoteMethodVersions = DriveVoteMethodVersions { + insert: DriveVoteInsertMethodVersions { + register_identity_vote: 0, + }, + contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { + register_contested_resource_identity_vote: 0, + insert_stored_info_for_contested_resource_vote_poll: 0, + register_identity_vote: 0, + add_vote_poll_end_date_query_operations: 0, + }, + cleanup: DriveVoteCleanupMethodVersions { + remove_specific_vote_references_given_by_identity: 0, + remove_specific_votes_given_by_identity: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 0, + remove_contested_resource_vote_poll_votes_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 0, + remove_contested_resource_vote_poll_contenders_operations: 0, + remove_contested_resource_top_level_index_operations: 0, + remove_contested_resource_info_operations: 0, + }, + setup: DriveVoteSetupMethodVersions { + add_initial_vote_tree_main_structure_operations: 0, + }, + storage_form: DriveVoteStorageFormMethodVersions { + resolve_with_contract: 0, + }, + fetch: DriveVoteFetchMethodVersions { + fetch_identities_voting_for_contenders: 0, + fetch_contested_document_vote_poll_stored_info: 0, + fetch_identity_contested_resource_vote: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs new file mode 100644 index 0000000000..ef99612f58 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/drive_vote_method_versions/v2.rs @@ -0,0 +1,38 @@ +use crate::version::drive_versions::drive_vote_method_versions::{ + DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, + DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, + DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, +}; + +pub const DRIVE_VOTE_METHOD_VERSIONS_V2: DriveVoteMethodVersions = DriveVoteMethodVersions { + insert: DriveVoteInsertMethodVersions { + register_identity_vote: 0, + }, + contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { + register_contested_resource_identity_vote: 0, + insert_stored_info_for_contested_resource_vote_poll: 0, + register_identity_vote: 0, + add_vote_poll_end_date_query_operations: 0, + }, + cleanup: DriveVoteCleanupMethodVersions { + remove_specific_vote_references_given_by_identity: 0, + remove_specific_votes_given_by_identity: 0, + remove_contested_resource_vote_poll_end_date_query_operations: 1, + remove_contested_resource_vote_poll_votes_operations: 0, + remove_contested_resource_vote_poll_documents_operations: 1, + remove_contested_resource_vote_poll_contenders_operations: 1, + remove_contested_resource_top_level_index_operations: 0, + remove_contested_resource_info_operations: 0, + }, + setup: DriveVoteSetupMethodVersions { + add_initial_vote_tree_main_structure_operations: 0, + }, + storage_form: DriveVoteStorageFormMethodVersions { + resolve_with_contract: 0, + }, + fetch: DriveVoteFetchMethodVersions { + fetch_identities_voting_for_contenders: 0, + fetch_contested_document_vote_poll_stored_info: 0, + fetch_identity_contested_resource_vote: 0, + }, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/mod.rs new file mode 100644 index 0000000000..b8c3fae487 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/mod.rs @@ -0,0 +1,161 @@ +use crate::version::FeatureVersion; +use drive_contract_method_versions::DriveContractMethodVersions; +use drive_credit_pool_method_versions::DriveCreditPoolMethodVersions; +use drive_document_method_versions::DriveDocumentMethodVersions; +use drive_grove_method_versions::DriveGroveMethodVersions; +use drive_identity_method_versions::DriveIdentityMethodVersions; +use drive_state_transition_method_versions::DriveStateTransitionMethodVersions; +use drive_structure_version::DriveStructureVersion; +use drive_verify_method_versions::DriveVerifyMethodVersions; +use drive_vote_method_versions::DriveVoteMethodVersions; +use grovedb_version::version::GroveVersion; + +pub mod drive_contract_method_versions; +pub mod drive_credit_pool_method_versions; +pub mod drive_document_method_versions; +pub mod drive_grove_method_versions; +pub mod drive_identity_method_versions; +pub mod drive_state_transition_method_versions; +pub mod drive_structure_version; +pub mod drive_verify_method_versions; +pub mod drive_vote_method_versions; +pub mod v1; +pub mod v2; + +#[derive(Clone, Debug, Default)] +pub struct DriveVersion { + pub structure: DriveStructureVersion, + pub methods: DriveMethodVersions, + pub grove_methods: DriveGroveMethodVersions, + pub grove_version: GroveVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveMethodVersions { + pub initialization: DriveInitializationMethodVersions, + pub credit_pools: DriveCreditPoolMethodVersions, + pub protocol_upgrade: DriveProtocolUpgradeVersions, + pub prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions, + pub balances: DriveBalancesMethodVersions, + pub document: DriveDocumentMethodVersions, + pub vote: DriveVoteMethodVersions, + pub contract: DriveContractMethodVersions, + pub fees: DriveFeesMethodVersions, + pub estimated_costs: DriveEstimatedCostsMethodVersions, + pub asset_lock: DriveAssetLockMethodVersions, + pub verify: DriveVerifyMethodVersions, + pub identity: DriveIdentityMethodVersions, + pub platform_system: DrivePlatformSystemMethodVersions, + pub operations: DriveOperationsMethodVersion, + pub batch_operations: DriveBatchOperationsMethodVersion, + pub fetch: DriveFetchMethodVersions, + pub prove: DriveProveMethodVersions, + pub state_transitions: DriveStateTransitionMethodVersions, + pub platform_state: DrivePlatformStateMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePlatformStateMethodVersions { + pub fetch_platform_state_bytes: FeatureVersion, + pub store_platform_state_bytes: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveDataContractOperationMethodVersions { + pub finalization_tasks: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveFetchMethodVersions { + pub fetch_elements: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveProveMethodVersions { + pub prove_elements: FeatureVersion, + pub prove_multiple_state_transition_results: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePrefundedSpecializedMethodVersions { + pub fetch_single: FeatureVersion, + pub prove_single: FeatureVersion, + pub add_prefunded_specialized_balance: FeatureVersion, + pub add_prefunded_specialized_balance_operations: FeatureVersion, + pub deduct_from_prefunded_specialized_balance: FeatureVersion, + pub deduct_from_prefunded_specialized_balance_operations: FeatureVersion, + pub estimated_cost_for_prefunded_specialized_balance_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveBalancesMethodVersions { + pub add_to_system_credits: FeatureVersion, + pub add_to_system_credits_operations: FeatureVersion, + pub remove_from_system_credits: FeatureVersion, + pub remove_from_system_credits_operations: FeatureVersion, + pub calculate_total_credits_balance: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveAssetLockMethodVersions { + pub add_asset_lock_outpoint: FeatureVersion, + pub add_estimation_costs_for_adding_asset_lock: FeatureVersion, + pub fetch_asset_lock_outpoint_info: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveFeesMethodVersions { + pub calculate_fee: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DrivePlatformSystemMethodVersions { + pub estimation_costs: DriveSystemEstimationCostsMethodVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveOperationsMethodVersion { + pub rollback_transaction: FeatureVersion, + pub drop_cache: FeatureVersion, + pub commit_transaction: FeatureVersion, + pub apply_partial_batch_low_level_drive_operations: FeatureVersion, + pub apply_partial_batch_grovedb_operations: FeatureVersion, + pub apply_batch_low_level_drive_operations: FeatureVersion, + pub apply_batch_grovedb_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveBatchOperationsMethodVersion { + pub convert_drive_operations_to_grove_operations: FeatureVersion, + pub apply_drive_operations: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveSystemEstimationCostsMethodVersions { + pub for_total_system_credits_update: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveInitializationMethodVersions { + pub create_initial_state_structure: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveProtocolUpgradeVersions { + pub clear_version_information: FeatureVersion, + pub fetch_versions_with_counter: FeatureVersion, + pub fetch_proved_versions_with_counter: FeatureVersion, + pub fetch_validator_version_votes: FeatureVersion, + pub fetch_proved_validator_version_votes: FeatureVersion, + pub remove_validators_proposed_app_versions: FeatureVersion, + pub update_validator_proposed_app_version: FeatureVersion, +} + +#[derive(Clone, Debug, Default)] +pub struct DriveEstimatedCostsMethodVersions { + pub add_estimation_costs_for_levels_up_to_contract: FeatureVersion, + pub add_estimation_costs_for_levels_up_to_contract_document_type_excluded: FeatureVersion, + pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract: FeatureVersion, + pub add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: + FeatureVersion, +} diff --git a/packages/rs-platform-version/src/version/drive_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/v1.rs new file mode 100644 index 0000000000..bbe1a12746 --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/v1.rs @@ -0,0 +1,100 @@ +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v1::DRIVE_VOTE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::{ + DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, + DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, +}; +use grovedb_version::version::v1::GROVE_V1; + +pub const DRIVE_VERSION_V1: DriveVersion = DriveVersion { + structure: DRIVE_STRUCTURE_V1, + methods: DriveMethodVersions { + initialization: DriveInitializationMethodVersions { + create_initial_state_structure: 0, + }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, + protocol_upgrade: DriveProtocolUpgradeVersions { + clear_version_information: 0, + fetch_versions_with_counter: 0, + fetch_proved_versions_with_counter: 0, + fetch_validator_version_votes: 0, + fetch_proved_validator_version_votes: 0, + remove_validators_proposed_app_versions: 0, + update_validator_proposed_app_version: 0, + }, + prove: DriveProveMethodVersions { + prove_elements: 0, + prove_multiple_state_transition_results: 0, + }, + balances: DriveBalancesMethodVersions { + add_to_system_credits: 0, + add_to_system_credits_operations: 0, + remove_from_system_credits: 0, + remove_from_system_credits_operations: 0, + calculate_total_credits_balance: 0, + }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V1, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, + fees: DriveFeesMethodVersions { calculate_fee: 0 }, + estimated_costs: DriveEstimatedCostsMethodVersions { + add_estimation_costs_for_levels_up_to_contract: 0, + add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, + }, + asset_lock: DriveAssetLockMethodVersions { + add_asset_lock_outpoint: 0, + add_estimation_costs_for_adding_asset_lock: 0, + fetch_asset_lock_outpoint_info: 0, + }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, + platform_system: DrivePlatformSystemMethodVersions { + estimation_costs: DriveSystemEstimationCostsMethodVersions { + for_total_system_credits_update: 0, + }, + }, + operations: DriveOperationsMethodVersion { + rollback_transaction: 0, + drop_cache: 0, + commit_transaction: 0, + apply_partial_batch_low_level_drive_operations: 0, + apply_partial_batch_grovedb_operations: 0, + apply_batch_low_level_drive_operations: 0, + apply_batch_grovedb_operations: 0, + }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, + batch_operations: DriveBatchOperationsMethodVersion { + convert_drive_operations_to_grove_operations: 0, + apply_drive_operations: 0, + }, + platform_state: DrivePlatformStateMethodVersions { + fetch_platform_state_bytes: 0, + store_platform_state_bytes: 0, + }, + fetch: DriveFetchMethodVersions { fetch_elements: 0 }, + prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { + fetch_single: 0, + prove_single: 0, + add_prefunded_specialized_balance: 0, + add_prefunded_specialized_balance_operations: 0, + deduct_from_prefunded_specialized_balance: 0, + deduct_from_prefunded_specialized_balance_operations: 0, + estimated_cost_for_prefunded_specialized_balance_update: 0, + }, + }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, + grove_version: GROVE_V1, +}; diff --git a/packages/rs-platform-version/src/version/drive_versions/v2.rs b/packages/rs-platform-version/src/version/drive_versions/v2.rs new file mode 100644 index 0000000000..5747bc732b --- /dev/null +++ b/packages/rs-platform-version/src/version/drive_versions/v2.rs @@ -0,0 +1,100 @@ +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v2::DRIVE_VOTE_METHOD_VERSIONS_V2; +use crate::version::drive_versions::{ + DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, + DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, +}; +use grovedb_version::version::v1::GROVE_V1; + +pub const DRIVE_VERSION_V2: DriveVersion = DriveVersion { + structure: DRIVE_STRUCTURE_V1, + methods: DriveMethodVersions { + initialization: DriveInitializationMethodVersions { + create_initial_state_structure: 0, + }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, + protocol_upgrade: DriveProtocolUpgradeVersions { + clear_version_information: 0, + fetch_versions_with_counter: 0, + fetch_proved_versions_with_counter: 0, + fetch_validator_version_votes: 0, + fetch_proved_validator_version_votes: 0, + remove_validators_proposed_app_versions: 0, + update_validator_proposed_app_version: 0, + }, + prove: DriveProveMethodVersions { + prove_elements: 0, + prove_multiple_state_transition_results: 0, + }, + balances: DriveBalancesMethodVersions { + add_to_system_credits: 0, + add_to_system_credits_operations: 0, + remove_from_system_credits: 0, + remove_from_system_credits_operations: 0, + calculate_total_credits_balance: 0, + }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V2, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, + fees: DriveFeesMethodVersions { calculate_fee: 0 }, + estimated_costs: DriveEstimatedCostsMethodVersions { + add_estimation_costs_for_levels_up_to_contract: 0, + add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, + add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, + }, + asset_lock: DriveAssetLockMethodVersions { + add_asset_lock_outpoint: 0, + add_estimation_costs_for_adding_asset_lock: 0, + fetch_asset_lock_outpoint_info: 0, + }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, + platform_system: DrivePlatformSystemMethodVersions { + estimation_costs: DriveSystemEstimationCostsMethodVersions { + for_total_system_credits_update: 0, + }, + }, + operations: DriveOperationsMethodVersion { + rollback_transaction: 0, + drop_cache: 0, + commit_transaction: 0, + apply_partial_batch_low_level_drive_operations: 0, + apply_partial_batch_grovedb_operations: 0, + apply_batch_low_level_drive_operations: 0, + apply_batch_grovedb_operations: 0, + }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, + batch_operations: DriveBatchOperationsMethodVersion { + convert_drive_operations_to_grove_operations: 0, + apply_drive_operations: 0, + }, + platform_state: DrivePlatformStateMethodVersions { + fetch_platform_state_bytes: 0, + store_platform_state_bytes: 0, + }, + fetch: DriveFetchMethodVersions { fetch_elements: 0 }, + prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { + fetch_single: 0, + prove_single: 0, + add_prefunded_specialized_balance: 0, + add_prefunded_specialized_balance_operations: 0, + deduct_from_prefunded_specialized_balance: 0, + deduct_from_prefunded_specialized_balance_operations: 0, + estimated_cost_for_prefunded_specialized_balance_update: 0, + }, + }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, + grove_version: GROVE_V1, +}; diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index 0edf2b425b..931ef19b97 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -1,154 +1,63 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::{ DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, }; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v1::DRIVE_ABCI_VALIDATION_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::drive_contract_method_versions::v1::DRIVE_CONTRACT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_document_method_versions::v1::DRIVE_DOCUMENT_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1; +use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1; +use crate::version::drive_versions::drive_vote_method_versions::v1::DRIVE_VOTE_METHOD_VERSIONS_V1; use crate::version::drive_versions::{ DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, + DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion, + DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions, + DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions, + DriveProveMethodVersions, DriveSystemEstimationCostsMethodVersions, DriveVersion, }; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::PlatformArchitectureVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::SystemLimits; use grovedb_version::version::v1::GROVE_V1; pub const TEST_PROTOCOL_VERSION_2: u32 = (1 << TEST_PROTOCOL_VERSION_SHIFT_BYTES) + 2; pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { protocol_version: TEST_PROTOCOL_VERSION_2, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, + structure: DRIVE_STRUCTURE_V1, methods: DriveMethodVersions { initialization: DriveInitializationMethodVersions { create_initial_state_structure: 0, }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, + credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1, protocol_upgrade: DriveProtocolUpgradeVersions { clear_version_information: 0, fetch_versions_with_counter: 0, @@ -169,123 +78,9 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { remove_from_system_credits_operations: 0, calculate_total_credits_balance: 0, }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 0, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 0, - remove_contested_resource_vote_poll_contenders_operations: 0, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, + document: DRIVE_DOCUMENT_METHOD_VERSIONS_V1, + vote: DRIVE_VOTE_METHOD_VERSIONS_V1, + contract: DRIVE_CONTRACT_METHOD_VERSIONS_V1, fees: DriveFeesMethodVersions { calculate_fee: 0 }, estimated_costs: DriveEstimatedCostsMethodVersions { add_estimation_costs_for_levels_up_to_contract: 0, @@ -298,191 +93,8 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { add_estimation_costs_for_adding_asset_lock: 0, fetch_asset_lock_outpoint_info: 0, }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, + verify: DRIVE_VERIFY_METHOD_VERSIONS_V1, + identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1, platform_system: DrivePlatformSystemMethodVersions { estimation_costs: DriveSystemEstimationCostsMethodVersions { for_total_system_credits_update: 0, @@ -501,35 +113,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { convert_drive_operations_to_grove_operations: 0, apply_drive_operations: 0, }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, + state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1, platform_state: DrivePlatformStateMethodVersions { fetch_platform_state_bytes: 0, store_platform_state_bytes: 0, @@ -545,321 +129,14 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { estimated_cost_for_prefunded_specialized_balance_update: 0, }, }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, + grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1, grove_version: GROVE_V1, }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 0, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V1, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, query: DriveAbciQueryVersions { max_returned_elements: 100, response_metadata: 0, @@ -1023,281 +300,26 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { }, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { epoch_core_reward_credits_for_distribution: 0, daily_withdrawal_limit: 0 }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, system_limits: SystemLimits { estimated_contract_max_serialized_size: 16384, max_field_value_size: 5000, - max_state_transition_size: 20000, + max_state_transition_size: 20000, // Is different in this test version, not sure if this was a mistake max_transitions_in_documents_batch: 1, withdrawal_transactions_per_block_limit: 4, retry_signing_expired_withdrawal_documents_per_block_limit: 1, diff --git a/packages/rs-platform-version/src/version/mocks/v3_test.rs b/packages/rs-platform-version/src/version/mocks/v3_test.rs index 07e3d37ecd..4c54dfbfef 100644 --- a/packages/rs-platform-version/src/version/mocks/v3_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v3_test.rs @@ -1,614 +1,49 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::{ + DriveAbciBlockEndMethodVersions, DriveAbciBlockFeeProcessingMethodVersions, + DriveAbciBlockStartMethodVersions, DriveAbciCoreBasedUpdatesMethodVersions, + DriveAbciCoreChainLockMethodVersionsAndConstants, DriveAbciCoreInstantSendLockMethodVersions, + DriveAbciEngineMethodVersions, DriveAbciEpochMethodVersions, + DriveAbciFeePoolInwardsDistributionMethodVersions, DriveAbciFeePoolOutwardsDistributionMethodVersions, DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, + DriveAbciStateTransitionProcessingMethodVersions, DriveAbciVotingMethodVersions, }; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v3::DRIVE_ABCI_VALIDATION_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v2::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::PlatformArchitectureVersion; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; pub const TEST_PROTOCOL_VERSION_3: u32 = (1 << TEST_PROTOCOL_VERSION_SHIFT_BYTES) + 3; pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { protocol_version: TEST_PROTOCOL_VERSION_3, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, methods: DriveAbciMethodVersions { engine: DriveAbciEngineMethodVersions { init_chain: 0, @@ -717,595 +152,28 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { store_platform_state: 0, }, }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(1), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 64, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V3, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, }, diff --git a/packages/rs-platform-version/src/version/mod.rs b/packages/rs-platform-version/src/version/mod.rs index 9ee6257751..489aa21cc4 100644 --- a/packages/rs-platform-version/src/version/mod.rs +++ b/packages/rs-platform-version/src/version/mod.rs @@ -3,15 +3,15 @@ use crate::version::v4::PROTOCOL_VERSION_4; pub use protocol_version::*; mod consensus_versions; -pub mod contracts; pub mod dpp_versions; pub mod drive_abci_versions; pub mod drive_versions; pub mod fee; -mod limits; #[cfg(feature = "mock-versions")] pub mod mocks; pub mod patches; +pub mod system_data_contract_versions; +mod system_limits; pub mod v1; pub mod v2; pub mod v3; diff --git a/packages/rs-platform-version/src/version/protocol_version.rs b/packages/rs-platform-version/src/version/protocol_version.rs index f3d4a1871d..dc408cc613 100644 --- a/packages/rs-platform-version/src/version/protocol_version.rs +++ b/packages/rs-platform-version/src/version/protocol_version.rs @@ -1,5 +1,4 @@ use crate::error::PlatformVersionError; -use crate::version::contracts::SystemDataContractVersions; use crate::version::dpp_versions::DPPVersion; use crate::version::drive_abci_versions::DriveAbciVersion; use crate::version::drive_versions::DriveVersion; @@ -10,34 +9,27 @@ use crate::version::mocks::v2_test::TEST_PLATFORM_V2; use crate::version::mocks::v3_test::TEST_PLATFORM_V3; #[cfg(feature = "mock-versions")] use crate::version::mocks::TEST_PROTOCOL_VERSION_SHIFT_BYTES; +use crate::version::system_data_contract_versions::SystemDataContractVersions; use crate::version::v1::PLATFORM_V1; #[cfg(feature = "mock-versions")] use std::sync::OnceLock; use crate::version::consensus_versions::ConsensusVersions; -use crate::version::limits::SystemLimits; +use crate::version::system_limits::SystemLimits; use crate::version::v2::PLATFORM_V2; use crate::version::v3::PLATFORM_V3; use crate::version::v4::PLATFORM_V4; use crate::version::ProtocolVersion; pub use versioned_feature_core::*; -#[derive(Clone, Debug, Default)] -pub struct PlatformArchitectureVersion { - pub data_contract_factory_structure_version: FeatureVersion, - pub document_factory_structure_version: FeatureVersion, -} - #[derive(Clone, Debug)] pub struct PlatformVersion { pub protocol_version: ProtocolVersion, - pub proofs: FeatureVersionBounds, pub dpp: DPPVersion, pub drive: DriveVersion, pub drive_abci: DriveAbciVersion, pub consensus: ConsensusVersions, pub fee_version: FeeVersion, - pub platform_architecture: PlatformArchitectureVersion, pub system_data_contracts: SystemDataContractVersions, pub system_limits: SystemLimits, } diff --git a/packages/rs-platform-version/src/version/contracts.rs b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs similarity index 95% rename from packages/rs-platform-version/src/version/contracts.rs rename to packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs index 84c0d874b1..53af3b5ce0 100644 --- a/packages/rs-platform-version/src/version/contracts.rs +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs @@ -1,3 +1,5 @@ +pub mod v1; + use crate::version::FeatureVersion; #[derive(Clone, Debug, Default)] 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 new file mode 100644 index 0000000000..205d6fda2a --- /dev/null +++ b/packages/rs-platform-version/src/version/system_data_contract_versions/v1.rs @@ -0,0 +1,10 @@ +use crate::version::system_data_contract_versions::SystemDataContractVersions; + +pub const SYSTEM_DATA_CONTRACT_VERSIONS_V1: SystemDataContractVersions = + SystemDataContractVersions { + withdrawals: 1, + dpns: 1, + dashpay: 1, + masternode_reward_shares: 1, + feature_flags: 1, + }; diff --git a/packages/rs-platform-version/src/version/limits.rs b/packages/rs-platform-version/src/version/system_limits/mod.rs similarity index 96% rename from packages/rs-platform-version/src/version/limits.rs rename to packages/rs-platform-version/src/version/system_limits/mod.rs index 4d10e3810d..0dd2c5b922 100644 --- a/packages/rs-platform-version/src/version/limits.rs +++ b/packages/rs-platform-version/src/version/system_limits/mod.rs @@ -1,3 +1,5 @@ +pub mod v1; + #[derive(Clone, Debug, Default)] pub struct SystemLimits { pub estimated_contract_max_serialized_size: u16, diff --git a/packages/rs-platform-version/src/version/system_limits/v1.rs b/packages/rs-platform-version/src/version/system_limits/v1.rs new file mode 100644 index 0000000000..6dacce0b35 --- /dev/null +++ b/packages/rs-platform-version/src/version/system_limits/v1.rs @@ -0,0 +1,11 @@ +use crate::version::system_limits::SystemLimits; + +pub const SYSTEM_LIMITS_V1: SystemLimits = SystemLimits { + estimated_contract_max_serialized_size: 16384, + max_field_value_size: 5120, //5 KiB + max_state_transition_size: 20480, //20 KiB + max_transitions_in_documents_batch: 1, + withdrawal_transactions_per_block_limit: 4, + retry_signing_expired_withdrawal_documents_per_block_limit: 1, + max_withdrawal_amount: 50_000_000_000_000, //500 Dash +}; diff --git a/packages/rs-platform-version/src/version/v1.rs b/packages/rs-platform-version/src/version/v1.rs index 8369d3a30f..f7803b32c5 100644 --- a/packages/rs-platform-version/src/version/v1.rs +++ b/packages/rs-platform-version/src/version/v1.rs @@ -1,1310 +1,61 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v1::DPP_VALIDATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_voting_versions::v1::VOTING_VERSION_V1; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v1::DRIVE_ABCI_VALIDATION_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v1::DRIVE_VERSION_V1; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_1: ProtocolVersion = 1; pub const PLATFORM_V1: PlatformVersion = PlatformVersion { protocol_version: 1, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 0, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 0, - remove_contested_resource_vote_poll_contenders_operations: 0, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V1, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 0, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V1, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 604_800_000, // 1 week in ms for v1 (changes in v2) - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, - }, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V1, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V1, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, + }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 0, }, diff --git a/packages/rs-platform-version/src/version/v2.rs b/packages/rs-platform-version/src/version/v2.rs index 2859bb744e..6e1ed40094 100644 --- a/packages/rs-platform-version/src/version/v2.rs +++ b/packages/rs-platform-version/src/version/v2.rs @@ -1,1310 +1,61 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v1::STATE_TRANSITION_CONVERSION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v1::STATE_TRANSITION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v1::VOTING_VERSION_V1; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v1::DRIVE_ABCI_METHOD_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v2::DRIVE_ABCI_VALIDATION_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_2: ProtocolVersion = 2; pub const PLATFORM_V2: PlatformVersion = PlatformVersion { protocol_version: 2, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 0, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 0, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 75, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V1, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V2, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 0, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 0, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 1_209_600_000, //2 weeks - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, - }, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V1, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V1, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V1, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, + }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 0, }, diff --git a/packages/rs-platform-version/src/version/v3.rs b/packages/rs-platform-version/src/version/v3.rs index 2c0660be1a..f3856bc1e6 100644 --- a/packages/rs-platform-version/src/version/v3.rs +++ b/packages/rs-platform-version/src/version/v3.rs @@ -1,87 +1,30 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v2::STATE_TRANSITION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v2::DRIVE_ABCI_METHOD_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v2::DRIVE_ABCI_VALIDATION_VERSIONS_V2; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v1::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_3: ProtocolVersion = 3; @@ -94,1225 +37,32 @@ pub const PROTOCOL_VERSION_3: ProtocolVersion = 3; pub const PLATFORM_V3: PlatformVersion = PlatformVersion { protocol_version: 3, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - // Update app version if changed as well - consensus_params_update: 1, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 0, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 0, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 1, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: None, - protocol_version_upgrade_percentage_needed: 67, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 0, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 0, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V2, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V2, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V1, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 1, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V2, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, }, diff --git a/packages/rs-platform-version/src/version/v4.rs b/packages/rs-platform-version/src/version/v4.rs index fd6429c6f6..d0b5894374 100644 --- a/packages/rs-platform-version/src/version/v4.rs +++ b/packages/rs-platform-version/src/version/v4.rs @@ -1,87 +1,30 @@ use crate::version::consensus_versions::ConsensusVersions; -use crate::version::contracts::SystemDataContractVersions; -use crate::version::dpp_versions::{ - AssetLockVersions, ContractVersions, CostVersions, DPPMethodVersions, DPPValidationVersions, - DPPVersion, DataContractMethodVersions, DataContractValidationVersions, - DocumentFeatureVersionBounds, DocumentMethodVersions, DocumentTransitionVersions, - DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, - DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, - DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, - IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, - JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, - RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, - StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, - VotingValidationVersions, VotingVersions, -}; -use crate::version::drive_abci_versions::{ - DriveAbciAssetLockValidationVersions, DriveAbciBlockEndMethodVersions, - DriveAbciBlockFeeProcessingMethodVersions, DriveAbciBlockStartMethodVersions, - DriveAbciCoreBasedUpdatesMethodVersions, DriveAbciCoreChainLockMethodVersionsAndConstants, - DriveAbciCoreInstantSendLockMethodVersions, - DriveAbciDocumentsStateTransitionValidationVersions, DriveAbciEngineMethodVersions, - DriveAbciEpochMethodVersions, DriveAbciFeePoolInwardsDistributionMethodVersions, - DriveAbciFeePoolOutwardsDistributionMethodVersions, - DriveAbciIdentityCreditWithdrawalMethodVersions, DriveAbciInitializationMethodVersions, - DriveAbciMasternodeIdentitiesUpdatesMethodVersions, DriveAbciMethodVersions, - DriveAbciPlatformStateStorageMethodVersions, DriveAbciProtocolUpgradeMethodVersions, - DriveAbciQueryDataContractVersions, DriveAbciQueryIdentityVersions, - DriveAbciQueryPrefundedSpecializedBalancesVersions, DriveAbciQuerySystemVersions, - DriveAbciQueryValidatorVersions, DriveAbciQueryVersions, DriveAbciQueryVotingVersions, - DriveAbciStateTransitionCommonValidationVersions, - DriveAbciStateTransitionProcessingMethodVersions, DriveAbciStateTransitionValidationVersion, - DriveAbciStateTransitionValidationVersions, DriveAbciStructureVersions, - DriveAbciValidationConstants, DriveAbciValidationDataTriggerAndBindingVersions, - DriveAbciValidationDataTriggerVersions, DriveAbciValidationVersions, DriveAbciVersion, - DriveAbciVotingMethodVersions, DriveAbciWithdrawalConstants, PenaltyAmounts, -}; -use crate::version::drive_versions::{ - DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion, - DriveContractApplyMethodVersions, DriveContractCostsMethodVersions, - DriveContractGetMethodVersions, DriveContractInsertMethodVersions, DriveContractMethodVersions, - DriveContractProveMethodVersions, DriveContractUpdateMethodVersions, - DriveCreditPoolEpochsMethodVersions, DriveCreditPoolMethodVersions, - DriveCreditPoolPendingEpochRefundsMethodVersions, - DriveCreditPoolStorageFeeDistributionPoolMethodVersions, - DriveCreditPoolUnpaidEpochMethodVersions, DriveDataContractOperationMethodVersions, - DriveDocumentDeleteMethodVersions, DriveDocumentEstimationCostsMethodVersions, - DriveDocumentIndexUniquenessMethodVersions, DriveDocumentInsertContestedMethodVersions, - DriveDocumentInsertMethodVersions, DriveDocumentMethodVersions, - DriveDocumentQueryMethodVersions, DriveDocumentUpdateMethodVersions, - DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions, - DriveGroveApplyMethodVersions, DriveGroveBasicMethodVersions, DriveGroveBatchMethodVersions, - DriveGroveCostMethodVersions, DriveGroveMethodVersions, - DriveIdentityContractInfoMethodVersions, DriveIdentityCostEstimationMethodVersions, - DriveIdentityFetchAttributesMethodVersions, DriveIdentityFetchFullIdentityMethodVersions, - DriveIdentityFetchMethodVersions, DriveIdentityFetchPartialIdentityMethodVersions, - DriveIdentityFetchPublicKeyHashesMethodVersions, DriveIdentityInsertMethodVersions, - DriveIdentityKeyHashesToIdentityInsertMethodVersions, DriveIdentityKeysFetchMethodVersions, - DriveIdentityKeysInsertMethodVersions, DriveIdentityKeysMethodVersions, - DriveIdentityKeysProveMethodVersions, DriveIdentityMethodVersions, - DriveIdentityProveMethodVersions, DriveIdentityUpdateMethodVersions, - DriveIdentityWithdrawalDocumentMethodVersions, DriveIdentityWithdrawalMethodVersions, - DriveIdentityWithdrawalTransactionIndexMethodVersions, - DriveIdentityWithdrawalTransactionMethodVersions, - DriveIdentityWithdrawalTransactionQueueMethodVersions, DriveInitializationMethodVersions, - DriveMethodVersions, DriveOperationsMethodVersion, DrivePlatformStateMethodVersions, - DrivePlatformSystemMethodVersions, DrivePrefundedSpecializedMethodVersions, - DriveProtocolUpgradeVersions, DriveProveMethodVersions, - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions, - DriveStateTransitionMethodVersions, DriveStateTransitionOperationMethodVersions, - DriveStructureVersion, DriveSystemEstimationCostsMethodVersions, - DriveVerifyContractMethodVersions, DriveVerifyDocumentMethodVersions, - DriveVerifyIdentityMethodVersions, DriveVerifyMethodVersions, - DriveVerifySingleDocumentMethodVersions, DriveVerifyStateTransitionMethodVersions, - DriveVerifySystemMethodVersions, DriveVerifyVoteMethodVersions, DriveVersion, - DriveVoteCleanupMethodVersions, DriveVoteContestedResourceInsertMethodVersions, - DriveVoteFetchMethodVersions, DriveVoteInsertMethodVersions, DriveVoteMethodVersions, - DriveVoteSetupMethodVersions, DriveVoteStorageFormMethodVersions, -}; +use crate::version::dpp_versions::dpp_asset_lock_versions::v1::DPP_ASSET_LOCK_VERSIONS_V1; +use crate::version::dpp_versions::dpp_contract_versions::v1::CONTRACT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_costs_versions::v1::DPP_COSTS_VERSIONS_V1; +use crate::version::dpp_versions::dpp_document_versions::v1::DOCUMENT_VERSIONS_V1; +use crate::version::dpp_versions::dpp_factory_versions::v1::DPP_FACTORY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_identity_versions::v1::IDENTITY_VERSIONS_V1; +use crate::version::dpp_versions::dpp_method_versions::v1::DPP_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_conversion_versions::v2::STATE_TRANSITION_CONVERSION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_state_transition_method_versions::v1::STATE_TRANSITION_METHOD_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_serialization_versions::v1::STATE_TRANSITION_SERIALIZATION_VERSIONS_V1; +use crate::version::dpp_versions::dpp_state_transition_versions::v2::STATE_TRANSITION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_validation_versions::v2::DPP_VALIDATION_VERSIONS_V2; +use crate::version::dpp_versions::dpp_voting_versions::v2::VOTING_VERSION_V2; +use crate::version::dpp_versions::DPPVersion; +use crate::version::drive_abci_versions::drive_abci_method_versions::v3::DRIVE_ABCI_METHOD_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_query_versions::v1::DRIVE_ABCI_QUERY_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_structure_versions::v1::DRIVE_ABCI_STRUCTURE_VERSIONS_V1; +use crate::version::drive_abci_versions::drive_abci_validation_versions::v3::DRIVE_ABCI_VALIDATION_VERSIONS_V3; +use crate::version::drive_abci_versions::drive_abci_withdrawal_constants::v2::DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2; +use crate::version::drive_abci_versions::DriveAbciVersion; +use crate::version::drive_versions::v2::DRIVE_VERSION_V2; use crate::version::fee::v1::FEE_VERSION1; -use crate::version::limits::SystemLimits; -use crate::version::protocol_version::{FeatureVersionBounds, PlatformVersion}; -use crate::version::{PlatformArchitectureVersion, ProtocolVersion}; -use grovedb_version::version::v1::GROVE_V1; +use crate::version::protocol_version::PlatformVersion; +use crate::version::system_data_contract_versions::v1::SYSTEM_DATA_CONTRACT_VERSIONS_V1; +use crate::version::system_limits::v1::SYSTEM_LIMITS_V1; +use crate::version::ProtocolVersion; pub const PROTOCOL_VERSION_4: ProtocolVersion = 4; @@ -89,1224 +32,32 @@ pub const PROTOCOL_VERSION_4: ProtocolVersion = 4; pub const PLATFORM_V4: PlatformVersion = PlatformVersion { protocol_version: PROTOCOL_VERSION_4, - proofs: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - drive: DriveVersion { - structure: DriveStructureVersion { - document_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_indexes: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - pools: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DriveMethodVersions { - initialization: DriveInitializationMethodVersions { - create_initial_state_structure: 0, - }, - credit_pools: DriveCreditPoolMethodVersions { - epochs: DriveCreditPoolEpochsMethodVersions { - get_epochs_infos: 0, - get_epochs_protocol_versions: 0, - prove_epochs_infos: 0, - get_epoch_fee_multiplier: 0, - get_epoch_processing_credits_for_distribution: 0, - get_epoch_storage_credits_for_distribution: 0, - get_epoch_total_credits_for_distribution: 0, - get_storage_credits_for_distribution_for_epochs_in_range: 0, - get_epoch_start_time: 0, - get_epoch_start_block_core_height: 0, - get_epoch_start_block_height: 0, - get_first_epoch_start_block_info_between_epochs: 0, - fetch_epoch_proposers: 0, - prove_epoch_proposers: 0, - get_epochs_proposer_block_count: 0, - add_update_pending_epoch_refunds_operations: 0, - is_epochs_proposers_tree_empty: 0, - }, - pending_epoch_refunds: DriveCreditPoolPendingEpochRefundsMethodVersions { - add_delete_pending_epoch_refunds_except_specified: 0, - fetch_and_add_pending_epoch_refunds_to_collection: 0, - fetch_pending_epoch_refunds: 0, - add_update_pending_epoch_refunds_operations: 0, - }, - storage_fee_distribution_pool: - DriveCreditPoolStorageFeeDistributionPoolMethodVersions { - get_storage_fees_from_distribution_pool: 0, - }, - unpaid_epoch: DriveCreditPoolUnpaidEpochMethodVersions { - get_unpaid_epoch_index: 0, - }, - }, - protocol_upgrade: DriveProtocolUpgradeVersions { - clear_version_information: 0, - fetch_versions_with_counter: 0, - fetch_proved_versions_with_counter: 0, - fetch_validator_version_votes: 0, - fetch_proved_validator_version_votes: 0, - remove_validators_proposed_app_versions: 0, - update_validator_proposed_app_version: 0, - }, - prove: DriveProveMethodVersions { - prove_elements: 0, - prove_multiple_state_transition_results: 0, - }, - balances: DriveBalancesMethodVersions { - add_to_system_credits: 0, - add_to_system_credits_operations: 0, - remove_from_system_credits: 0, - remove_from_system_credits_operations: 0, - calculate_total_credits_balance: 0, - }, - document: DriveDocumentMethodVersions { - query: DriveDocumentQueryMethodVersions { query_documents: 0, query_contested_documents: 0, query_contested_documents_vote_state: 0, query_documents_with_flags: 0 }, - delete: DriveDocumentDeleteMethodVersions { - add_estimation_costs_for_remove_document_to_primary_storage: 0, - delete_document_for_contract: 0, - delete_document_for_contract_id: 0, - delete_document_for_contract_apply_and_add_to_operations: 0, - remove_document_from_primary_storage: 0, - remove_reference_for_index_level_for_contract_operations: 0, - remove_indices_for_index_level_for_contract_operations: 0, - remove_indices_for_top_index_level_for_contract_operations: 0, - delete_document_for_contract_id_with_named_type_operations: 0, - delete_document_for_contract_with_named_type_operations: 0, - delete_document_for_contract_operations: 0, - }, - insert: DriveDocumentInsertMethodVersions { - add_document: 0, - add_document_for_contract: 0, - add_document_for_contract_apply_and_add_to_operations: 0, - add_document_for_contract_operations: 0, - add_document_to_primary_storage: 0, - add_indices_for_index_level_for_contract_operations: 0, - add_indices_for_top_index_level_for_contract_operations: 0, - add_reference_for_index_level_for_contract_operations: 0, - }, - insert_contested: DriveDocumentInsertContestedMethodVersions { - add_contested_document: 0, - add_contested_document_for_contract: 0, - add_contested_document_for_contract_apply_and_add_to_operations: 0, - add_contested_document_for_contract_operations: 0, - add_contested_document_to_primary_storage: 0, - add_contested_indices_for_contract_operations: 0, - add_contested_reference_and_vote_subtree_to_document_operations: 0, - add_contested_vote_subtree_for_non_identities_operations: 0, - }, - update: DriveDocumentUpdateMethodVersions { - add_update_multiple_documents_operations: 0, - update_document_for_contract: 0, - update_document_for_contract_apply_and_add_to_operations: 0, - update_document_for_contract_id: 0, - update_document_for_contract_operations: 0, - update_document_with_serialization_for_contract: 0, - update_serialized_document_for_contract: 0, - }, - estimation_costs: DriveDocumentEstimationCostsMethodVersions { - add_estimation_costs_for_add_document_to_primary_storage: 0, - add_estimation_costs_for_add_contested_document_to_primary_storage: 0, - stateless_delete_of_non_tree_for_costs: 0, - }, - index_uniqueness: DriveDocumentIndexUniquenessMethodVersions { - validate_document_uniqueness: 0, - validate_document_create_transition_action_uniqueness: 0, - validate_document_replace_transition_action_uniqueness: 0, - validate_document_transfer_transition_action_uniqueness: 0, - validate_document_purchase_transition_action_uniqueness: 0, - validate_document_update_price_transition_action_uniqueness: 0, - validate_uniqueness_of_data: 0, - }, - }, - vote: DriveVoteMethodVersions { - insert: DriveVoteInsertMethodVersions { - register_identity_vote: 0, - }, - contested_resource_insert: DriveVoteContestedResourceInsertMethodVersions { - register_contested_resource_identity_vote: 0, - insert_stored_info_for_contested_resource_vote_poll: 0, - register_identity_vote: 0, - add_vote_poll_end_date_query_operations: 0, - }, - cleanup: DriveVoteCleanupMethodVersions { - remove_specific_vote_references_given_by_identity: 0, - remove_specific_votes_given_by_identity: 0, - remove_contested_resource_vote_poll_end_date_query_operations: 1, - remove_contested_resource_vote_poll_votes_operations: 0, - remove_contested_resource_vote_poll_documents_operations: 1, - remove_contested_resource_vote_poll_contenders_operations: 1, - remove_contested_resource_top_level_index_operations: 0, - remove_contested_resource_info_operations: 0, - }, - setup: DriveVoteSetupMethodVersions { - add_initial_vote_tree_main_structure_operations: 0, - }, - storage_form: DriveVoteStorageFormMethodVersions { - resolve_with_contract: 0, - }, - fetch: DriveVoteFetchMethodVersions { - fetch_identities_voting_for_contenders: 0, - fetch_contested_document_vote_poll_stored_info: 0, - fetch_identity_contested_resource_vote: 0, - }, - }, - contract: DriveContractMethodVersions { - prove: DriveContractProveMethodVersions { - prove_contract: 0, - prove_contract_history: 0, - prove_contracts: 0, - }, - apply: DriveContractApplyMethodVersions { - apply_contract: 0, - apply_contract_with_serialization: 0, - }, - insert: DriveContractInsertMethodVersions { - add_contract_to_storage: 0, - insert_contract: 0, - }, - update: DriveContractUpdateMethodVersions { update_contract: 0 }, - costs: DriveContractCostsMethodVersions { - add_estimation_costs_for_contract_insertion: 0, - }, - get: DriveContractGetMethodVersions { - fetch_contract: 0, - fetch_contract_with_history: 0, - get_cached_contract_with_fetch_info: 0, - get_contract_with_fetch_info: 0, - get_contracts_with_fetch_info: 0, - }, - }, - fees: DriveFeesMethodVersions { calculate_fee: 0 }, - estimated_costs: DriveEstimatedCostsMethodVersions { - add_estimation_costs_for_levels_up_to_contract: 0, - add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0, - add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0, - }, - asset_lock: DriveAssetLockMethodVersions { - add_asset_lock_outpoint: 0, - add_estimation_costs_for_adding_asset_lock: 0, - fetch_asset_lock_outpoint_info: 0, - }, - verify: DriveVerifyMethodVersions { - contract: DriveVerifyContractMethodVersions { - verify_contract: 0, - verify_contract_history: 0, - }, - document: DriveVerifyDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - verify_start_at_document_in_proof: 0, - }, - identity: DriveVerifyIdentityMethodVersions { - verify_full_identities_by_public_key_hashes: 0, - verify_full_identity_by_identity_id: 0, - verify_full_identity_by_public_key_hash: 0, - verify_identity_balance_for_identity_id: 0, - verify_identity_balances_for_identity_ids: 0, - verify_identity_id_by_public_key_hash: 0, - verify_identity_ids_by_public_key_hashes: 0, - verify_identity_keys_by_identity_id: 0, - verify_identity_nonce: 0, - verify_identity_contract_nonce: 0, - verify_identities_contract_keys: 0, - verify_identity_revision_for_identity_id: 0, - }, - single_document: DriveVerifySingleDocumentMethodVersions { - verify_proof: 0, - verify_proof_keep_serialized: 0, - }, - system: DriveVerifySystemMethodVersions { - verify_epoch_infos: 0, - verify_epoch_proposers: 0, - verify_elements: 0, - verify_total_credits_in_system: 0, - verify_upgrade_state: 0, - verify_upgrade_vote_status: 0, - }, - voting: DriveVerifyVoteMethodVersions { - verify_masternode_vote: 0, - verify_start_at_contender_in_proof: 0, - verify_vote_poll_votes_proof: 0, - verify_identity_votes_given_proof: 0, - verify_vote_poll_vote_state_proof: 0, - verify_contests_proof: 0, - verify_vote_polls_by_end_date_proof: 0, - verify_specialized_balance: 0, - }, - state_transition: DriveVerifyStateTransitionMethodVersions { - verify_state_transition_was_executed_with_proof: 0, - }, - }, - identity: DriveIdentityMethodVersions { - fetch: DriveIdentityFetchMethodVersions { - public_key_hashes: DriveIdentityFetchPublicKeyHashesMethodVersions { - fetch_full_identities_by_unique_public_key_hashes: 0, - fetch_full_identity_by_unique_public_key_hash: 0, - fetch_identity_id_by_unique_public_key_hash: 0, - fetch_identity_ids_by_non_unique_public_key_hash: 0, - fetch_identity_ids_by_unique_public_key_hashes: 0, - fetch_serialized_full_identity_by_unique_public_key_hash: 0, - has_any_of_unique_public_key_hashes: 0, - has_non_unique_public_key_hash: 0, - has_non_unique_public_key_hash_already_for_identity: 0, - has_unique_public_key_hash: 0, - }, - attributes: DriveIdentityFetchAttributesMethodVersions { - revision: 0, - nonce: 0, - identity_contract_nonce: 0, - balance: 0, - balance_include_debt: 0, - negative_balance: 0, - }, - partial_identity: DriveIdentityFetchPartialIdentityMethodVersions { - fetch_identity_revision_with_keys: 0, - fetch_identity_balance_with_keys: 0, - fetch_identity_balance_with_keys_and_revision: 0, - fetch_identity_with_balance: 0, - fetch_identity_keys: 0, - }, - full_identity: DriveIdentityFetchFullIdentityMethodVersions { - fetch_full_identity: Some(0), - fetch_full_identities: Some(0), - }, - }, - prove: DriveIdentityProveMethodVersions { - full_identity: 0, - full_identities: 0, - identity_nonce: 0, - identity_contract_nonce: 0, - identities_contract_keys: 0, - prove_full_identities_by_unique_public_key_hashes: 0, - prove_full_identity_by_unique_public_key_hash: 0, - prove_identity_id_by_unique_public_key_hash: 0, - prove_identity_ids_by_unique_public_key_hashes: 0, - }, - keys: DriveIdentityKeysMethodVersions { - fetch: DriveIdentityKeysFetchMethodVersions { - fetch_all_current_identity_keys: 0, - fetch_all_identity_keys: 0, - fetch_identities_all_keys: 0, - fetch_identity_keys: 0, - fetch_identities_contract_keys: 0, - }, - prove: DriveIdentityKeysProveMethodVersions { - prove_identities_all_keys: 0, - prove_identity_keys: 0, - }, - insert: DriveIdentityKeysInsertMethodVersions { - create_key_tree_with_keys: 0, - create_new_identity_key_query_trees: 0, - insert_key_searchable_references: 0, - insert_key_to_storage: 0, - insert_new_non_unique_key: 0, - insert_new_unique_key: 0, - replace_key_in_storage: 0, - }, - insert_key_hash_identity_reference: - DriveIdentityKeyHashesToIdentityInsertMethodVersions { - add_estimation_costs_for_insert_non_unique_public_key_hash_reference: 0, - add_estimation_costs_for_insert_unique_public_key_hash_reference: 0, - insert_non_unique_public_key_hash_reference_to_identity: 0, - insert_reference_to_non_unique_key: 0, - insert_reference_to_unique_key: 0, - insert_unique_public_key_hash_reference_to_identity: 0, - }, - }, - update: DriveIdentityUpdateMethodVersions { - update_identity_revision: 0, - merge_identity_nonce: 0, - update_identity_negative_credit_operation: 0, - initialize_identity_revision: 0, - disable_identity_keys: 0, - re_enable_identity_keys: 0, - add_new_non_unique_keys_to_identity: 0, - add_new_unique_keys_to_identity: 0, - add_new_keys_to_identity: 0, - insert_identity_balance: 0, - initialize_negative_identity_balance: 0, - add_to_identity_balance: 0, - add_to_previous_balance: 0, - apply_balance_change_from_fee_to_identity: 0, - remove_from_identity_balance: 0, - refresh_identity_key_reference_operations: 0, - }, - insert: DriveIdentityInsertMethodVersions { - add_new_identity: 0, - }, - contract_info: DriveIdentityContractInfoMethodVersions { - add_potential_contract_info_for_contract_bounded_key: 0, - refresh_potential_contract_info_key_references: 0, - merge_identity_contract_nonce: 0, - }, - cost_estimation: DriveIdentityCostEstimationMethodVersions { - for_authentication_keys_security_level_in_key_reference_tree: 0, - for_balances: 0, - for_contract_info: 0, - for_contract_info_group: 0, - for_contract_info_group_keys: 0, - for_contract_info_group_key_purpose: 0, - for_keys_for_identity_id: 0, - for_negative_credit: 0, - for_purpose_in_key_reference_tree: 0, - for_root_key_reference_tree: 0, - for_update_revision: 0, - }, - withdrawals: DriveIdentityWithdrawalMethodVersions { - document: DriveIdentityWithdrawalDocumentMethodVersions { - fetch_oldest_withdrawal_documents_by_status: 0, - find_withdrawal_documents_by_status_and_transaction_indices: 0, - }, - transaction: DriveIdentityWithdrawalTransactionMethodVersions { - index: DriveIdentityWithdrawalTransactionIndexMethodVersions { - fetch_next_withdrawal_transaction_index: 0, - add_update_next_withdrawal_transaction_index_operation: 0, - }, - queue: DriveIdentityWithdrawalTransactionQueueMethodVersions { - add_enqueue_untied_withdrawal_transaction_operations: 0, - dequeue_untied_withdrawal_transactions: 0, - remove_broadcasted_withdrawal_transactions_after_completion_operations: 0, - move_broadcasted_withdrawal_transactions_back_to_queue_operations: 0, - }, - }, - calculate_current_withdrawal_limit: 0, - }, - }, - platform_system: DrivePlatformSystemMethodVersions { - estimation_costs: DriveSystemEstimationCostsMethodVersions { - for_total_system_credits_update: 0, - }, - }, - operations: DriveOperationsMethodVersion { - rollback_transaction: 0, - drop_cache: 0, - commit_transaction: 0, - apply_partial_batch_low_level_drive_operations: 0, - apply_partial_batch_grovedb_operations: 0, - apply_batch_low_level_drive_operations: 0, - apply_batch_grovedb_operations: 0, - }, - state_transitions: DriveStateTransitionMethodVersions { - operations: DriveStateTransitionOperationMethodVersions { - finalization_tasks: 0, - contracts: DriveDataContractOperationMethodVersions { - finalization_tasks: 0, - }, - }, - convert_to_high_level_operations: - DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions { - data_contract_create_transition: 0, - data_contract_update_transition: 0, - document_create_transition: 0, - document_delete_transition: 0, - document_purchase_transition: 0, - document_replace_transition: 0, - document_transfer_transition: 0, - document_update_price_transition: 0, - documents_batch_transition: 0, - identity_create_transition: 0, - identity_credit_transfer_transition: 0, - identity_credit_withdrawal_transition: 0, - identity_top_up_transition: 0, - identity_update_transition: 0, - masternode_vote_transition: 0, - bump_identity_data_contract_nonce: 0, - bump_identity_nonce: 0, - partially_use_asset_lock: 0, - }, - }, - batch_operations: DriveBatchOperationsMethodVersion { - convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, - }, - platform_state: DrivePlatformStateMethodVersions { - fetch_platform_state_bytes: 0, - store_platform_state_bytes: 0, - }, - fetch: DriveFetchMethodVersions { fetch_elements: 0 }, - prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions { - fetch_single: 0, - prove_single: 0, - add_prefunded_specialized_balance: 0, - add_prefunded_specialized_balance_operations: 0, - deduct_from_prefunded_specialized_balance: 0, - deduct_from_prefunded_specialized_balance_operations: 0, - estimated_cost_for_prefunded_specialized_balance_update: 0, - }, - }, - grove_methods: DriveGroveMethodVersions { - basic: DriveGroveBasicMethodVersions { - grove_insert: 0, - grove_insert_empty_tree: 0, - grove_insert_empty_sum_tree: 0, - grove_insert_if_not_exists: 0, - grove_insert_if_not_exists_return_existing_element: 0, - grove_clear: 0, - grove_delete: 0, - grove_get_raw: 0, - grove_get_raw_optional: 0, - grove_get_raw_value_u64_from_encoded_var_vec: 0, - grove_get: 0, - grove_get_path_query_serialized_results: 0, - grove_get_path_query_serialized_or_sum_results: 0, - grove_get_path_query: 0, - grove_get_path_query_with_optional: 0, - grove_get_raw_path_query_with_optional: 0, - grove_get_raw_path_query: 0, - grove_get_proved_path_query: 0, - grove_get_proved_path_query_with_conditional: 0, - grove_get_sum_tree_total_value: 0, - grove_has_raw: 0, - }, - batch: DriveGroveBatchMethodVersions { - batch_insert_empty_tree: 0, - batch_insert_empty_tree_if_not_exists: 0, - batch_insert_empty_tree_if_not_exists_check_existing_operations: 0, - batch_insert_sum_item_or_add_to_if_already_exists: 0, - batch_insert: 0, - batch_insert_if_not_exists: 0, - batch_insert_if_changed_value: 0, - batch_replace: 0, - batch_delete: 0, - batch_delete_items_in_path_query: 0, - batch_move_items_in_path_query: 0, - batch_remove_raw: 0, - batch_delete_up_tree_while_empty: 0, - batch_refresh_reference: 0, - }, - apply: DriveGroveApplyMethodVersions { - grove_apply_operation: 0, - grove_apply_batch: 0, - grove_apply_partial_batch: 0, - }, - costs: DriveGroveCostMethodVersions { - grove_batch_operations_costs: 0, - }, - }, - grove_version: GROVE_V1, - }, - platform_architecture: PlatformArchitectureVersion { - data_contract_factory_structure_version: 0, - document_factory_structure_version: 0, - }, + drive: DRIVE_VERSION_V2, drive_abci: DriveAbciVersion { - structs: DriveAbciStructureVersions { - platform_state_structure: 0, - platform_state_for_saving_structure_default: 0, - state_transition_execution_context: 0, - commit: 0, - masternode: 0, - signature_verification_quorum_set: 0, - }, - methods: DriveAbciMethodVersions { - engine: DriveAbciEngineMethodVersions { - init_chain: 0, - check_tx: 0, - run_block_proposal: 0, - finalize_block_proposal: 0, - consensus_params_update: 1, - }, - initialization: DriveAbciInitializationMethodVersions { - initial_core_height_and_time: 0, - create_genesis_state: 0, - }, - core_based_updates: DriveAbciCoreBasedUpdatesMethodVersions { - update_core_info: 0, - update_masternode_list: 0, - update_quorum_info: 0, - masternode_updates: DriveAbciMasternodeIdentitiesUpdatesMethodVersions { - get_voter_identity_key: 0, - get_operator_identity_keys: 0, - get_owner_identity_withdrawal_key: 0, - get_owner_identity_owner_key: 0, - get_voter_identifier_from_masternode_list_item: 0, - get_operator_identifier_from_masternode_list_item: 0, - create_operator_identity: 0, - create_owner_identity: 1, - create_voter_identity: 0, - disable_identity_keys: 0, - update_masternode_identities: 0, - update_operator_identity: 0, - update_owner_withdrawal_address: 1, - update_voter_identity: 0, - }, - }, - protocol_upgrade: DriveAbciProtocolUpgradeMethodVersions { - check_for_desired_protocol_upgrade: 1, - upgrade_protocol_version_on_epoch_change: 0, - perform_events_on_first_block_of_protocol_change: Some(0), - protocol_version_upgrade_percentage_needed: 67, - }, - block_fee_processing: DriveAbciBlockFeeProcessingMethodVersions { - add_process_epoch_change_operations: 0, - process_block_fees: 0, - }, - core_chain_lock: DriveAbciCoreChainLockMethodVersionsAndConstants { - choose_quorum: 0, - verify_chain_lock: 0, - verify_chain_lock_locally: 0, - verify_chain_lock_through_core: 0, - make_sure_core_is_synced_to_chain_lock: 0, - recent_block_count_amount: 2, - }, - core_instant_send_lock: DriveAbciCoreInstantSendLockMethodVersions { - verify_recent_signature_locally: 0, - }, - fee_pool_inwards_distribution: DriveAbciFeePoolInwardsDistributionMethodVersions { - add_distribute_block_fees_into_pools_operations: 0, - add_distribute_storage_fee_to_epochs_operations: 0, - }, - fee_pool_outwards_distribution: DriveAbciFeePoolOutwardsDistributionMethodVersions { - add_distribute_fees_from_oldest_unpaid_epoch_pool_to_proposers_operations: 0, - add_epoch_pool_to_proposers_payout_operations: 0, - find_oldest_epoch_needing_payment: 0, - fetch_reward_shares_list_for_masternode: 0, - }, - withdrawals: DriveAbciIdentityCreditWithdrawalMethodVersions { - build_untied_withdrawal_transactions_from_documents: 0, - dequeue_and_build_unsigned_withdrawal_transactions: 0, - fetch_transactions_block_inclusion_status: 0, - pool_withdrawals_into_transactions_queue: 0, - update_broadcasted_withdrawal_statuses: 0, - rebroadcast_expired_withdrawal_documents: 0, - append_signatures_and_broadcast_withdrawal_transactions: 0, - cleanup_expired_locks_of_withdrawal_amounts: 0, - }, - voting: DriveAbciVotingMethodVersions { - keep_record_of_finished_contested_resource_vote_poll: 0, - clean_up_after_vote_poll_end: 0, - clean_up_after_contested_resources_vote_poll_end: 0, - check_for_ended_vote_polls: 0, - tally_votes_for_contested_document_resource_vote_poll: 0, - award_document_to_winner: 0, - delay_vote_poll: 0, - run_dao_platform_events: 0, - remove_votes_for_removed_masternodes: 0, - }, - state_transition_processing: DriveAbciStateTransitionProcessingMethodVersions { - execute_event: 0, - process_raw_state_transitions: 0, - decode_raw_state_transitions: 0, - validate_fees_of_event: 0, - }, - epoch: DriveAbciEpochMethodVersions { - gather_epoch_info: 0, - get_genesis_time: 0, - }, - block_start: DriveAbciBlockStartMethodVersions { - clear_drive_block_cache: 0, - }, - block_end: DriveAbciBlockEndMethodVersions { - update_state_cache: 0, - update_drive_cache: 0, - validator_set_update: 1, - }, - platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { - fetch_platform_state: 0, - store_platform_state: 0, - }, - }, - validation_and_processing: DriveAbciValidationVersions { - state_transitions: DriveAbciStateTransitionValidationVersions { - common_validation_methods: DriveAbciStateTransitionCommonValidationVersions { - asset_locks: DriveAbciAssetLockValidationVersions { - fetch_asset_lock_transaction_output_sync: 0, - verify_asset_lock_is_not_spent_and_has_enough_balance: 0, - }, - validate_identity_public_key_contract_bounds: 0, - validate_identity_public_key_ids_dont_exist_in_state: 0, - validate_identity_public_key_ids_exist_in_state: 0, - validate_state_transition_identity_signed: 0, - validate_unique_identity_public_key_hashes_in_state: 0, - validate_master_key_uniqueness: 0, - validate_simple_pre_check_balance: 0, - }, - max_asset_lock_usage_attempts: 16, - identity_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: Some(0), - identity_signatures: Some(0), - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_top_up_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: None, - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(1), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - identity_credit_withdrawal_state_transition_purpose_matches_requirements: 0, - identity_credit_transfer_state_transition: - DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - masternode_vote_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: Some(0), - identity_signatures: None, - advanced_minimum_balance_pre_check: Some(0), - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_create_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: Some(0), - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - contract_update_state_transition: DriveAbciStateTransitionValidationVersion { - basic_structure: None, - advanced_structure: None, - identity_signatures: None, - advanced_minimum_balance_pre_check: None, - nonce: Some(0), - state: 0, - transform_into_action: 0, - }, - documents_batch_state_transition: - DriveAbciDocumentsStateTransitionValidationVersions { - balance_pre_check: 0, - basic_structure: 0, - advanced_structure: 0, - state: 0, - revision: 0, - transform_into_action: 0, - data_triggers: DriveAbciValidationDataTriggerAndBindingVersions { - bindings: 0, - triggers: DriveAbciValidationDataTriggerVersions { - create_contact_request_data_trigger: 0, - create_domain_data_trigger: 0, - create_identity_data_trigger: 0, - create_feature_flag_data_trigger: 0, - create_masternode_reward_shares_data_trigger: 0, - delete_withdrawal_data_trigger: 0, - reject_data_trigger: 0, - }, - }, - is_allowed: 0, - document_create_transition_structure_validation: 0, - document_delete_transition_structure_validation: 0, - document_replace_transition_structure_validation: 0, - document_transfer_transition_structure_validation: 0, - document_purchase_transition_structure_validation: 0, - document_update_price_transition_structure_validation: 0, - document_create_transition_state_validation: 1, - document_delete_transition_state_validation: 0, - document_replace_transition_state_validation: 0, - document_transfer_transition_state_validation: 0, - document_purchase_transition_state_validation: 0, - document_update_price_transition_state_validation: 0, - }, - }, - process_state_transition: 0, - state_transition_to_execution_event_for_check_tx: 0, - penalties: PenaltyAmounts { - identity_id_not_correct: 50000000, - unique_key_already_present: 10000000, - validation_of_added_keys_structure_failure: 10000000, - validation_of_added_keys_proof_of_possession_failure: 50000000, - }, - event_constants: DriveAbciValidationConstants { - maximum_vote_polls_to_process: 2, - maximum_contenders_to_consider: 100, - }, - }, - withdrawal_constants: DriveAbciWithdrawalConstants { - core_expiration_blocks: 48, - cleanup_expired_locks_of_withdrawal_amounts_limit: 64, - }, - query: DriveAbciQueryVersions { - max_returned_elements: 100, - response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions { - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - identity_based_queries: DriveAbciQueryIdentityVersions { - identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_contract_keys: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_contract_nonce: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identities_balances: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - balance_and_revision: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_by_public_key_hash: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - validator_queries: DriveAbciQueryValidatorVersions { - proposed_block_counts_by_evonode_ids: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - proposed_block_counts_by_range: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - data_contract_based_queries: DriveAbciQueryDataContractVersions { - data_contract: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contract_history: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - data_contracts: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - voting_based_queries: DriveAbciQueryVotingVersions { - vote_polls_by_end_date_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_vote_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_voters_for_identity: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resource_identity_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contested_resources: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - system: DriveAbciQuerySystemVersions { - version_upgrade_state: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - version_upgrade_vote_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - epoch_infos: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - current_quorums_info: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - partial_status: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - path_elements: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - total_credits_in_platform: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, + structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V1, + methods: DRIVE_ABCI_METHOD_VERSIONS_V3, + validation_and_processing: DRIVE_ABCI_VALIDATION_VERSIONS_V3, + withdrawal_constants: DRIVE_ABCI_WITHDRAWAL_CONSTANTS_V2, + query: DRIVE_ABCI_QUERY_VERSIONS_V1, }, dpp: DPPVersion { - costs: CostVersions { - signature_verify: 0, - }, - validation: DPPValidationVersions { - json_schema_validator: JsonSchemaValidatorVersions { - new: 0, - validate: 0, - compile: 0, - compile_and_validate: 0, - }, - data_contract: DataContractValidationVersions { - validate: 0, - validate_config_update: 0, - validate_index_definitions: 0, - validate_index_naming_duplicates: 0, - validate_not_defined_properties: 0, - validate_property_definition: 0, - }, - document_type: DocumentTypeValidationVersions { - validate_update: 0, - contested_index_limit: 1, - unique_index_limit: 10, - }, - voting: VotingValidationVersions { - allow_other_contenders_time_mainnet_ms: 604_800_000, // 1 week in ms - allow_other_contenders_time_testing_ms: 2_700_000, //45 minutes - votes_allowed_per_masternode: 5, - }, - }, - state_transition_serialization_versions: StateTransitionSerializationVersions { - identity_public_key_in_creation: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_top_up_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_withdrawal_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - identity_credit_transfer_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - masternode_vote_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_create_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_update_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - documents_batch_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_base_state_transition: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_create_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_replace_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_delete_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_transfer_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_update_price_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - document_purchase_state_transition: DocumentFeatureVersionBounds { - bounds: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - }, - state_transition_conversion_versions: StateTransitionConversionVersions { - identity_to_identity_create_transition: 0, - identity_to_identity_top_up_transition: 0, - identity_to_identity_withdrawal_transition: 1, - identity_to_identity_create_transition_with_signer: 0, - }, - state_transition_method_versions: StateTransitionMethodVersions { - public_key_in_creation_methods: PublicKeyInCreationMethodVersions { - from_public_key_signed_with_private_key: 0, - from_public_key_signed_external: 0, - hash: 0, - duplicated_key_ids_witness: 0, - duplicated_keys_witness: 0, - validate_identity_public_keys_structure: 0, - }, - }, - state_transitions: StateTransitionVersions { - documents: DocumentTransitionVersions { - documents_batch_transition: DocumentsBatchTransitionVersions { - validation: DocumentsBatchTransitionValidationVersions { - find_duplicates_by_id: 0, - validate_base_structure: 0, - }, - }, - }, - identities: IdentityTransitionVersions { - max_public_keys_in_creation: 6, - asset_locks: IdentityTransitionAssetLockVersions { - required_asset_lock_duff_balance_for_processing_start_for_identity_create: - 200000, - required_asset_lock_duff_balance_for_processing_start_for_identity_top_up: - 50000, - validate_asset_lock_transaction_structure: 0, - validate_instant_asset_lock_proof_structure: 0, - }, - credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { - default_constructor: 1, - }, - }, - }, - contract_versions: ContractVersions { - max_serialized_size: 65000, - contract_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - contract_structure_version: 0, - created_data_contract_structure: 0, - config: 0, - methods: DataContractMethodVersions { - validate_document: 0, - validate_update: 0, - schema: 0, - }, - document_type_versions: DocumentTypeVersions { - index_versions: DocumentTypeIndexVersions { - index_levels_from_indices: 0, - }, - class_method_versions: DocumentTypeClassMethodVersions { - try_from_schema: 0, - create_document_types_from_document_schemas: 0, - }, - structure_version: 0, - schema: DocumentTypeSchemaVersions { - enrich_with_base_schema: 0, - find_identifier_and_binary_paths: 0, - validate_max_depth: 0, - max_depth: 256, - recursive_schema_validator_versions: RecursiveSchemaValidatorVersions { - traversal_validator: 0, - }, - validate_schema_compatibility: 0, - }, - methods: DocumentTypeMethodVersions { - create_document_from_data: 0, - create_document_with_prevalidated_properties: 0, - prefunded_voting_balance_for_document: 0, - contested_vote_poll_for_document: 0, - estimated_size: 0, - index_for_types: 0, - max_size: 0, - serialize_value_for_key: 0, - deserialize_value_for_key: 0, - }, - }, - }, - document_versions: DocumentVersions { - document_structure_version: 0, - document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_cbor_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - extended_document_structure_version: 0, - extended_document_serialization_version: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - document_method_versions: DocumentMethodVersions { - is_equal_ignoring_timestamps: 0, - hash: 0, - get_raw_for_contract: 0, - get_raw_for_document_type: 0, - try_into_asset_unlock_base_transaction_info: 0, - }, - }, - identity_versions: IdentityVersions { - identity_structure_version: 0, - identity_key_structure_version: 0, - identity_key_type_method_versions: IdentityKeyTypeMethodVersions { - random_public_key_data: 0, - random_public_and_private_key_data: 0, - }, - }, - voting_versions: VotingVersions { - default_vote_poll_time_duration_mainnet_ms: 1_209_600_000, //2 weeks - default_vote_poll_time_duration_test_network_ms: 5_400_000, //90 minutes - contested_document_vote_poll_stored_info_version: 0, - }, - asset_lock_versions: AssetLockVersions { - reduced_asset_lock_value: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, - }, - methods: DPPMethodVersions { - epoch_core_reward_credits_for_distribution: 0, - daily_withdrawal_limit: 0, - }, - }, - system_data_contracts: SystemDataContractVersions { - withdrawals: 1, - dpns: 1, - dashpay: 1, - masternode_reward_shares: 1, - feature_flags: 1, + costs: DPP_COSTS_VERSIONS_V1, + validation: DPP_VALIDATION_VERSIONS_V2, + state_transition_serialization_versions: STATE_TRANSITION_SERIALIZATION_VERSIONS_V1, + state_transition_conversion_versions: STATE_TRANSITION_CONVERSION_VERSIONS_V2, + state_transition_method_versions: STATE_TRANSITION_METHOD_VERSIONS_V1, + state_transitions: STATE_TRANSITION_VERSIONS_V2, + contract_versions: CONTRACT_VERSIONS_V1, + document_versions: DOCUMENT_VERSIONS_V1, + identity_versions: IDENTITY_VERSIONS_V1, + voting_versions: VOTING_VERSION_V2, + asset_lock_versions: DPP_ASSET_LOCK_VERSIONS_V1, + methods: DPP_METHOD_VERSIONS_V1, + factory_versions: DPP_FACTORY_VERSIONS_V1, }, + system_data_contracts: SYSTEM_DATA_CONTRACT_VERSIONS_V1, fee_version: FEE_VERSION1, - system_limits: SystemLimits { - estimated_contract_max_serialized_size: 16384, - max_field_value_size: 5120, //5 KiB - max_state_transition_size: 20480, //20 KiB - max_transitions_in_documents_batch: 1, - withdrawal_transactions_per_block_limit: 4, - retry_signing_expired_withdrawal_documents_per_block_limit: 1, - max_withdrawal_amount: 50_000_000_000_000, //500 Dash - }, + system_limits: SYSTEM_LIMITS_V1, consensus: ConsensusVersions { tenderdash_consensus_version: 1, },