Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@ mod tests {
);
}

/// Tests validate_structure directly because 101 actions exceed the
/// max_state_transition_size (20KB) before reaching the actions count check
/// in the full pipeline.
/// Tests `validate_structure` directly to exercise the
/// `max_shielded_transition_actions` check in isolation, without
/// depending on the full transition-processing pipeline.
#[test]
fn test_too_many_actions_returns_error() {
use dpp::state_transition::StateTransitionStructureValidation;

let platform_version = PlatformVersion::latest();

// 101 actions exceeds max_shielded_transition_actions (100)
// 17 actions exceeds max_shielded_transition_actions (16)
let actions: Vec<SerializedAction> =
(0..101).map(|_| create_dummy_serialized_action()).collect();
(0..17).map(|_| create_dummy_serialized_action()).collect();

let transition = ShieldTransitionV0 {
inputs: BTreeMap::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ mod tests {
);
}

/// Tests validate_structure directly because 101 actions exceed the
/// max_state_transition_size (20KB) before reaching the actions count check
/// in the full pipeline.
/// Tests `validate_structure` directly to exercise the
/// `max_shielded_transition_actions` check in isolation, without
/// depending on the full transition-processing pipeline.
#[test]
fn test_too_many_actions_returns_error() {
use dpp::state_transition::StateTransitionStructureValidation;

let platform_version = PlatformVersion::latest();

// 101 actions exceeds max_shielded_transition_actions (100)
// 17 actions exceeds max_shielded_transition_actions (16)
let actions: Vec<SerializedAction> =
(0..101).map(|_| create_dummy_serialized_action()).collect();
(0..17).map(|_| create_dummy_serialized_action()).collect();

let transition = ShieldFromAssetLockTransitionV0 {
asset_lock_proof: instant_asset_lock_proof_fixture(None, None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ mod tests {
);
}

/// Tests validate_structure directly because 101 actions exceed the
/// max_state_transition_size (20KB) before reaching the actions count check
/// in the full pipeline.
/// Tests `validate_structure` directly to exercise the
/// `max_shielded_transition_actions` check in isolation, without
/// depending on the full transition-processing pipeline.
#[test]
fn test_too_many_actions_returns_error() {
use dpp::state_transition::StateTransitionStructureValidation;

let platform_version = PlatformVersion::latest();

// 101 actions exceeds max_shielded_transition_actions (100)
// 17 actions exceeds max_shielded_transition_actions (16)
let actions: Vec<SerializedAction> =
(0..101).map(|_| create_dummy_serialized_action()).collect();
(0..17).map(|_| create_dummy_serialized_action()).collect();

let transition = ShieldedTransferTransitionV0 {
actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,16 @@ mod tests {

#[test]
fn test_too_many_actions_returns_error() {
// NOTE: We call validate_structure directly because 101 actions (~41KB)
// exceeds max_state_transition_size (20KB) before the actions count check
// can trigger. This means ShieldedTooManyActionsError is effectively
// unreachable through the normal pipeline.
// NOTE: We call validate_structure directly to exercise the
// max_shielded_transition_actions check in isolation, without
// depending on the full transition-processing pipeline.
use dpp::state_transition::StateTransitionStructureValidation;

let platform_version = PlatformVersion::latest();

// 101 actions exceeds max_shielded_transition_actions (100)
// 17 actions exceeds max_shielded_transition_actions (16)
let actions: Vec<SerializedAction> =
(0..101).map(|_| create_dummy_serialized_action()).collect();
(0..17).map(|_| create_dummy_serialized_action()).collect();

let transition = ShieldedWithdrawalTransitionV0 {
actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,16 @@ mod tests {

#[test]
fn test_too_many_actions_returns_error() {
// NOTE: We call validate_structure directly because 101 actions (~41KB)
// exceeds max_state_transition_size (20KB) before the actions count check
// can trigger. This means ShieldedTooManyActionsError is effectively
// unreachable through the normal pipeline.
// NOTE: We call validate_structure directly to exercise the
// max_shielded_transition_actions check in isolation, without
// depending on the full transition-processing pipeline.
use dpp::state_transition::StateTransitionStructureValidation;

let platform_version = PlatformVersion::latest();

// 101 actions exceeds max_shielded_transition_actions (100)
// 17 actions exceeds max_shielded_transition_actions (16)
let actions: Vec<SerializedAction> =
(0..101).map(|_| create_dummy_serialized_action()).collect();
(0..17).map(|_| create_dummy_serialized_action()).collect();

let transition = UnshieldTransitionV0 {
output_address: create_output_address(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion {
max_withdrawal_amount: 50_000_000_000_000,
max_contract_group_size: 256,
max_token_redemption_cycles: 128,
max_shielded_transition_actions: 100,
max_shielded_transition_actions: 16,
},
consensus: ConsensusVersions {
tenderdash_consensus_version: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ pub const SYSTEM_LIMITS_V1: SystemLimits = SystemLimits {
max_withdrawal_amount: 50_000_000_000_000, //500 Dash
max_contract_group_size: 256,
max_token_redemption_cycles: 128,
max_shielded_transition_actions: 100,
// 16 actions x 408 bytes + ~5,305 bytes overhead = ~11,833 bytes (within 20 KiB max_state_transition_size)
max_shielded_transition_actions: 16,
};
Loading