diff --git a/core/parameters/res/runtime_configs/90.yaml b/core/parameters/res/runtime_configs/90.yaml new file mode 100644 index 00000000000..69bc173709f --- /dev/null +++ b/core/parameters/res/runtime_configs/90.yaml @@ -0,0 +1 @@ +combined_transactions_size_limit: {old: 2_097_152, new: 4_194_304} diff --git a/core/parameters/src/config_store.rs b/core/parameters/src/config_store.rs index 115e6eb390b..b74d2e9af01 100644 --- a/core/parameters/src/config_store.rs +++ b/core/parameters/src/config_store.rs @@ -43,6 +43,7 @@ static CONFIG_DIFFS: &[(ProtocolVersion, &str)] = &[ (85, include_config!("85.yaml")), // Congestion Control & State Witness size limit (87, include_config!("87.yaml")), + (90, include_config!("90.yaml")), (129, include_config!("129.yaml")), // Introduce ETH-implicit accounts. (138, include_config!("138.yaml")), diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__129.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__129.json.snap index c89b9f65b87..762e634fc5d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__129.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__129.json.snap @@ -240,7 +240,7 @@ expression: config_view }, "witness_config": { "main_storage_proof_size_soft_limit": 3000000, - "combined_transactions_size_limit": 2097152, + "combined_transactions_size_limit": 4194304, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__138.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__138.json.snap index c79ddcf2dd7..48be525654c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__138.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__138.json.snap @@ -240,7 +240,7 @@ expression: config_view }, "witness_config": { "main_storage_proof_size_soft_limit": 3000000, - "combined_transactions_size_limit": 2097152, + "combined_transactions_size_limit": 4194304, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__90.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__90.json.snap new file mode 100644 index 00000000000..dd8e11c91c9 --- /dev/null +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__90.json.snap @@ -0,0 +1,246 @@ +--- +source: core/parameters/src/config_store.rs +expression: config_view +--- +{ + "storage_amount_per_byte": "10000000000000000000", + "transaction_costs": { + "action_receipt_creation_config": { + "send_sir": 108059500000, + "send_not_sir": 108059500000, + "execution": 108059500000 + }, + "data_receipt_creation_config": { + "base_cost": { + "send_sir": 36486732312, + "send_not_sir": 36486732312, + "execution": 36486732312 + }, + "cost_per_byte": { + "send_sir": 17212011, + "send_not_sir": 17212011, + "execution": 17212011 + } + }, + "action_creation_config": { + "create_account_cost": { + "send_sir": 3850000000000, + "send_not_sir": 3850000000000, + "execution": 3850000000000 + }, + "deploy_contract_cost": { + "send_sir": 184765750000, + "send_not_sir": 184765750000, + "execution": 184765750000 + }, + "deploy_contract_cost_per_byte": { + "send_sir": 6812999, + "send_not_sir": 6812999, + "execution": 64572944 + }, + "function_call_cost": { + "send_sir": 200000000000, + "send_not_sir": 200000000000, + "execution": 780000000000 + }, + "function_call_cost_per_byte": { + "send_sir": 2235934, + "send_not_sir": 2235934, + "execution": 2235934 + }, + "transfer_cost": { + "send_sir": 115123062500, + "send_not_sir": 115123062500, + "execution": 115123062500 + }, + "stake_cost": { + "send_sir": 141715687500, + "send_not_sir": 141715687500, + "execution": 102217625000 + }, + "add_key_cost": { + "full_access_cost": { + "send_sir": 101765125000, + "send_not_sir": 101765125000, + "execution": 101765125000 + }, + "function_call_cost": { + "send_sir": 102217625000, + "send_not_sir": 102217625000, + "execution": 102217625000 + }, + "function_call_cost_per_byte": { + "send_sir": 1925331, + "send_not_sir": 1925331, + "execution": 1925331 + } + }, + "delete_key_cost": { + "send_sir": 94946625000, + "send_not_sir": 94946625000, + "execution": 94946625000 + }, + "delete_account_cost": { + "send_sir": 147489000000, + "send_not_sir": 147489000000, + "execution": 147489000000 + }, + "delegate_cost": { + "send_sir": 200000000000, + "send_not_sir": 200000000000, + "execution": 200000000000 + } + }, + "storage_usage_config": { + "num_bytes_account": 100, + "num_extra_bytes_record": 40 + }, + "burnt_gas_reward": [ + 3, + 10 + ], + "pessimistic_gas_price_inflation_ratio": [ + 103, + 100 + ] + }, + "wasm_config": { + "ext_costs": { + "base": 264768111, + "contract_loading_base": 35445963, + "contract_loading_bytes": 1089295, + "read_memory_base": 2609863200, + "read_memory_byte": 3801333, + "write_memory_base": 2803794861, + "write_memory_byte": 2723772, + "read_register_base": 2517165186, + "read_register_byte": 98562, + "write_register_base": 2865522486, + "write_register_byte": 3801564, + "utf8_decoding_base": 3111779061, + "utf8_decoding_byte": 291580479, + "utf16_decoding_base": 3543313050, + "utf16_decoding_byte": 163577493, + "sha256_base": 4540970250, + "sha256_byte": 24117351, + "keccak256_base": 5879491275, + "keccak256_byte": 21471105, + "keccak512_base": 5811388236, + "keccak512_byte": 36649701, + "ripemd160_base": 853675086, + "ripemd160_block": 680107584, + "ed25519_verify_base": 210000000000, + "ed25519_verify_byte": 9000000, + "ecrecover_base": 278821988457, + "log_base": 3543313050, + "log_byte": 13198791, + "storage_write_base": 64196736000, + "storage_write_key_byte": 70482867, + "storage_write_value_byte": 31018539, + "storage_write_evicted_byte": 32117307, + "storage_read_base": 56356845750, + "storage_read_key_byte": 30952533, + "storage_read_value_byte": 5611005, + "storage_remove_base": 53473030500, + "storage_remove_key_byte": 38220384, + "storage_remove_ret_value_byte": 11531556, + "storage_has_key_base": 54039896625, + "storage_has_key_byte": 30790845, + "storage_iter_create_prefix_base": 0, + "storage_iter_create_prefix_byte": 0, + "storage_iter_create_range_base": 0, + "storage_iter_create_from_byte": 0, + "storage_iter_create_to_byte": 0, + "storage_iter_next_base": 0, + "storage_iter_next_key_byte": 0, + "storage_iter_next_value_byte": 0, + "touching_trie_node": 16101955926, + "read_cached_trie_node": 2280000000, + "promise_and_base": 1465013400, + "promise_and_per_promise": 5452176, + "promise_return": 560152386, + "validator_stake_base": 911834726400, + "validator_total_stake_base": 911834726400, + "contract_compile_base": 0, + "contract_compile_bytes": 0, + "alt_bn128_g1_multiexp_base": 713000000000, + "alt_bn128_g1_multiexp_element": 320000000000, + "alt_bn128_g1_sum_base": 3000000000, + "alt_bn128_g1_sum_element": 5000000000, + "alt_bn128_pairing_check_base": 9686000000000, + "alt_bn128_pairing_check_element": 5102000000000, + "yield_create_base": 153411779276, + "yield_create_byte": 15643988, + "yield_resume_base": 1195627285210, + "yield_resume_byte": 1195627285210 + }, + "grow_mem_cost": 1, + "regular_op_cost": 822756, + "vm_kind": "", + "disable_9393_fix": false, + "storage_get_mode": "FlatStorage", + "fix_contract_loading_cost": false, + "implicit_account_creation": true, + "math_extension": true, + "ed25519_verify": true, + "alt_bn128": true, + "function_call_weight": true, + "eth_implicit_accounts": false, + "yield_resume_host_functions": true, + "limit_config": { + "max_gas_burnt": 300000000000000, + "max_stack_height": 262144, + "contract_prepare_version": 2, + "initial_memory_pages": 1024, + "max_memory_pages": 2048, + "registers_memory_limit": 1073741824, + "max_register_size": 104857600, + "max_number_registers": 100, + "max_number_logs": 100, + "max_total_log_length": 16384, + "max_total_prepaid_gas": 300000000000000, + "max_actions_per_receipt": 100, + "max_number_bytes_method_names": 2000, + "max_length_method_name": 256, + "max_arguments_length": 4194304, + "max_length_returned_data": 4194304, + "max_contract_size": 4194304, + "max_transaction_size": 1572864, + "max_receipt_size": 4194304, + "max_length_storage_key": 2048, + "max_length_storage_value": 4194304, + "max_promises_per_function_call_action": 1024, + "max_number_input_data_dependencies": 128, + "max_functions_number_per_contract": 10000, + "wasmer2_stack_limit": 204800, + "max_locals_per_contract": 1000000, + "account_id_validity_rules_version": 1, + "yield_timeout_length_in_blocks": 200, + "max_yield_payload_size": 1024, + "per_receipt_storage_proof_size_limit": 4000000 + } + }, + "account_creation_config": { + "min_allowed_top_level_account_length": 65, + "registrar_account_id": "registrar" + }, + "congestion_control_config": { + "max_congestion_incoming_gas": 20000000000000000, + "max_congestion_outgoing_gas": 2000000000000000, + "max_congestion_memory_consumption": 1000000000, + "max_congestion_missed_chunks": 2, + "max_outgoing_gas": 300000000000000000, + "min_outgoing_gas": 1000000000000000, + "allowed_shard_outgoing_gas": 1000000000000000, + "max_tx_gas": 500000000000000, + "min_tx_gas": 20000000000000, + "reject_tx_congestion_threshold": 0.25, + "outgoing_receipts_usual_size_limit": 102400, + "outgoing_receipts_big_size_limit": 4718592 + }, + "witness_config": { + "main_storage_proof_size_soft_limit": 3000000, + "combined_transactions_size_limit": 4194304, + "new_transactions_validation_state_size_soft_limit": 572864 + } +} diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_129.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_129.json.snap index c89b9f65b87..762e634fc5d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_129.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_129.json.snap @@ -240,7 +240,7 @@ expression: config_view }, "witness_config": { "main_storage_proof_size_soft_limit": 3000000, - "combined_transactions_size_limit": 2097152, + "combined_transactions_size_limit": 4194304, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_138.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_138.json.snap index c79ddcf2dd7..48be525654c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_138.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_138.json.snap @@ -240,7 +240,7 @@ expression: config_view }, "witness_config": { "main_storage_proof_size_soft_limit": 3000000, - "combined_transactions_size_limit": 2097152, + "combined_transactions_size_limit": 4194304, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_90.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_90.json.snap new file mode 100644 index 00000000000..dd8e11c91c9 --- /dev/null +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_90.json.snap @@ -0,0 +1,246 @@ +--- +source: core/parameters/src/config_store.rs +expression: config_view +--- +{ + "storage_amount_per_byte": "10000000000000000000", + "transaction_costs": { + "action_receipt_creation_config": { + "send_sir": 108059500000, + "send_not_sir": 108059500000, + "execution": 108059500000 + }, + "data_receipt_creation_config": { + "base_cost": { + "send_sir": 36486732312, + "send_not_sir": 36486732312, + "execution": 36486732312 + }, + "cost_per_byte": { + "send_sir": 17212011, + "send_not_sir": 17212011, + "execution": 17212011 + } + }, + "action_creation_config": { + "create_account_cost": { + "send_sir": 3850000000000, + "send_not_sir": 3850000000000, + "execution": 3850000000000 + }, + "deploy_contract_cost": { + "send_sir": 184765750000, + "send_not_sir": 184765750000, + "execution": 184765750000 + }, + "deploy_contract_cost_per_byte": { + "send_sir": 6812999, + "send_not_sir": 6812999, + "execution": 64572944 + }, + "function_call_cost": { + "send_sir": 200000000000, + "send_not_sir": 200000000000, + "execution": 780000000000 + }, + "function_call_cost_per_byte": { + "send_sir": 2235934, + "send_not_sir": 2235934, + "execution": 2235934 + }, + "transfer_cost": { + "send_sir": 115123062500, + "send_not_sir": 115123062500, + "execution": 115123062500 + }, + "stake_cost": { + "send_sir": 141715687500, + "send_not_sir": 141715687500, + "execution": 102217625000 + }, + "add_key_cost": { + "full_access_cost": { + "send_sir": 101765125000, + "send_not_sir": 101765125000, + "execution": 101765125000 + }, + "function_call_cost": { + "send_sir": 102217625000, + "send_not_sir": 102217625000, + "execution": 102217625000 + }, + "function_call_cost_per_byte": { + "send_sir": 1925331, + "send_not_sir": 1925331, + "execution": 1925331 + } + }, + "delete_key_cost": { + "send_sir": 94946625000, + "send_not_sir": 94946625000, + "execution": 94946625000 + }, + "delete_account_cost": { + "send_sir": 147489000000, + "send_not_sir": 147489000000, + "execution": 147489000000 + }, + "delegate_cost": { + "send_sir": 200000000000, + "send_not_sir": 200000000000, + "execution": 200000000000 + } + }, + "storage_usage_config": { + "num_bytes_account": 100, + "num_extra_bytes_record": 40 + }, + "burnt_gas_reward": [ + 3, + 10 + ], + "pessimistic_gas_price_inflation_ratio": [ + 103, + 100 + ] + }, + "wasm_config": { + "ext_costs": { + "base": 264768111, + "contract_loading_base": 35445963, + "contract_loading_bytes": 1089295, + "read_memory_base": 2609863200, + "read_memory_byte": 3801333, + "write_memory_base": 2803794861, + "write_memory_byte": 2723772, + "read_register_base": 2517165186, + "read_register_byte": 98562, + "write_register_base": 2865522486, + "write_register_byte": 3801564, + "utf8_decoding_base": 3111779061, + "utf8_decoding_byte": 291580479, + "utf16_decoding_base": 3543313050, + "utf16_decoding_byte": 163577493, + "sha256_base": 4540970250, + "sha256_byte": 24117351, + "keccak256_base": 5879491275, + "keccak256_byte": 21471105, + "keccak512_base": 5811388236, + "keccak512_byte": 36649701, + "ripemd160_base": 853675086, + "ripemd160_block": 680107584, + "ed25519_verify_base": 210000000000, + "ed25519_verify_byte": 9000000, + "ecrecover_base": 278821988457, + "log_base": 3543313050, + "log_byte": 13198791, + "storage_write_base": 64196736000, + "storage_write_key_byte": 70482867, + "storage_write_value_byte": 31018539, + "storage_write_evicted_byte": 32117307, + "storage_read_base": 56356845750, + "storage_read_key_byte": 30952533, + "storage_read_value_byte": 5611005, + "storage_remove_base": 53473030500, + "storage_remove_key_byte": 38220384, + "storage_remove_ret_value_byte": 11531556, + "storage_has_key_base": 54039896625, + "storage_has_key_byte": 30790845, + "storage_iter_create_prefix_base": 0, + "storage_iter_create_prefix_byte": 0, + "storage_iter_create_range_base": 0, + "storage_iter_create_from_byte": 0, + "storage_iter_create_to_byte": 0, + "storage_iter_next_base": 0, + "storage_iter_next_key_byte": 0, + "storage_iter_next_value_byte": 0, + "touching_trie_node": 16101955926, + "read_cached_trie_node": 2280000000, + "promise_and_base": 1465013400, + "promise_and_per_promise": 5452176, + "promise_return": 560152386, + "validator_stake_base": 911834726400, + "validator_total_stake_base": 911834726400, + "contract_compile_base": 0, + "contract_compile_bytes": 0, + "alt_bn128_g1_multiexp_base": 713000000000, + "alt_bn128_g1_multiexp_element": 320000000000, + "alt_bn128_g1_sum_base": 3000000000, + "alt_bn128_g1_sum_element": 5000000000, + "alt_bn128_pairing_check_base": 9686000000000, + "alt_bn128_pairing_check_element": 5102000000000, + "yield_create_base": 153411779276, + "yield_create_byte": 15643988, + "yield_resume_base": 1195627285210, + "yield_resume_byte": 1195627285210 + }, + "grow_mem_cost": 1, + "regular_op_cost": 822756, + "vm_kind": "", + "disable_9393_fix": false, + "storage_get_mode": "FlatStorage", + "fix_contract_loading_cost": false, + "implicit_account_creation": true, + "math_extension": true, + "ed25519_verify": true, + "alt_bn128": true, + "function_call_weight": true, + "eth_implicit_accounts": false, + "yield_resume_host_functions": true, + "limit_config": { + "max_gas_burnt": 300000000000000, + "max_stack_height": 262144, + "contract_prepare_version": 2, + "initial_memory_pages": 1024, + "max_memory_pages": 2048, + "registers_memory_limit": 1073741824, + "max_register_size": 104857600, + "max_number_registers": 100, + "max_number_logs": 100, + "max_total_log_length": 16384, + "max_total_prepaid_gas": 300000000000000, + "max_actions_per_receipt": 100, + "max_number_bytes_method_names": 2000, + "max_length_method_name": 256, + "max_arguments_length": 4194304, + "max_length_returned_data": 4194304, + "max_contract_size": 4194304, + "max_transaction_size": 1572864, + "max_receipt_size": 4194304, + "max_length_storage_key": 2048, + "max_length_storage_value": 4194304, + "max_promises_per_function_call_action": 1024, + "max_number_input_data_dependencies": 128, + "max_functions_number_per_contract": 10000, + "wasmer2_stack_limit": 204800, + "max_locals_per_contract": 1000000, + "account_id_validity_rules_version": 1, + "yield_timeout_length_in_blocks": 200, + "max_yield_payload_size": 1024, + "per_receipt_storage_proof_size_limit": 4000000 + } + }, + "account_creation_config": { + "min_allowed_top_level_account_length": 65, + "registrar_account_id": "registrar" + }, + "congestion_control_config": { + "max_congestion_incoming_gas": 20000000000000000, + "max_congestion_outgoing_gas": 2000000000000000, + "max_congestion_memory_consumption": 1000000000, + "max_congestion_missed_chunks": 2, + "max_outgoing_gas": 300000000000000000, + "min_outgoing_gas": 1000000000000000, + "allowed_shard_outgoing_gas": 1000000000000000, + "max_tx_gas": 500000000000000, + "min_tx_gas": 20000000000000, + "reject_tx_congestion_threshold": 0.25, + "outgoing_receipts_usual_size_limit": 102400, + "outgoing_receipts_big_size_limit": 4718592 + }, + "witness_config": { + "main_storage_proof_size_soft_limit": 3000000, + "combined_transactions_size_limit": 4194304, + "new_transactions_validation_state_size_soft_limit": 572864 + } +} diff --git a/core/primitives-core/src/version.rs b/core/primitives-core/src/version.rs index 5afcfb85b39..17ed07b2647 100644 --- a/core/primitives-core/src/version.rs +++ b/core/primitives-core/src/version.rs @@ -172,6 +172,8 @@ pub enum ProtocolFeature { NoChunkOnlyProducers, /// Decrease the ratio of data parts in the Reed Solomon encoding for partial witness distribution. ChangePartialWitnessDataPartsRequired, + /// Increase the `combined_transactions_size_limit` to 4MiB to allow higher throughput. + BiggerCombinedTransactionLimit, } impl ProtocolFeature { @@ -240,6 +242,7 @@ impl ProtocolFeature { ProtocolFeature::CongestionControlAllowedShardValidation | ProtocolFeature::NoChunkOnlyProducers => 88, ProtocolFeature::ChangePartialWitnessDataPartsRequired => 89, + ProtocolFeature::BiggerCombinedTransactionLimit => 90, // Nightly features #[cfg(feature = "protocol_feature_fix_staking_threshold")] @@ -270,7 +273,7 @@ const STABLE_PROTOCOL_VERSION: ProtocolVersion = 67; /// Largest protocol version supported by the current binary. pub const PROTOCOL_VERSION: ProtocolVersion = if cfg!(feature = "statelessnet_protocol") { // Current StatelessNet protocol version. - 89 + 90 } else if cfg!(feature = "nightly_protocol") { // On nightly, pick big enough version to support all features. 143 diff --git a/docs/misc/state_witness_size_limits.md b/docs/misc/state_witness_size_limits.md index a22eebb4c75..e461d444fb3 100644 --- a/docs/misc/state_witness_size_limits.md +++ b/docs/misc/state_witness_size_limits.md @@ -14,7 +14,7 @@ The limits are: * `max_receipt_size - 4 MiB`: * All receipts must be below 4 MiB, otherwise they'll be considered invalid and rejected. * Previously there was no limit on receipt size. Set to 4MiB, might be reduced to 1.5MiB in the future to match the transaction limit. -* `combined_transactions_size_limit - 2 MiB` +* `combined_transactions_size_limit - 4 MiB` * Hard limit on total size of transactions from this and previous chunk. `ChunkStateWitness` contains transactions from two chunks, this limit applies to the sum of their sizes. * `new_transactions_validation_state_size_soft_limit - 500 KiB` * Validating new transactions generates storage proof (recorded trie nodes), which has to be limited. Once transaction validation generates more storage proof than this limit, the chunk producer stops adding new transactions to the chunk. @@ -31,7 +31,7 @@ The limits are: * On every block height there's one special "allowed shard" which is allowed to send larger receipts, up to 4.5 MiB in total. * A receiving shard will receive receipts from `num_shards - 1` shards using the usual limit and one shard using the big limit. -In total that gives 2 MiB + 500 KiB + 7MB + 5*100 KiB + 4.5 MiB ~= 14 MiB of maximum witness size +In total that gives 4 MiB + 500 KiB + 7MB + 5*100 KiB + 4.5 MiB ~= 16 MiB of maximum witness size. Possibly a little more on missing chunks. ### Validating the limits diff --git a/integration-tests/src/tests/client/benchmarks.rs b/integration-tests/src/tests/client/benchmarks.rs index 79185b1b25e..1c60100abed 100644 --- a/integration-tests/src/tests/client/benchmarks.rs +++ b/integration-tests/src/tests/client/benchmarks.rs @@ -10,7 +10,7 @@ use near_client::{ProcessTxResponse, ProduceChunkResult}; use near_crypto::{InMemorySigner, KeyType}; use near_primitives::checked_feature; use near_primitives::transaction::{Action, DeployContractAction, SignedTransaction}; -use near_primitives::version::PROTOCOL_VERSION; +use near_primitives::version::{ProtocolFeature, PROTOCOL_VERSION}; use nearcore::test_utils::TestEnvNightshadeSetupExt; /// How long does it take to produce a large chunk? @@ -56,14 +56,20 @@ fn benchmark_large_chunk_production_time() { let ProduceChunkResult { chunk, .. } = create_chunk_on_height(&mut env.clients[0], 0); let time = t.elapsed(); + let decoded_chunk = chunk.decode_chunk(0).unwrap(); + let size = borsh::object_length(&chunk).unwrap(); eprintln!("chunk size: {}kb", size / 1024); eprintln!("time to produce: {:0.2?}", time); // Check that we limit the size of the chunk and not include all `n_txes` // transactions in the chunk. - if checked_feature!("stable", WitnessTransactionLimits, PROTOCOL_VERSION) { + if ProtocolFeature::BiggerCombinedTransactionLimit.enabled(PROTOCOL_VERSION) { + assert!(6 * mb < size && size < 8 * mb, "{size}"); + assert_eq!(decoded_chunk.transactions().len(), 7); // 4MiB limit allows for 7 x 0.5MiB transactions + } else if ProtocolFeature::WitnessTransactionLimits.enabled(PROTOCOL_VERSION) { assert!(2 * mb < size && size < 4 * mb, "{size}"); + assert_eq!(decoded_chunk.transactions().len(), 3); // 2MiB limit allows for 3 x 0.5MiB transactions } else { assert!(30 * mb < size && size < 40 * mb, "{size}"); }