Skip to main content

platform_version/version/drive_versions/
v8.rs

1use crate::version::drive_versions::drive_address_funds_method_versions::v2::DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V2;
2use crate::version::drive_versions::drive_contract_group_method_versions::v1::DRIVE_CONTRACT_GROUP_METHOD_VERSIONS_V1;
3use crate::version::drive_versions::drive_contract_method_versions::v3::DRIVE_CONTRACT_METHOD_VERSIONS_V3;
4use crate::version::drive_versions::drive_credit_pool_method_versions::v1::CREDIT_POOL_METHOD_VERSIONS_V1;
5use crate::version::drive_versions::drive_document_method_versions::v3::DRIVE_DOCUMENT_METHOD_VERSIONS_V3;
6use crate::version::drive_versions::drive_group_method_versions::v1::DRIVE_GROUP_METHOD_VERSIONS_V1;
7use crate::version::drive_versions::drive_group_method_versions::DriveShieldedMethodVersions;
8use crate::version::drive_versions::drive_grove_method_versions::v1::DRIVE_GROVE_METHOD_VERSIONS_V1;
9use crate::version::drive_versions::drive_identity_method_versions::v1::DRIVE_IDENTITY_METHOD_VERSIONS_V1;
10use crate::version::drive_versions::drive_state_transition_method_versions::v3::DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V3;
11use crate::version::drive_versions::drive_structure_version::v1::DRIVE_STRUCTURE_V1;
12use crate::version::drive_versions::drive_token_method_versions::v1::DRIVE_TOKEN_METHOD_VERSIONS_V1;
13use crate::version::drive_versions::drive_verify_method_versions::v2::DRIVE_VERIFY_METHOD_VERSIONS_V2;
14use crate::version::drive_versions::drive_vote_method_versions::v2::DRIVE_VOTE_METHOD_VERSIONS_V2;
15use crate::version::drive_versions::{
16    DriveAssetLockMethodVersions, DriveBalancesMethodVersions, DriveBatchOperationsMethodVersion,
17    DriveEstimatedCostsMethodVersions, DriveFeesMethodVersions, DriveFetchMethodVersions,
18    DriveInitializationMethodVersions, DriveMethodVersions, DriveOperationsMethodVersion,
19    DrivePlatformStateMethodVersions, DrivePlatformSystemMethodVersions,
20    DrivePrefundedSpecializedMethodVersions, DriveProtocolUpgradeVersions,
21    DriveProveMethodVersions, DriveSavedBlockTransactionsMethodVersions,
22    DriveSystemEstimationCostsMethodVersions, DriveVersion,
23};
24use grovedb_version::version::v3::GROVE_V3;
25
26/// Drive version 8.
27/// This was introduced in protocol v13 for DPNS username transfers and sales.
28pub const DRIVE_VERSION_V8: DriveVersion = DriveVersion {
29    structure: DRIVE_STRUCTURE_V1,
30    methods: DriveMethodVersions {
31        initialization: DriveInitializationMethodVersions {
32            create_initial_state_structure: 3, // changed: adds shielded pool trees (commitment tree, nullifiers, anchors)
33        },
34        credit_pools: CREDIT_POOL_METHOD_VERSIONS_V1,
35        protocol_upgrade: DriveProtocolUpgradeVersions {
36            clear_version_information: 0,
37            fetch_versions_with_counter: 0,
38            fetch_proved_versions_with_counter: 0,
39            fetch_validator_version_votes: 0,
40            fetch_proved_validator_version_votes: 0,
41            remove_validators_proposed_app_versions: 0,
42            update_validator_proposed_app_version: 0,
43        },
44        prove: DriveProveMethodVersions {
45            prove_elements: 0,
46            prove_multiple_state_transition_results: 0,
47            prove_state_transition: 0,
48        },
49        balances: DriveBalancesMethodVersions {
50            add_to_system_credits: 0,
51            add_to_system_credits_operations: 0,
52            remove_from_system_credits: 0,
53            remove_from_system_credits_operations: 0,
54            calculate_total_credits_balance: 2, // ShieldedBalances root tree adds a fifth term to the equation
55        },
56        document: DRIVE_DOCUMENT_METHOD_VERSIONS_V3,
57        vote: DRIVE_VOTE_METHOD_VERSIONS_V2,
58        contract: DRIVE_CONTRACT_METHOD_VERSIONS_V3, // changed: count-tree-aware contract-insertion cost estimation (v12+ countable/range_countable doctypes)
59        fees: DriveFeesMethodVersions { calculate_fee: 0 },
60        estimated_costs: DriveEstimatedCostsMethodVersions {
61            add_estimation_costs_for_levels_up_to_contract: 0,
62            add_estimation_costs_for_levels_up_to_contract_document_type_excluded: 0,
63            add_estimation_costs_for_contested_document_tree_levels_up_to_contract: 0,
64            add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded: 0,
65        },
66        asset_lock: DriveAssetLockMethodVersions {
67            add_asset_lock_outpoint: 0,
68            add_estimation_costs_for_adding_asset_lock: 0,
69            fetch_asset_lock_outpoint_info: 0,
70        },
71        verify: DRIVE_VERIFY_METHOD_VERSIONS_V2, // changed in v8: compacted address-balance proof envelope (verify v1)
72        identity: DRIVE_IDENTITY_METHOD_VERSIONS_V1,
73        token: DRIVE_TOKEN_METHOD_VERSIONS_V1,
74        platform_system: DrivePlatformSystemMethodVersions {
75            estimation_costs: DriveSystemEstimationCostsMethodVersions {
76                for_total_system_credits_update: 0,
77            },
78        },
79        operations: DriveOperationsMethodVersion {
80            rollback_transaction: 0,
81            drop_cache: 0,
82            commit_transaction: 0,
83            apply_partial_batch_low_level_drive_operations: 0,
84            apply_partial_batch_grovedb_operations: 0,
85            apply_batch_low_level_drive_operations: 0,
86            apply_batch_grovedb_operations: 0,
87        },
88        state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V3, // changed: DPNS domain records.identity rewrite on transfer/purchase
89        batch_operations: DriveBatchOperationsMethodVersion {
90            convert_drive_operations_to_grove_operations: 0,
91            apply_drive_operations: 0,
92        },
93        platform_state: DrivePlatformStateMethodVersions {
94            fetch_platform_state_bytes: 0,
95            store_platform_state_bytes: 0,
96            fetch_platform_state_recent_bytes: 0,
97            store_platform_state_recent_bytes: 0,
98            fetch_platform_state_entries_bytes: 0,
99            store_platform_state_entry_bytes: 0,
100            delete_platform_state_entry: 0,
101        },
102        fetch: DriveFetchMethodVersions { fetch_elements: 0 },
103        prefunded_specialized_balances: DrivePrefundedSpecializedMethodVersions {
104            fetch_single: 0,
105            prove_single: 0,
106            add_prefunded_specialized_balance: 0,
107            add_prefunded_specialized_balance_operations: 1,
108            deduct_from_prefunded_specialized_balance: 1,
109            deduct_from_prefunded_specialized_balance_operations: 0,
110            estimated_cost_for_prefunded_specialized_balance_update: 0,
111            empty_prefunded_specialized_balance: 0,
112        },
113        group: DRIVE_GROUP_METHOD_VERSIONS_V1,
114        contract_group: DRIVE_CONTRACT_GROUP_METHOD_VERSIONS_V1,
115        address_funds: DRIVE_ADDRESS_FUNDS_METHOD_VERSIONS_V2,
116        shielded: DriveShieldedMethodVersions {
117            insert_note: 0,
118            insert_nullifiers: 0,
119            update_total_balance: 0,
120            record_anchor_if_changed: 0,
121            prune_anchors: 0,
122            has_anchor: 0,
123            has_nullifier: 0,
124            read_total_balance: 0,
125            notes_count: 0,
126        },
127        saved_block_transactions: DriveSavedBlockTransactionsMethodVersions {
128            store_address_balances: 0,
129            fetch_address_balances: 0,
130            prove_compacted_address_balance_changes: 1,
131            compact_address_balances: 0,
132            cleanup_expired_address_balances: 0,
133            max_blocks_before_compaction: 64,
134            max_addresses_before_compaction: 2048,
135        },
136    },
137    grove_methods: DRIVE_GROVE_METHOD_VERSIONS_V1,
138    grove_version: GROVE_V3, // changed in v7: upgraded for shielded transaction support
139};