-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(drive): increase withdrawal limits to 2000 Dash per day #2287
Changes from 34 commits
6392c6a
3d4db8d
a608e8b
7f68c1f
61f3ce7
0470a6f
865226d
95b1b75
c60ee3a
2fd7340
faf0978
9888a60
5ad9462
24177fa
99fe5fa
cee3098
0d3e091
e421514
3d941ec
4bc0a65
dc48827
cafda11
b86f4e0
b21b4f1
78ccacb
b3d68cf
a9a6539
c2b4cea
97e0a55
7172866
f8aece8
25beeda
4c7e883
af96c0e
34b67e7
de4e627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::fee::Credits; | ||
|
||
/// Set constant withdrawal daily limit to 2000 Dash | ||
/// | ||
/// # Returns | ||
/// | ||
/// * `Credits`: The calculated daily withdrawal limit based on the available credits. | ||
/// | ||
pub fn daily_withdrawal_limit_v1() -> Credits { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least make this a const fn |
||
// 2000 Dash | ||
200_000_000_000_000 | ||
} | ||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::version::dpp_versions::dpp_method_versions::DPPMethodVersions; | ||
pub const DPP_METHOD_VERSIONS_V2: DPPMethodVersions = DPPMethodVersions { | ||
epoch_core_reward_credits_for_distribution: 0, | ||
daily_withdrawal_limit: 1, | ||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::version::dpp_versions::dpp_method_versions::DPPMethodVersions; | ||
pub const DPP_METHOD_VERSIONS_V2: DPPMethodVersions = DPPMethodVersions { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. V2 or V3? |
||
epoch_core_reward_credits_for_distribution: 0, | ||
daily_withdrawal_limit: 1, | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why create a v3? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
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_V5: 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, | ||
// We changed `pool_withdrawals_into_transactions_queue` to v1 in order to add pool | ||
// withdrawals on any validator quorums. v0 allowed us to pool only on the first two | ||
// quorums as workaround for Core v21 bug. | ||
pool_withdrawals_into_transactions_queue: 1, | ||
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: 2, | ||
}, | ||
platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { | ||
fetch_platform_state: 0, | ||
store_platform_state: 0, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
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_V5: DriveAbciMethodVersions = DriveAbciMethodVersions { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. V5 or V6? |
||
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you add a v5 again here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By mistake |
||
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, | ||
// We changed `pool_withdrawals_into_transactions_queue` to v1 in order to add pool | ||
// withdrawals on any validator quorums. v0 allowed us to pool only on the first two | ||
// quorums as workaround for Core v21 bug. | ||
pool_withdrawals_into_transactions_queue: 1, | ||
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: 2, | ||
}, | ||
platform_state_storage: DriveAbciPlatformStateStorageMethodVersions { | ||
fetch_platform_state: 0, | ||
store_platform_state: 0, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod protocol_version; | ||
use crate::version::v7::PROTOCOL_VERSION_7; | ||
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (dapi-grpc) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (dash-sdk) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (dpp) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (drive) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (drive-abci) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (rs-dapi-client) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
Check warning on line 2 in packages/rs-platform-version/src/version/mod.rs GitHub Actions / Rust packages (wasm-dpp) / Lintingunused import: `crate::version::v7::PROTOCOL_VERSION_7`
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused import There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
use crate::version::v8::PROTOCOL_VERSION_8; | ||
pub use protocol_version::*; | ||
|
||
mod consensus_versions; | ||
|
@@ -19,8 +20,9 @@ | |
pub mod v5; | ||
pub mod v6; | ||
pub mod v7; | ||
pub mod v8; | ||
|
||
pub type ProtocolVersion = u32; | ||
|
||
pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_7; | ||
pub const LATEST_VERSION: ProtocolVersion = PROTOCOL_VERSION_8; | ||
pub const INITIAL_PROTOCOL_VERSION: ProtocolVersion = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why make this a function?