platform_version/version/drive_versions/
v5.rs

1use crate::version::drive_versions::drive_address_funds_method_versions::v1::DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V1;
2use crate::version::drive_versions::drive_contract_method_versions::v2::DRIVE_CONTRACT_METHOD_VERSIONS_V2;
3use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1;
4use crate::version::drive_versions::drive_document_method_versions::v2::DRIVE_DOCUMENT_METHOD_VERSIONS_V2;
5use crate::version::drive_versions::drive_group_method_versions::v1::DRIVE_GROUP_METHOD_VERSIONS_V1;
6use crate::version::drive_versions::drive_group_method_versions::DriveShieldedMethodVersions;
7use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1;
8use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1;
9use crate::version::drive_versions::drive_state_transition_method_versions::v1::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1;
10use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1;
11use crate::version::drive_versions::drive_token_method_versions::v1::DRIVE_TOKEN_METHOD_VERSIONS_V1;
12use crate::version::drive_versions::drive_verify_method_versions::v1::DRIVE_VERIFY_METHOD_VERSIONS_V1;
13use crate::version::drive_versions::drive_vote_method_versions::v2::DRIVE_VOTE_METHOD_VERSIONS_V2;
14use crate::version::drive_versions::{
15    DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion,
16    DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions,
17    DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion,
18    DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions,
19    DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions,
20    DriveProveMethodVersions, DriveSavedBlockTransactionsMethodVersions,
21    DriveSystemEstimationCostsMethodVersions, DriveVersion,
22};
23use grovedb_version::version::v2::GROVE_V2;
24
25/// This was introduced in protocol v10 to deal with changes in queries for document uniqueness
26/// during validation.
27pub const DRIVE_VERSION_V5: DriveVersion = DriveVersion {
28    structure: DRIVE_STRUCTURE_V1,
29    methods: DriveMethodVersions {
30        initialization: DriveInitializationMethodVersions {
31            create_initial_state_structure: 1,
32        },
33        credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1,
34        protocol_upgrade: DriveProtocolUpgradeVersions {
35            clear_version_information: 0,
36            fetch_versions_with_counter: 0,
37            fetch_proved_versions_with_counter: 0,
38            fetch_validator_version_votes: 0,
39            fetch_proved_validator_version_votes: 0,
40            remove_validators_proposed_app_versions: 0,
41            update_validator_proposed_app_version: 0,
42        },
43        prove: DriveProveMethodVersions {
44            prove_elements: 0,
45            prove_multiple_state_transition_results: 0,
46            prove_state_transition: 0,
47        },
48        balances: DriveBalancesMethodVersions {
49            add_to_system_credits: 0,
50            add_to_system_credits_operations: 0,
51            remove_from_system_credits: 0,
52            remove_from_system_credits_operations: 0,
53            calculate_total_credits_balance: 0,
54        },
55        document: DRIVE_DOCUMENT_METHOD_VERSIONS_V2, // Changed
56        vote: DRIVE_VOTE_METHOD_VERSIONS_V2,
57        contract: DRIVE_CONTRACT_METHOD_VERSIONS_V2,
58        fees: DriveFeesMethodVersions { calculate_fee: 0 },
59        estimated_costs: DriveEstimatedCostsMethodVersions {
60            add_estimation_costs_for_levels_up_to_contract: 0,
61            add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0,
62            add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0,
63            add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0,
64        },
65        asset_lock: DriveAssetLockMethodVersions {
66            add_asset_lock_outpoint: 0,
67            add_estimation_costs_for_adding_asset_lock: 0,
68            fetch_asset_lock_outpoint_info: 0,
69        },
70        verify: DRIVE_VERIFY_METHOD_VERSIONS_V1,
71        identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1,
72        token: DRIVE_TOKEN_METHOD_VERSIONS_V1,
73        platform_system: DrivePlatformSystemMethodVersions {
74            estimation_costs: DriveSystemEstimationCostsMethodVersions {
75                for_total_system_credits_update: 0,
76            },
77        },
78        operations: DriveOperationsMethodVersion {
79            rollback_transaction: 0,
80            drop_cache: 0,
81            commit_transaction: 0,
82            apply_partial_batch_low_level_drive_operations: 0,
83            apply_partial_batch_grovedb_operations: 0,
84            apply_batch_low_level_drive_operations: 0,
85            apply_batch_grovedb_operations: 0,
86        },
87        state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1,
88        batch_operations: DriveBatchOperationsMethodVersion {
89            convert_drive_operations_to_grove_operations: 0,
90            apply_drive_operations: 0,
91        },
92        platform_state: DrivePlatformStateMethodVersions {
93            fetch_platform_state_bytes: 0,
94            store_platform_state_bytes: 0,
95        },
96        fetch: DriveFetchMethodVersions { fetch_elements: 0 },
97        prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions {
98            fetch_single: 0,
99            prove_single: 0,
100            add_prefunded_specialized_balance: 0,
101            add_prefunded_specialized_balance_operations: 1,
102            deduct_from_prefunded_specialized_balance: 1,
103            deduct_from_prefunded_specialized_balance_operations: 0,
104            estimated_cost_for_prefunded_specialized_balance_update: 0,
105            empty_prefunded_specialized_balance: 0,
106        },
107        group: DRIVE_GROUP_METHOD_VERSIONS_V1,
108        address_funds: DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V1,
109        shielded: DriveShieldedMethodVersions {
110            insert_note: 0,
111            insert_nullifiers: 0,
112            update_total_balance: 0,
113            record_anchor_if_changed: 0,
114            prune_anchors: 0,
115            has_anchor: 0,
116            has_nullifier: 0,
117            read_total_balance: 0,
118            notes_count: 0,
119            prove_nullifiers_trunk_query: 0,
120            prove_nullifiers_branch_query: 0,
121            nullifiers_query_min_depth: 6,
122            nullifiers_query_max_depth: 10,
123        },
124        saved_block_transactions: DriveSavedBlockTransactionsMethodVersions {
125            store_address_balances: 0,
126            fetch_address_balances: 0,
127            compact_address_balances: 0,
128            cleanup_expired_address_balances: 0,
129            max_blocks_before_compaction: 64,
130            max_addresses_before_compaction: 2048,
131            store_nullifiers: 0,
132            fetch_nullifiers: 0,
133            compact_nullifiers: 0,
134            cleanup_expired_nullifier_compactions: 0,
135            max_blocks_before_nullifier_compaction: 64,
136            max_nullifiers_before_compaction: 2048,
137        },
138    },
139    grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1,
140    grove_version: GROVE_V2,
141};