From 45afc640b651cfdd798397d1929cbedc33bb69da Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Tue, 28 May 2024 10:45:40 +0000 Subject: [PATCH 01/21] Add limits to config --- core/parameters/res/runtime_configs/87.yaml | 3 + .../res/runtime_configs/parameters.snap | 2 + .../res/runtime_configs/parameters.yaml | 2 + .../runtime_configs/parameters_testnet.yaml | 2 + core/parameters/src/config.rs | 10 + core/parameters/src/config_store.rs | 1 + core/parameters/src/parameter.rs | 4 + core/parameters/src/parameter_table.rs | 4 + ...meters__config_store__tests__129.json.snap | 2 +- ...meters__config_store__tests__138.json.snap | 2 +- ...meters__config_store__tests__139.json.snap | 6 +- ...meters__config_store__tests__142.json.snap | 2 +- ...ameters__config_store__tests__87.json.snap | 227 ++++++++++++++++++ ...config_store__tests__testnet_129.json.snap | 2 +- ...config_store__tests__testnet_138.json.snap | 2 +- ...config_store__tests__testnet_139.json.snap | 6 +- ...config_store__tests__testnet_142.json.snap | 2 +- ..._config_store__tests__testnet_87.json.snap | 227 ++++++++++++++++++ core/primitives-core/src/version.rs | 5 +- .../src/costs_to_runtime_config.rs | 3 + 20 files changed, 503 insertions(+), 11 deletions(-) create mode 100644 core/parameters/res/runtime_configs/87.yaml create mode 100644 core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap create mode 100644 core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap diff --git a/core/parameters/res/runtime_configs/87.yaml b/core/parameters/res/runtime_configs/87.yaml new file mode 100644 index 00000000000..0c9f36062da --- /dev/null +++ b/core/parameters/res/runtime_configs/87.yaml @@ -0,0 +1,3 @@ +max_transaction_size: {old: 4_194_304, new: 1_572_864} +max_transactions_size_in_witness: {old: 999_999_999_999_999, new: 2_097_152} +new_transactions_validation_state_size_soft_limit: {old: 999_999_999_999_999, new: 572_864} diff --git a/core/parameters/res/runtime_configs/parameters.snap b/core/parameters/res/runtime_configs/parameters.snap index 89248b9ac11..106886fdcea 100644 --- a/core/parameters/res/runtime_configs/parameters.snap +++ b/core/parameters/res/runtime_configs/parameters.snap @@ -6,6 +6,8 @@ burnt_gas_reward 3 / 10 pessimistic_gas_price_inflation 103 / 100 storage_proof_size_soft_limit 999_999_999_999_999 storage_proof_size_receipt_limit 999_999_999_999_999 +max_transactions_size_in_witness 999_999_999_999_999 +new_transactions_validation_state_size_soft_limit 999_999_999_999_999 min_allowed_top_level_account_length 65 registrar_account_id registrar storage_amount_per_byte 10000000000000000000 diff --git a/core/parameters/res/runtime_configs/parameters.yaml b/core/parameters/res/runtime_configs/parameters.yaml index 33ee094fa74..cd8e07c1ead 100644 --- a/core/parameters/res/runtime_configs/parameters.yaml +++ b/core/parameters/res/runtime_configs/parameters.yaml @@ -15,6 +15,8 @@ pessimistic_gas_price_inflation: { # Stateless validation config storage_proof_size_soft_limit: 999_999_999_999_999 storage_proof_size_receipt_limit: 999_999_999_999_999 +max_transactions_size_in_witness: 999_999_999_999_999 +new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 # Account creation config min_allowed_top_level_account_length: 32 diff --git a/core/parameters/res/runtime_configs/parameters_testnet.yaml b/core/parameters/res/runtime_configs/parameters_testnet.yaml index 8a4f784f365..fa6481044fe 100644 --- a/core/parameters/res/runtime_configs/parameters_testnet.yaml +++ b/core/parameters/res/runtime_configs/parameters_testnet.yaml @@ -11,6 +11,8 @@ pessimistic_gas_price_inflation: { # Stateless validation config storage_proof_size_soft_limit: 999_999_999_999_999 storage_proof_size_receipt_limit: 999_999_999_999_999 +max_transactions_size_in_witness: 999_999_999_999_999 +new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 # Account creation config min_allowed_top_level_account_length: 0 diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index 01d15b1443c..0d372029994 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -31,6 +31,10 @@ pub struct RuntimeConfig { pub storage_proof_size_soft_limit: usize, /// The configuration for congestion control. pub congestion_control_config: CongestionControlConfig, + /// Maxmium size of transactions contained inside ChunkStateWitness. + pub max_transactions_size_in_witness: usize, + /// Soft size limit of new transactions storage proof inside ChunkStateWitness. + pub new_transactions_validation_state_size_soft_limit: usize, } impl RuntimeConfig { @@ -59,6 +63,9 @@ impl RuntimeConfig { account_creation_config: AccountCreationConfig::default(), storage_proof_size_soft_limit: usize::MAX, congestion_control_config: runtime_config.congestion_control_config, + max_transactions_size_in_witness: runtime_config.max_transactions_size_in_witness, + new_transactions_validation_state_size_soft_limit: runtime_config + .new_transactions_validation_state_size_soft_limit, } } @@ -75,6 +82,9 @@ impl RuntimeConfig { account_creation_config: AccountCreationConfig::default(), storage_proof_size_soft_limit: usize::MAX, congestion_control_config: runtime_config.congestion_control_config, + max_transactions_size_in_witness: runtime_config.max_transactions_size_in_witness, + new_transactions_validation_state_size_soft_limit: runtime_config + .new_transactions_validation_state_size_soft_limit, } } diff --git a/core/parameters/src/config_store.rs b/core/parameters/src/config_store.rs index 7d027d42f38..1ae2d50c2e8 100644 --- a/core/parameters/src/config_store.rs +++ b/core/parameters/src/config_store.rs @@ -41,6 +41,7 @@ static CONFIG_DIFFS: &[(ProtocolVersion, &str)] = &[ (67, include_config!("67.yaml")), (83, include_config!("83.yaml")), (85, include_config!("85.yaml")), + (87, include_config!("87.yaml")), (129, include_config!("129.yaml")), // Introduce ETH-implicit accounts. (138, include_config!("138.yaml")), diff --git a/core/parameters/src/parameter.rs b/core/parameters/src/parameter.rs index d1232412dd5..879e82c72e8 100644 --- a/core/parameters/src/parameter.rs +++ b/core/parameters/src/parameter.rs @@ -24,6 +24,10 @@ pub enum Parameter { StorageProofSizeSoftLimit, // Hard per-receipt limit of recorded trie storage proof StorageProofSizeReceiptLimit, + // Maxmium size of transactions contained inside ChunkStateWitness. + MaxTransactionsSizeInWitness, + // Soft size limit of new transactions storage proof inside ChunkStateWitness. + NewTransactionsValidationStateSizeSoftLimit, // Account creation config MinAllowedTopLevelAccountLength, diff --git a/core/parameters/src/parameter_table.rs b/core/parameters/src/parameter_table.rs index 063882dd491..3beac4fa626 100644 --- a/core/parameters/src/parameter_table.rs +++ b/core/parameters/src/parameter_table.rs @@ -334,6 +334,10 @@ impl TryFrom<&ParameterTable> for RuntimeConfig { registrar_account_id: params.get(Parameter::RegistrarAccountId)?, }, storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?, + max_transactions_size_in_witness: params + .get(Parameter::MaxTransactionsSizeInWitness)?, + new_transactions_validation_state_size_soft_limit: params + .get(Parameter::NewTransactionsValidationStateSizeSoftLimit)?, congestion_control_config: get_congestion_control_config(params)?, }) } 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 ac0ec16da8b..b93d7542852 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 @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, 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 bb5d7b8ea62..92d04e4e303 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 @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap index bb5d7b8ea62..e615c68f07b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap @@ -103,7 +103,9 @@ expression: config_view 103, 100 ], - "storage_proof_size_soft_limit": 3000000 + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 }, "wasm_config": { "ext_costs": { @@ -206,7 +208,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap index bb5d7b8ea62..92d04e4e303 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap new file mode 100644 index 00000000000..755f9ad828a --- /dev/null +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap @@ -0,0 +1,227 @@ +--- +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 + ], + "storage_proof_size_soft_limit": 3000000 + }, + "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_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, + "storage_proof_size_receipt_limit": 4000000 + } + }, + "account_creation_config": { + "min_allowed_top_level_account_length": 65, + "registrar_account_id": "registrar" + } +} 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 ac0ec16da8b..b93d7542852 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 @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, 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 bb5d7b8ea62..92d04e4e303 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 @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap index bb5d7b8ea62..e615c68f07b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap @@ -103,7 +103,9 @@ expression: config_view 103, 100 ], - "storage_proof_size_soft_limit": 3000000 + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 }, "wasm_config": { "ext_costs": { @@ -206,7 +208,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap index bb5d7b8ea62..92d04e4e303 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap @@ -206,7 +206,7 @@ expression: config_view "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, - "max_transaction_size": 4194304, + "max_transaction_size": 1572864, "max_length_storage_key": 2048, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap new file mode 100644 index 00000000000..755f9ad828a --- /dev/null +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap @@ -0,0 +1,227 @@ +--- +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 + ], + "storage_proof_size_soft_limit": 3000000 + }, + "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_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, + "storage_proof_size_receipt_limit": 4000000 + } + }, + "account_creation_config": { + "min_allowed_top_level_account_length": 65, + "registrar_account_id": "registrar" + } +} diff --git a/core/primitives-core/src/version.rs b/core/primitives-core/src/version.rs index 1e0ac19e996..9e079bb415b 100644 --- a/core/primitives-core/src/version.rs +++ b/core/primitives-core/src/version.rs @@ -159,6 +159,8 @@ pub enum ProtocolFeature { CongestionControl, // Stateless validation: Distribute state witness as reed solomon encoded parts PartialEncodedStateWitness, + /// Size limits for transactions included in a ChunkStateWitness. + WitnessTransactionLimits, } impl ProtocolFeature { @@ -221,6 +223,7 @@ impl ProtocolFeature { ProtocolFeature::StateWitnessSizeLimit => 83, ProtocolFeature::PerReceiptHardStorageProofLimit => 85, ProtocolFeature::PartialEncodedStateWitness => 86, + ProtocolFeature::WitnessTransactionLimits => 87, // Nightly features #[cfg(feature = "protocol_feature_fix_staking_threshold")] @@ -252,7 +255,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. - 86 + 87 } else if cfg!(feature = "nightly_protocol") { // On nightly, pick big enough version to support all features. 143 diff --git a/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs b/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs index 98ba718c652..324cee75592 100644 --- a/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs +++ b/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs @@ -40,6 +40,9 @@ pub fn costs_to_runtime_config(cost_table: &CostTable) -> anyhow::Result Date: Fri, 24 May 2024 15:55:21 +0000 Subject: [PATCH 02/21] Simplify the loop for adding transactions --- chain/chain/src/runtime/mod.rs | 117 ++++++++++++++++----------------- 1 file changed, 57 insertions(+), 60 deletions(-) diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index 32847c922f2..ac87eec808c 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -793,7 +793,7 @@ impl RuntimeAdapter for NightshadeRuntime { let mut rejected_invalid_for_chain = 0; // Add new transactions to the result until some limit is hit or the transactions run out. - loop { + while let Some(transaction_group_iter) = transaction_groups.next() { if total_gas_burnt >= transactions_gas_limit { result.limited_by = Some(PrepareTransactionsLimit::Gas); break; @@ -820,71 +820,68 @@ impl RuntimeAdapter for NightshadeRuntime { } } - if let Some(iter) = transaction_groups.next() { - while let Some(tx) = iter.next() { - num_checked_transactions += 1; - - if ProtocolFeature::CongestionControl.enabled(protocol_version) { - let receiving_shard = EpochManagerAdapter::account_id_to_shard_id( - self.epoch_manager.as_ref(), - tx.transaction.receiver_id(), - &epoch_id, - )?; - if let Some(congestion_info) = - prev_block.congestion_info.get(&receiving_shard) - { - let congestion_control = CongestionControl::new( - runtime_config.congestion_control_config, - congestion_info.congestion_info, - congestion_info.missed_chunks_count, - ); - if !congestion_control.shard_accepts_transactions() { - tracing::trace!(target: "runtime", tx=?tx.get_hash(), "discarding transaction due to congestion"); - rejected_due_to_congestion += 1; - continue; - } + // Take a single transaction from this transaction group + while let Some(tx) = transaction_group_iter.next() { + num_checked_transactions += 1; + + if ProtocolFeature::CongestionControl.enabled(protocol_version) { + let receiving_shard = EpochManagerAdapter::account_id_to_shard_id( + self.epoch_manager.as_ref(), + tx.transaction.receiver_id(), + &epoch_id, + )?; + if let Some(congestion_info) = prev_block.congestion_info.get(&receiving_shard) + { + let congestion_control = CongestionControl::new( + runtime_config.congestion_control_config, + congestion_info.congestion_info, + congestion_info.missed_chunks_count, + ); + if !congestion_control.shard_accepts_transactions() { + tracing::trace!(target: "runtime", tx=?tx.get_hash(), "discarding transaction due to congestion"); + rejected_due_to_congestion += 1; + continue; } } + } - // Verifying the transaction is on the same chain and hasn't expired yet. - if !chain_validate(&tx) { - tracing::trace!(target: "runtime", tx=?tx.get_hash(), "discarding transaction that failed chain validation"); - rejected_invalid_for_chain += 1; - continue; - } + // Verifying the transaction is on the same chain and hasn't expired yet. + if !chain_validate(&tx) { + tracing::trace!(target: "runtime", tx=?tx.get_hash(), "discarding transaction that failed chain validation"); + rejected_invalid_for_chain += 1; + continue; + } - // Verifying the validity of the transaction based on the current state. - match verify_and_charge_transaction( - runtime_config, - &mut state_update, - prev_block.next_gas_price, - &tx, - false, - Some(next_block_height), - protocol_version, - ) { - Ok(verification_result) => { - tracing::trace!(target: "runtime", tx=?tx.get_hash(), "including transaction that passed validation"); - state_update.commit(StateChangeCause::NotWritableToDisk); - total_gas_burnt += verification_result.gas_burnt; - total_size += tx.get_size(); - result.transactions.push(tx); - break; - } - Err(RuntimeError::InvalidTxError(err)) => { - tracing::trace!(target: "runtime", tx=?tx.get_hash(), ?err, "discarding transaction that is invalid"); - rejected_invalid_tx += 1; - state_update.rollback(); - } - Err(RuntimeError::StorageError(err)) => { - tracing::trace!(target: "runtime", tx=?tx.get_hash(), ?err, "discarding transaction due to storage error"); - return Err(Error::StorageError(err)); - } - Err(err) => unreachable!("Unexpected RuntimeError error {:?}", err), + // Verifying the validity of the transaction based on the current state. + match verify_and_charge_transaction( + runtime_config, + &mut state_update, + prev_block.next_gas_price, + &tx, + false, + Some(next_block_height), + protocol_version, + ) { + Ok(verification_result) => { + tracing::trace!(target: "runtime", tx=?tx.get_hash(), "including transaction that passed validation"); + state_update.commit(StateChangeCause::NotWritableToDisk); + total_gas_burnt += verification_result.gas_burnt; + total_size += tx.get_size(); + result.transactions.push(tx); + // Take one transaction from this group, no more. + break; + } + Err(RuntimeError::InvalidTxError(err)) => { + tracing::trace!(target: "runtime", tx=?tx.get_hash(), ?err, "discarding transaction that is invalid"); + rejected_invalid_tx += 1; + state_update.rollback(); } + Err(RuntimeError::StorageError(err)) => { + tracing::trace!(target: "runtime", tx=?tx.get_hash(), ?err, "discarding transaction due to storage error"); + return Err(Error::StorageError(err)); + } + Err(err) => unreachable!("Unexpected RuntimeError error {:?}", err), } - } else { - break; } } debug!(target: "runtime", "Transaction filtering results {} valid out of {} pulled from the pool", result.transactions.len(), num_checked_transactions); From 380fe64e67699388b125a5e96caacc4f39235b6e Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Tue, 28 May 2024 10:47:13 +0000 Subject: [PATCH 03/21] Implement limits --- chain/chain/src/chain.rs | 32 ++++++++++ chain/chain/src/runtime/mod.rs | 61 +++++++++++++++---- chain/chain/src/runtime/tests.rs | 1 + chain/chain/src/types.rs | 9 +-- chain/client/src/client.rs | 30 ++++++++- .../chunk_validator/mod.rs | 12 +++- .../stateless_validation/shadow_validate.rs | 2 + chain/pool/src/types.rs | 4 ++ 8 files changed, 125 insertions(+), 26 deletions(-) diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs index 72787e82b85..cd960938ea6 100644 --- a/chain/chain/src/chain.rs +++ b/chain/chain/src/chain.rs @@ -4454,6 +4454,38 @@ impl Chain { }) .collect() } + + /// Find the last existing (not missing) chunk on this shard id. + pub fn get_header_of_last_existing_chunk( + &self, + last_block: CryptoHash, + shard_id: ShardId, + epoch_manager: &dyn EpochManagerAdapter, + ) -> Result, Error> { + let mut cur_block_hash = last_block; + let mut shard_id = shard_id; + loop { + let cur_block_header = self.get_block_header(&cur_block_hash)?; + if cur_block_header.is_genesis() { + return Ok(None); + } + if *cur_block_header + .chunk_mask() + .get(shard_id as usize) + .ok_or_else(|| Error::InvalidShardId(shard_id))? + { + let cur_block = self.get_block(&cur_block_hash)?; + let result = cur_block + .chunks() + .get(shard_id as usize) + .ok_or_else(|| Error::InvalidShardId(shard_id))? + .clone(); + return Ok(Some(result)); + } + cur_block_hash = *cur_block_header.prev_hash(); + shard_id = epoch_manager.get_prev_shard_id(&cur_block_hash, shard_id)?; + } + } } /// Sandbox node specific operations diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index ac87eec808c..fd31ca88920 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -700,7 +700,7 @@ impl RuntimeAdapter for NightshadeRuntime { time_limit: Option, ) -> Result { let start_time = std::time::Instant::now(); - let PrepareTransactionsChunkContext { shard_id, gas_limit } = chunk; + let PrepareTransactionsChunkContext { shard_id, gas_limit, .. } = chunk; let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(&prev_block.block_hash)?; let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?; @@ -777,23 +777,38 @@ impl RuntimeAdapter for NightshadeRuntime { usize::MAX }; - // In general, we limit the number of transactions via send_fees. - // However, as a second line of defense, we want to limit the byte size - // of transaction as well. Rather than introducing a separate config for - // the limit, we compute it heuristically from the gas limit and the - // cost of roundtripping a byte of data through disk. For today's value - // of parameters, this corresponds to about 13megs worth of - // transactions. - let size_limit = transactions_gas_limit - / (runtime_config.wasm_config.ext_costs.gas_cost(ExtCosts::storage_write_value_byte) - + runtime_config.wasm_config.ext_costs.gas_cost(ExtCosts::storage_read_value_byte)); + let size_limit: u64 = + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) { + // Sum of transactions in the previous and current chunks should not exceed the limit. + // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. + runtime_config + .max_transactions_size_in_witness + .saturating_sub(chunk.prev_chunk_transactions_size) as u64 + } else { + // In general, we limit the number of transactions via send_fees. + // However, as a second line of defense, we want to limit the byte size + // of transaction as well. Rather than introducing a separate config for + // the limit, we compute it heuristically from the gas limit and the + // cost of roundtripping a byte of data through disk. For today's value + // of parameters, this corresponds to about 13megs worth of + // transactions. + transactions_gas_limit + / (runtime_config + .wasm_config + .ext_costs + .gas_cost(ExtCosts::storage_write_value_byte) + + runtime_config + .wasm_config + .ext_costs + .gas_cost(ExtCosts::storage_read_value_byte)) + }; // for metrics only let mut rejected_due_to_congestion = 0; let mut rejected_invalid_tx = 0; let mut rejected_invalid_for_chain = 0; // Add new transactions to the result until some limit is hit or the transactions run out. - while let Some(transaction_group_iter) = transaction_groups.next() { + 'add_txs_loop: while let Some(transaction_group_iter) = transaction_groups.next() { if total_gas_burnt >= transactions_gas_limit { result.limited_by = Some(PrepareTransactionsLimit::Gas); break; @@ -820,8 +835,28 @@ impl RuntimeAdapter for NightshadeRuntime { } } + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) + && state_update.trie.recorded_storage_size() + > runtime_config.new_transactions_validation_state_size_soft_limit + { + result.limited_by = Some(PrepareTransactionsLimit::StorageProofSize); + break; + } + // Take a single transaction from this transaction group - while let Some(tx) = transaction_group_iter.next() { + while let Some(tx_peek) = transaction_group_iter.peek_next() { + // Stop adding transactions if the size limit would be exceeded + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) + && total_size.saturating_add(tx_peek.get_size()) > size_limit as u64 + { + result.limited_by = Some(PrepareTransactionsLimit::Size); + break 'add_txs_loop; + } + + // Take the transaction out of the pool + let tx = transaction_group_iter + .next() + .expect("peek_next() returned Some, so next() should return Some as well"); num_checked_transactions += 1; if ProtocolFeature::CongestionControl.enabled(protocol_version) { diff --git a/chain/chain/src/runtime/tests.rs b/chain/chain/src/runtime/tests.rs index 264b04d3a32..40b7a8852c2 100644 --- a/chain/chain/src/runtime/tests.rs +++ b/chain/chain/src/runtime/tests.rs @@ -1643,6 +1643,7 @@ fn prepare_transactions( PrepareTransactionsChunkContext { shard_id, gas_limit: env.runtime.genesis_config.gas_limit, + prev_chunk_transactions_size: 0, }, PrepareTransactionsBlockContext { next_gas_price: env.runtime.genesis_config.min_gas_price, diff --git a/chain/chain/src/types.rs b/chain/chain/src/types.rs index 518ab248503..70aaa4a3466 100644 --- a/chain/chain/src/types.rs +++ b/chain/chain/src/types.rs @@ -19,7 +19,6 @@ use near_primitives::merkle::{merklize, MerklePath}; use near_primitives::receipt::{PromiseYieldTimeout, Receipt}; use near_primitives::sandbox::state_patch::SandboxStatePatch; use near_primitives::shard_layout::{ShardLayout, ShardUId}; -use near_primitives::sharding::ShardChunkHeader; use near_primitives::state_part::PartId; use near_primitives::transaction::{ExecutionOutcomeWithId, SignedTransaction}; use near_primitives::types::validator_stake::{ValidatorStake, ValidatorStakeIter}; @@ -343,6 +342,7 @@ pub enum PrepareTransactionsLimit { Size, Time, ReceiptCount, + StorageProofSize, } pub struct PrepareTransactionsBlockContext { @@ -366,12 +366,7 @@ impl From<&Block> for PrepareTransactionsBlockContext { pub struct PrepareTransactionsChunkContext { pub shard_id: ShardId, pub gas_limit: Gas, -} - -impl From<&ShardChunkHeader> for PrepareTransactionsChunkContext { - fn from(header: &ShardChunkHeader) -> Self { - Self { shard_id: header.shard_id(), gas_limit: header.gas_limit() } - } + pub prev_chunk_transactions_size: usize, } /// Bridge between the chain and the runtime. diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index c3f789251e4..952b633ef21 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -898,8 +898,20 @@ impl Client { .get_chunk_extra(&prev_block_hash, &shard_uid) .map_err(|err| Error::ChunkProducer(format!("No chunk extra available: {}", err)))?; + let prev_shard_id = self.epoch_manager.get_prev_shard_id(prev_block.hash(), shard_id)?; + let prev_chunk: Option> = self + .chain + .get_header_of_last_existing_chunk( + *prev_block.hash(), + prev_shard_id, + self.epoch_manager.as_ref(), + )? + .map(|chunk_header| self.chain.get_chunk(&chunk_header.chunk_hash())) + .transpose()?; + let prev_chunk_ref: Option<&ShardChunk> = prev_chunk.as_ref().map(|x| x.as_ref()); + let prepared_transactions = - self.prepare_transactions(shard_uid, prev_block, chunk_extra.as_ref())?; + self.prepare_transactions(shard_uid, prev_block, prev_chunk_ref, chunk_extra.as_ref())?; #[cfg(feature = "test_features")] let prepared_transactions = Self::maybe_insert_invalid_transaction( prepared_transactions, @@ -1027,11 +1039,11 @@ impl Client { &mut self, shard_uid: ShardUId, prev_block: &Block, + prev_chunk_opt: Option<&ShardChunk>, chunk_extra: &ChunkExtra, ) -> Result { let Self { chain, sharded_tx_pool, runtime_adapter: runtime, .. } = self; let shard_id = shard_uid.shard_id as ShardId; - let prepared_transactions = if let Some(mut iter) = sharded_tx_pool.get_pool_iterator(shard_uid) { @@ -1041,9 +1053,21 @@ impl Client { source: StorageDataSource::Db, state_patch: Default::default(), }; + let prev_chunk_transactions_size = match prev_chunk_opt { + Some(prev_chunk) => borsh::to_vec(prev_chunk.transactions()) + .map_err(|e| { + Error::ChunkProducer(format!("Failed to serialize transactions: {e}")) + })? + .len(), + None => 0, + }; runtime.prepare_transactions( storage_config, - PrepareTransactionsChunkContext { shard_id, gas_limit: chunk_extra.gas_limit() }, + PrepareTransactionsChunkContext { + shard_id, + gas_limit: chunk_extra.gas_limit(), + prev_chunk_transactions_size, + }, prev_block.into(), &mut iter, &mut chain.transaction_validity_check(prev_block.header().clone()), diff --git a/chain/client/src/stateless_validation/chunk_validator/mod.rs b/chain/client/src/stateless_validation/chunk_validator/mod.rs index 0cc9197d485..2f3cc1eb6bd 100644 --- a/chain/client/src/stateless_validation/chunk_validator/mod.rs +++ b/chain/client/src/stateless_validation/chunk_validator/mod.rs @@ -14,8 +14,8 @@ use near_chain::chain::{ }; use near_chain::sharding::shuffle_receipt_proofs; use near_chain::types::{ - ApplyChunkBlockContext, ApplyChunkResult, PreparedTransactions, RuntimeAdapter, - RuntimeStorageConfig, StorageDataSource, + ApplyChunkBlockContext, ApplyChunkResult, PrepareTransactionsChunkContext, + PreparedTransactions, RuntimeAdapter, RuntimeStorageConfig, StorageDataSource, }; use near_chain::validate::{ validate_chunk_with_chunk_extra, validate_chunk_with_chunk_extra_and_receipts_root, @@ -214,6 +214,7 @@ pub(crate) fn validate_prepared_transactions( chain: &Chain, runtime_adapter: &dyn RuntimeAdapter, chunk_header: &ShardChunkHeader, + prev_chunk_transactions: &[SignedTransaction], storage_config: RuntimeStorageConfig, transactions: &[SignedTransaction], ) -> Result { @@ -221,7 +222,11 @@ pub(crate) fn validate_prepared_transactions( runtime_adapter.prepare_transactions( storage_config, - chunk_header.into(), + PrepareTransactionsChunkContext { + shard_id: chunk_header.shard_id(), + gas_limit: chunk_header.gas_limit(), + prev_chunk_transactions_size: borsh::to_vec(prev_chunk_transactions)?.len(), + }, (&parent_block).into(), &mut TransactionGroupIteratorWrapper::new(transactions), &mut chain.transaction_validity_check(parent_block.header().clone()), @@ -319,6 +324,7 @@ pub(crate) fn pre_validate_chunk_state_witness( chain, runtime_adapter, &state_witness.chunk_header, + &state_witness.transactions, transactions_validation_storage_config, &new_transactions, ) { diff --git a/chain/client/src/stateless_validation/shadow_validate.rs b/chain/client/src/stateless_validation/shadow_validate.rs index 34e1428227d..3e3baa906e3 100644 --- a/chain/client/src/stateless_validation/shadow_validate.rs +++ b/chain/client/src/stateless_validation/shadow_validate.rs @@ -53,6 +53,7 @@ impl Client { let shard_id = chunk.shard_id(); let chunk_hash = chunk.chunk_hash(); let chunk_header = chunk.cloned_header(); + let prev_chunk = self.chain.get_chunk(&prev_chunk_header.chunk_hash())?; let transactions_validation_storage_config = RuntimeStorageConfig { state_root: chunk_header.prev_state_root(), @@ -67,6 +68,7 @@ impl Client { &self.chain, self.runtime_adapter.as_ref(), &chunk_header, + prev_chunk.transactions(), transactions_validation_storage_config, chunk.transactions(), ) else { diff --git a/chain/pool/src/types.rs b/chain/pool/src/types.rs index d92640090fa..f79cfb346d3 100644 --- a/chain/pool/src/types.rs +++ b/chain/pool/src/types.rs @@ -36,4 +36,8 @@ impl TransactionGroup { None } } + + pub fn peek_next(&self) -> Option<&SignedTransaction> { + self.transactions.last() + } } From 06687685599210192e6c601bedde8100b6af3747 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Tue, 28 May 2024 10:47:26 +0000 Subject: [PATCH 04/21] Fix tests --- integration-tests/src/tests/client/benchmarks.rs | 14 ++++++++++++-- .../runtime-params-estimator/src/action_costs.rs | 8 ++++---- runtime/runtime-params-estimator/src/lib.rs | 10 +++++----- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/integration-tests/src/tests/client/benchmarks.rs b/integration-tests/src/tests/client/benchmarks.rs index ebd1860a628..0f9cde0c7ec 100644 --- a/integration-tests/src/tests/client/benchmarks.rs +++ b/integration-tests/src/tests/client/benchmarks.rs @@ -8,7 +8,9 @@ use near_chain_configs::Genesis; use near_client::test_utils::{create_chunk_on_height, TestEnv}; 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 nearcore::test_utils::TestEnvNightshadeSetupExt; /// How long does it take to produce a large chunk? @@ -24,7 +26,11 @@ fn benchmark_large_chunk_production_time() { let mb = 1024usize.pow(2); let n_txes = 20; - let tx_size = 3 * mb; + let tx_size = if checked_feature!("stable", WitnessTransactionLimits, PROTOCOL_VERSION) { + mb / 2 + } else { + 3 * mb + }; let genesis = Genesis::test(vec!["test0".parse().unwrap(), "test1".parse().unwrap()], 1); let mut env = TestEnv::builder(&genesis.config).nightshade_runtimes(&genesis).build(); @@ -56,5 +62,9 @@ fn benchmark_large_chunk_production_time() { // Check that we limit the size of the chunk and not include all `n_txes` // transactions in the chunk. - assert!(30 * mb < size && size < 40 * mb, "{size}"); + if checked_feature!("stable", WitnessTransactionLimits, PROTOCOL_VERSION) { + assert!(2 * mb < size && size < 4 * mb, "{size}"); + } else { + assert!(30 * mb < size && size < 40 * mb, "{size}"); + } } diff --git a/runtime/runtime-params-estimator/src/action_costs.rs b/runtime/runtime-params-estimator/src/action_costs.rs index 8184e9059a2..d886dd701df 100644 --- a/runtime/runtime-params-estimator/src/action_costs.rs +++ b/runtime/runtime-params-estimator/src/action_costs.rs @@ -791,8 +791,8 @@ impl ActionSize { // calling "noop" requires 4 bytes ActionSize::Min => 4, // max_arguments_length: 4_194_304 - // max_transaction_size: 4_194_304 - ActionSize::Max => (4_194_304 / 100) - 35, + // max_transaction_size: 1_572_864 + ActionSize::Max => (1_572_864 / 100) - 35, } } @@ -813,7 +813,7 @@ impl ActionSize { // fails with `InvalidTxError(TransactionSizeExceeded`, it could be a // protocol change due to the TX limit computation changing. // The test `test_deploy_contract_tx_max_size` checks this. - ActionSize::Max => 4 * 1024 * 1024 - 182, + ActionSize::Max => 1_572_864 - 182, } } } @@ -827,7 +827,7 @@ mod tests { fn test_deploy_contract_tx_max_size() { // The size of a transaction constructed from this must be exactly at the limit. let deploy_action = deploy_action(ActionSize::Max); - let limit = 4_194_304; + let limit = 1_572_864; // We also need some account IDs constructed the same way as in the estimator. // Let's try multiple index sizes to ensure this does not affect the length. diff --git a/runtime/runtime-params-estimator/src/lib.rs b/runtime/runtime-params-estimator/src/lib.rs index 22f7268c22a..60251a9b4af 100644 --- a/runtime/runtime-params-estimator/src/lib.rs +++ b/runtime/runtime-params-estimator/src/lib.rs @@ -719,13 +719,13 @@ fn pure_deploy_bytes(ctx: &mut EstimatorContext) -> GasCost { let config_store = RuntimeConfigStore::new(None); let vm_config = config_store.get_config(PROTOCOL_VERSION).wasm_config.clone(); let small_code = generate_data_only_contract(0, &vm_config); - let large_code = generate_data_only_contract(bytesize::mb(4u64) as usize, &vm_config); + let large_code = generate_data_only_contract(bytesize::kb(1500u64) as usize, &vm_config); let small_code_len = small_code.len(); let large_code_len = large_code.len(); let cost_empty = deploy_contract_cost(ctx, small_code, Some(b"main")); - let cost_4mb = deploy_contract_cost(ctx, large_code, Some(b"main")); + let cost_15mb = deploy_contract_cost(ctx, large_code, Some(b"main")); - (cost_4mb - cost_empty) / (large_code_len - small_code_len) as u64 + (cost_15mb - cost_empty) / (large_code_len - small_code_len) as u64 } /// Base cost for a fn call action, without receipt creation or contract loading. @@ -749,7 +749,7 @@ fn action_function_call_per_byte(ctx: &mut EstimatorContext) -> GasCost { // X values below 1M have a rather high variance. Therefore, use one small X // value and two larger values to fit a curve that gets the slope about // right. - let xs = [1, 1_000_000, 4_000_000]; + let xs = [1, 1_000_000, 1_500_000]; let ys: Vec = xs .iter() .map(|&arg_len| inner_action_function_call_per_byte(ctx, arg_len as usize)) @@ -800,7 +800,7 @@ fn function_call_per_storage_byte(ctx: &mut EstimatorContext) -> GasCost { let small_code = generate_data_only_contract(0, &vm_config); let small_cost = fn_cost_in_contract(ctx, "main", &small_code, n_actions); - let large_code = generate_data_only_contract(4_000_000, &vm_config); + let large_code = generate_data_only_contract(1_500_000, &vm_config); let large_cost = fn_cost_in_contract(ctx, "main", &large_code, n_actions); large_cost.saturating_sub(&small_cost, &NonNegativeTolerance::PER_MILLE) From 8792bfd6446b7393c1097cf85fe832d32658a6eb Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 11:49:28 +0000 Subject: [PATCH 05/21] Move tx size limit calculation to a helper method --- chain/chain/src/runtime/mod.rs | 60 ++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index fd31ca88920..345e6a21523 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -777,31 +777,12 @@ impl RuntimeAdapter for NightshadeRuntime { usize::MAX }; - let size_limit: u64 = - if checked_feature!("stable", WitnessTransactionLimits, protocol_version) { - // Sum of transactions in the previous and current chunks should not exceed the limit. - // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. - runtime_config - .max_transactions_size_in_witness - .saturating_sub(chunk.prev_chunk_transactions_size) as u64 - } else { - // In general, we limit the number of transactions via send_fees. - // However, as a second line of defense, we want to limit the byte size - // of transaction as well. Rather than introducing a separate config for - // the limit, we compute it heuristically from the gas limit and the - // cost of roundtripping a byte of data through disk. For today's value - // of parameters, this corresponds to about 13megs worth of - // transactions. - transactions_gas_limit - / (runtime_config - .wasm_config - .ext_costs - .gas_cost(ExtCosts::storage_write_value_byte) - + runtime_config - .wasm_config - .ext_costs - .gas_cost(ExtCosts::storage_read_value_byte)) - }; + let size_limit: u64 = calculate_transactions_size_limit( + protocol_version, + &runtime_config, + chunk.prev_chunk_transactions_size, + transactions_gas_limit, + ); // for metrics only let mut rejected_due_to_congestion = 0; let mut rejected_invalid_tx = 0; @@ -1390,6 +1371,35 @@ fn chunk_tx_gas_limit( } } +fn calculate_transactions_size_limit( + protocol_version: ProtocolVersion, + runtime_config: &RuntimeConfig, + prev_chunk_transactions_size: usize, + transactions_gas_limit: Gas, +) -> u64 { + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) { + // Sum of transactions in the previous and current chunks should not exceed the limit. + // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. + runtime_config + .max_transactions_size_in_witness + .saturating_sub(prev_chunk_transactions_size) + .try_into() + .expect("Can't convert usize to u64!") + } else { + // In general, we limit the number of transactions via send_fees. + // However, as a second line of defense, we want to limit the byte size + // of transaction as well. Rather than introducing a separate config for + // the limit, we compute it heuristically from the gas limit and the + // cost of roundtripping a byte of data through disk. For today's value + // of parameters, this corresponds to about 13megs worth of + // transactions. + let roundtripping_cost = + runtime_config.wasm_config.ext_costs.gas_cost(ExtCosts::storage_write_value_byte) + + runtime_config.wasm_config.ext_costs.gas_cost(ExtCosts::storage_read_value_byte); + transactions_gas_limit / roundtripping_cost + } +} + impl node_runtime::adapter::ViewRuntimeAdapter for NightshadeRuntime { fn view_account( &self, From dfa5f3f01ac7a33101b372a2eb6ac4977d096add Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 11:52:37 +0000 Subject: [PATCH 06/21] Multiline getting previous chunk --- chain/client/src/client.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index 952b633ef21..b66f807272e 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -899,14 +899,14 @@ impl Client { .map_err(|err| Error::ChunkProducer(format!("No chunk extra available: {}", err)))?; let prev_shard_id = self.epoch_manager.get_prev_shard_id(prev_block.hash(), shard_id)?; - let prev_chunk: Option> = self - .chain - .get_header_of_last_existing_chunk( + let prev_chunk_header: Option = + self.chain.get_header_of_last_existing_chunk( *prev_block.hash(), prev_shard_id, self.epoch_manager.as_ref(), - )? - .map(|chunk_header| self.chain.get_chunk(&chunk_header.chunk_hash())) + )?; + let prev_chunk: Option> = prev_chunk_header + .map(|header| self.chain.get_chunk(&header.chunk_hash())) .transpose()?; let prev_chunk_ref: Option<&ShardChunk> = prev_chunk.as_ref().map(|x| x.as_ref()); From b433e0edd1a7aaf5fb3b143c192671405e99d3af Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 11:56:08 +0000 Subject: [PATCH 07/21] Rename prev_chunk to last_chunk --- chain/chain/src/runtime/mod.rs | 6 +++--- chain/chain/src/runtime/tests.rs | 2 +- chain/chain/src/types.rs | 2 +- chain/client/src/client.rs | 14 +++++++------- .../stateless_validation/chunk_validator/mod.rs | 4 ++-- .../src/stateless_validation/shadow_validate.rs | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index 345e6a21523..1792e392442 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -780,7 +780,7 @@ impl RuntimeAdapter for NightshadeRuntime { let size_limit: u64 = calculate_transactions_size_limit( protocol_version, &runtime_config, - chunk.prev_chunk_transactions_size, + chunk.last_chunk_transactions_size, transactions_gas_limit, ); // for metrics only @@ -1374,7 +1374,7 @@ fn chunk_tx_gas_limit( fn calculate_transactions_size_limit( protocol_version: ProtocolVersion, runtime_config: &RuntimeConfig, - prev_chunk_transactions_size: usize, + last_chunk_transactions_size: usize, transactions_gas_limit: Gas, ) -> u64 { if checked_feature!("stable", WitnessTransactionLimits, protocol_version) { @@ -1382,7 +1382,7 @@ fn calculate_transactions_size_limit( // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. runtime_config .max_transactions_size_in_witness - .saturating_sub(prev_chunk_transactions_size) + .saturating_sub(last_chunk_transactions_size) .try_into() .expect("Can't convert usize to u64!") } else { diff --git a/chain/chain/src/runtime/tests.rs b/chain/chain/src/runtime/tests.rs index 40b7a8852c2..6fe397e41d2 100644 --- a/chain/chain/src/runtime/tests.rs +++ b/chain/chain/src/runtime/tests.rs @@ -1643,7 +1643,7 @@ fn prepare_transactions( PrepareTransactionsChunkContext { shard_id, gas_limit: env.runtime.genesis_config.gas_limit, - prev_chunk_transactions_size: 0, + last_chunk_transactions_size: 0, }, PrepareTransactionsBlockContext { next_gas_price: env.runtime.genesis_config.min_gas_price, diff --git a/chain/chain/src/types.rs b/chain/chain/src/types.rs index 70aaa4a3466..55e8fab6623 100644 --- a/chain/chain/src/types.rs +++ b/chain/chain/src/types.rs @@ -366,7 +366,7 @@ impl From<&Block> for PrepareTransactionsBlockContext { pub struct PrepareTransactionsChunkContext { pub shard_id: ShardId, pub gas_limit: Gas, - pub prev_chunk_transactions_size: usize, + pub last_chunk_transactions_size: usize, } /// Bridge between the chain and the runtime. diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index b66f807272e..4b0fb802def 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -899,19 +899,19 @@ impl Client { .map_err(|err| Error::ChunkProducer(format!("No chunk extra available: {}", err)))?; let prev_shard_id = self.epoch_manager.get_prev_shard_id(prev_block.hash(), shard_id)?; - let prev_chunk_header: Option = + let last_chunk_header: Option = self.chain.get_header_of_last_existing_chunk( *prev_block.hash(), prev_shard_id, self.epoch_manager.as_ref(), )?; - let prev_chunk: Option> = prev_chunk_header + let last_chunk: Option> = last_chunk_header .map(|header| self.chain.get_chunk(&header.chunk_hash())) .transpose()?; - let prev_chunk_ref: Option<&ShardChunk> = prev_chunk.as_ref().map(|x| x.as_ref()); + let last_chunk_ref: Option<&ShardChunk> = last_chunk.as_ref().map(|x| x.as_ref()); let prepared_transactions = - self.prepare_transactions(shard_uid, prev_block, prev_chunk_ref, chunk_extra.as_ref())?; + self.prepare_transactions(shard_uid, prev_block, last_chunk_ref, chunk_extra.as_ref())?; #[cfg(feature = "test_features")] let prepared_transactions = Self::maybe_insert_invalid_transaction( prepared_transactions, @@ -1039,7 +1039,7 @@ impl Client { &mut self, shard_uid: ShardUId, prev_block: &Block, - prev_chunk_opt: Option<&ShardChunk>, + last_chunk_opt: Option<&ShardChunk>, chunk_extra: &ChunkExtra, ) -> Result { let Self { chain, sharded_tx_pool, runtime_adapter: runtime, .. } = self; @@ -1053,7 +1053,7 @@ impl Client { source: StorageDataSource::Db, state_patch: Default::default(), }; - let prev_chunk_transactions_size = match prev_chunk_opt { + let last_chunk_transactions_size = match last_chunk_opt { Some(prev_chunk) => borsh::to_vec(prev_chunk.transactions()) .map_err(|e| { Error::ChunkProducer(format!("Failed to serialize transactions: {e}")) @@ -1066,7 +1066,7 @@ impl Client { PrepareTransactionsChunkContext { shard_id, gas_limit: chunk_extra.gas_limit(), - prev_chunk_transactions_size, + last_chunk_transactions_size, }, prev_block.into(), &mut iter, diff --git a/chain/client/src/stateless_validation/chunk_validator/mod.rs b/chain/client/src/stateless_validation/chunk_validator/mod.rs index 2f3cc1eb6bd..9a830a4631c 100644 --- a/chain/client/src/stateless_validation/chunk_validator/mod.rs +++ b/chain/client/src/stateless_validation/chunk_validator/mod.rs @@ -214,7 +214,7 @@ pub(crate) fn validate_prepared_transactions( chain: &Chain, runtime_adapter: &dyn RuntimeAdapter, chunk_header: &ShardChunkHeader, - prev_chunk_transactions: &[SignedTransaction], + last_chunk_transactions: &[SignedTransaction], storage_config: RuntimeStorageConfig, transactions: &[SignedTransaction], ) -> Result { @@ -225,7 +225,7 @@ pub(crate) fn validate_prepared_transactions( PrepareTransactionsChunkContext { shard_id: chunk_header.shard_id(), gas_limit: chunk_header.gas_limit(), - prev_chunk_transactions_size: borsh::to_vec(prev_chunk_transactions)?.len(), + last_chunk_transactions_size: borsh::to_vec(last_chunk_transactions)?.len(), }, (&parent_block).into(), &mut TransactionGroupIteratorWrapper::new(transactions), diff --git a/chain/client/src/stateless_validation/shadow_validate.rs b/chain/client/src/stateless_validation/shadow_validate.rs index 3e3baa906e3..c83c21218cc 100644 --- a/chain/client/src/stateless_validation/shadow_validate.rs +++ b/chain/client/src/stateless_validation/shadow_validate.rs @@ -53,7 +53,7 @@ impl Client { let shard_id = chunk.shard_id(); let chunk_hash = chunk.chunk_hash(); let chunk_header = chunk.cloned_header(); - let prev_chunk = self.chain.get_chunk(&prev_chunk_header.chunk_hash())?; + let last_chunk = self.chain.get_chunk(&prev_chunk_header.chunk_hash())?; let transactions_validation_storage_config = RuntimeStorageConfig { state_root: chunk_header.prev_state_root(), @@ -68,7 +68,7 @@ impl Client { &self.chain, self.runtime_adapter.as_ref(), &chunk_header, - prev_chunk.transactions(), + last_chunk.transactions(), transactions_validation_storage_config, chunk.transactions(), ) else { From 88f22c4f5d83c4c55765ae1931f6dbf286e8ee8b Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 11:57:44 +0000 Subject: [PATCH 08/21] Add a comment on last_chunk_transactions_size --- chain/chain/src/types.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chain/chain/src/types.rs b/chain/chain/src/types.rs index 55e8fab6623..736b3279e33 100644 --- a/chain/chain/src/types.rs +++ b/chain/chain/src/types.rs @@ -366,6 +366,8 @@ impl From<&Block> for PrepareTransactionsBlockContext { pub struct PrepareTransactionsChunkContext { pub shard_id: ShardId, pub gas_limit: Gas, + /// Size of transactions added in the last existing chunk. + /// Used to calculate the allowed size of transactions in a newly produced chunk. pub last_chunk_transactions_size: usize, } From 9f7bc035f13727aa3e2db37fa88b54759ed3d246 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 12:57:23 +0000 Subject: [PATCH 09/21] Reorder arguments of validate_prepared_transactions --- chain/client/src/stateless_validation/chunk_validator/mod.rs | 4 ++-- chain/client/src/stateless_validation/shadow_validate.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/client/src/stateless_validation/chunk_validator/mod.rs b/chain/client/src/stateless_validation/chunk_validator/mod.rs index 9a830a4631c..09be05e6c5b 100644 --- a/chain/client/src/stateless_validation/chunk_validator/mod.rs +++ b/chain/client/src/stateless_validation/chunk_validator/mod.rs @@ -214,9 +214,9 @@ pub(crate) fn validate_prepared_transactions( chain: &Chain, runtime_adapter: &dyn RuntimeAdapter, chunk_header: &ShardChunkHeader, - last_chunk_transactions: &[SignedTransaction], storage_config: RuntimeStorageConfig, transactions: &[SignedTransaction], + last_chunk_transactions: &[SignedTransaction], ) -> Result { let parent_block = chain.chain_store().get_block(chunk_header.prev_block_hash())?; @@ -324,9 +324,9 @@ pub(crate) fn pre_validate_chunk_state_witness( chain, runtime_adapter, &state_witness.chunk_header, - &state_witness.transactions, transactions_validation_storage_config, &new_transactions, + &state_witness.transactions, ) { Ok(result) => { if result.transactions.len() != new_transactions.len() { diff --git a/chain/client/src/stateless_validation/shadow_validate.rs b/chain/client/src/stateless_validation/shadow_validate.rs index c83c21218cc..9c9af834788 100644 --- a/chain/client/src/stateless_validation/shadow_validate.rs +++ b/chain/client/src/stateless_validation/shadow_validate.rs @@ -68,9 +68,9 @@ impl Client { &self.chain, self.runtime_adapter.as_ref(), &chunk_header, - last_chunk.transactions(), transactions_validation_storage_config, chunk.transactions(), + last_chunk.transactions(), ) else { return Err(Error::Other( "Could not produce storage proof for new transactions".to_owned(), From 2dd7ec389ba91337cb60c57e6df288ddfedeea6d Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 12:58:18 +0000 Subject: [PATCH 10/21] temp variable for last_chunk_transactions_size --- chain/client/src/stateless_validation/chunk_validator/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/client/src/stateless_validation/chunk_validator/mod.rs b/chain/client/src/stateless_validation/chunk_validator/mod.rs index 09be05e6c5b..999d05feaaf 100644 --- a/chain/client/src/stateless_validation/chunk_validator/mod.rs +++ b/chain/client/src/stateless_validation/chunk_validator/mod.rs @@ -219,13 +219,13 @@ pub(crate) fn validate_prepared_transactions( last_chunk_transactions: &[SignedTransaction], ) -> Result { let parent_block = chain.chain_store().get_block(chunk_header.prev_block_hash())?; - + let last_chunk_transactions_size = borsh::to_vec(last_chunk_transactions)?.len(); runtime_adapter.prepare_transactions( storage_config, PrepareTransactionsChunkContext { shard_id: chunk_header.shard_id(), gas_limit: chunk_header.gas_limit(), - last_chunk_transactions_size: borsh::to_vec(last_chunk_transactions)?.len(), + last_chunk_transactions_size, }, (&parent_block).into(), &mut TransactionGroupIteratorWrapper::new(transactions), From fe56c83a11a9e1f2654a9bfad060e1c4dd5ec641 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:00:42 +0000 Subject: [PATCH 11/21] better comment on max_transactions_size_in_witness --- core/parameters/src/config.rs | 2 ++ core/parameters/src/parameter.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index 0d372029994..4e0b5790d09 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -32,6 +32,8 @@ pub struct RuntimeConfig { /// The configuration for congestion control. pub congestion_control_config: CongestionControlConfig, /// Maxmium size of transactions contained inside ChunkStateWitness. + /// A witness contains transactions from both the previous chunk and the current one. + /// This parameter limits the sum of sizes of transactions from both chunks. pub max_transactions_size_in_witness: usize, /// Soft size limit of new transactions storage proof inside ChunkStateWitness. pub new_transactions_validation_state_size_soft_limit: usize, diff --git a/core/parameters/src/parameter.rs b/core/parameters/src/parameter.rs index 879e82c72e8..1a96952ef02 100644 --- a/core/parameters/src/parameter.rs +++ b/core/parameters/src/parameter.rs @@ -25,6 +25,8 @@ pub enum Parameter { // Hard per-receipt limit of recorded trie storage proof StorageProofSizeReceiptLimit, // Maxmium size of transactions contained inside ChunkStateWitness. + // A witness contains transactions from both the previous chunk and the current one. + // This parameter limits the sum of sizes of transactions from both chunks. MaxTransactionsSizeInWitness, // Soft size limit of new transactions storage proof inside ChunkStateWitness. NewTransactionsValidationStateSizeSoftLimit, From 2d2f88362a4e86d075b16316f6cf3a79b73f18a3 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:06:54 +0000 Subject: [PATCH 12/21] Fix Maxmium typo --- core/parameters/src/config.rs | 2 +- core/parameters/src/parameter.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index 4e0b5790d09..cc85ed5d7b9 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -31,7 +31,7 @@ pub struct RuntimeConfig { pub storage_proof_size_soft_limit: usize, /// The configuration for congestion control. pub congestion_control_config: CongestionControlConfig, - /// Maxmium size of transactions contained inside ChunkStateWitness. + /// Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. /// This parameter limits the sum of sizes of transactions from both chunks. pub max_transactions_size_in_witness: usize, diff --git a/core/parameters/src/parameter.rs b/core/parameters/src/parameter.rs index 1a96952ef02..d156021296d 100644 --- a/core/parameters/src/parameter.rs +++ b/core/parameters/src/parameter.rs @@ -24,7 +24,7 @@ pub enum Parameter { StorageProofSizeSoftLimit, // Hard per-receipt limit of recorded trie storage proof StorageProofSizeReceiptLimit, - // Maxmium size of transactions contained inside ChunkStateWitness. + // Maximum size of transactions contained inside ChunkStateWitness. // A witness contains transactions from both the previous chunk and the current one. // This parameter limits the sum of sizes of transactions from both chunks. MaxTransactionsSizeInWitness, From 579515f9151363e65e82c03e74366e1dcc7510c5 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:09:23 +0000 Subject: [PATCH 13/21] Rename cost_15mb to cost_max --- runtime/runtime-params-estimator/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/runtime-params-estimator/src/lib.rs b/runtime/runtime-params-estimator/src/lib.rs index 60251a9b4af..10a38182170 100644 --- a/runtime/runtime-params-estimator/src/lib.rs +++ b/runtime/runtime-params-estimator/src/lib.rs @@ -723,9 +723,9 @@ fn pure_deploy_bytes(ctx: &mut EstimatorContext) -> GasCost { let small_code_len = small_code.len(); let large_code_len = large_code.len(); let cost_empty = deploy_contract_cost(ctx, small_code, Some(b"main")); - let cost_15mb = deploy_contract_cost(ctx, large_code, Some(b"main")); + let cost_max = deploy_contract_cost(ctx, large_code, Some(b"main")); - (cost_15mb - cost_empty) / (large_code_len - small_code_len) as u64 + (cost_max - cost_empty) / (large_code_len - small_code_len) as u64 } /// Base cost for a fn call action, without receipt creation or contract loading. From 7574a58c4a107d0facd3d6c25589e1f4ca93fd3f Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:15:55 +0000 Subject: [PATCH 14/21] Don't calculate transaction size on older protocol versions --- chain/client/src/client.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index 4b0fb802def..fc66405b49c 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -76,11 +76,11 @@ use near_primitives::sharding::{ use near_primitives::transaction::SignedTransaction; use near_primitives::types::chunk_extra::ChunkExtra; use near_primitives::types::{AccountId, ApprovalStake, BlockHeight, EpochId, NumBlocks, ShardId}; -use near_primitives::unwrap_or_return; use near_primitives::utils::MaybeValidated; use near_primitives::validator_signer::ValidatorSigner; use near_primitives::version::PROTOCOL_VERSION; use near_primitives::views::{CatchupStatusView, DroppedReason}; +use near_primitives::{checked_feature, unwrap_or_return}; use near_store::ShardUId; use reed_solomon_erasure::galois_8::ReedSolomon; use std::cmp::max; @@ -1053,13 +1053,19 @@ impl Client { source: StorageDataSource::Db, state_patch: Default::default(), }; + let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(&prev_block.hash())?; + let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?; let last_chunk_transactions_size = match last_chunk_opt { - Some(prev_chunk) => borsh::to_vec(prev_chunk.transactions()) - .map_err(|e| { - Error::ChunkProducer(format!("Failed to serialize transactions: {e}")) - })? - .len(), - None => 0, + Some(prev_chunk) + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) => + { + borsh::to_vec(prev_chunk.transactions()) + .map_err(|e| { + Error::ChunkProducer(format!("Failed to serialize transactions: {e}")) + })? + .len() + } + _ => 0, }; runtime.prepare_transactions( storage_config, From f55bd337bdc82be19f28d49479bca55b4a1bddcb Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:19:50 +0000 Subject: [PATCH 15/21] remove get_header_of_last_existing_chunk --- chain/chain/src/chain.rs | 32 -------------------------------- chain/client/src/client.rs | 6 +----- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs index cd960938ea6..72787e82b85 100644 --- a/chain/chain/src/chain.rs +++ b/chain/chain/src/chain.rs @@ -4454,38 +4454,6 @@ impl Chain { }) .collect() } - - /// Find the last existing (not missing) chunk on this shard id. - pub fn get_header_of_last_existing_chunk( - &self, - last_block: CryptoHash, - shard_id: ShardId, - epoch_manager: &dyn EpochManagerAdapter, - ) -> Result, Error> { - let mut cur_block_hash = last_block; - let mut shard_id = shard_id; - loop { - let cur_block_header = self.get_block_header(&cur_block_hash)?; - if cur_block_header.is_genesis() { - return Ok(None); - } - if *cur_block_header - .chunk_mask() - .get(shard_id as usize) - .ok_or_else(|| Error::InvalidShardId(shard_id))? - { - let cur_block = self.get_block(&cur_block_hash)?; - let result = cur_block - .chunks() - .get(shard_id as usize) - .ok_or_else(|| Error::InvalidShardId(shard_id))? - .clone(); - return Ok(Some(result)); - } - cur_block_hash = *cur_block_header.prev_hash(); - shard_id = epoch_manager.get_prev_shard_id(&cur_block_hash, shard_id)?; - } - } } /// Sandbox node specific operations diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index fc66405b49c..dbffaa580f5 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -900,11 +900,7 @@ impl Client { let prev_shard_id = self.epoch_manager.get_prev_shard_id(prev_block.hash(), shard_id)?; let last_chunk_header: Option = - self.chain.get_header_of_last_existing_chunk( - *prev_block.hash(), - prev_shard_id, - self.epoch_manager.as_ref(), - )?; + prev_block.chunks().get(prev_shard_id as usize).cloned(); let last_chunk: Option> = last_chunk_header .map(|header| self.chain.get_chunk(&header.chunk_hash())) .transpose()?; From d6750d06adb1c3662f453f3615ba957b17ae1c8a Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:48:06 +0000 Subject: [PATCH 16/21] Use limit_config for large_code size --- runtime/runtime-params-estimator/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/runtime-params-estimator/src/lib.rs b/runtime/runtime-params-estimator/src/lib.rs index 10a38182170..72fcb92f9bf 100644 --- a/runtime/runtime-params-estimator/src/lib.rs +++ b/runtime/runtime-params-estimator/src/lib.rs @@ -719,7 +719,10 @@ fn pure_deploy_bytes(ctx: &mut EstimatorContext) -> GasCost { let config_store = RuntimeConfigStore::new(None); let vm_config = config_store.get_config(PROTOCOL_VERSION).wasm_config.clone(); let small_code = generate_data_only_contract(0, &vm_config); - let large_code = generate_data_only_contract(bytesize::kb(1500u64) as usize, &vm_config); + let large_code = generate_data_only_contract( + vm_config.limit_config.max_transaction_size as usize - 2000, + &vm_config, + ); let small_code_len = small_code.len(); let large_code_len = large_code.len(); let cost_empty = deploy_contract_cost(ctx, small_code, Some(b"main")); From 52f5058950b4b5e1b5c4c7e92398c987a8e3c8e1 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 13:51:51 +0000 Subject: [PATCH 17/21] make prev_chunk non-optional --- chain/client/src/client.rs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index dbffaa580f5..73740362752 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -899,15 +899,16 @@ impl Client { .map_err(|err| Error::ChunkProducer(format!("No chunk extra available: {}", err)))?; let prev_shard_id = self.epoch_manager.get_prev_shard_id(prev_block.hash(), shard_id)?; - let last_chunk_header: Option = - prev_block.chunks().get(prev_shard_id as usize).cloned(); - let last_chunk: Option> = last_chunk_header - .map(|header| self.chain.get_chunk(&header.chunk_hash())) - .transpose()?; - let last_chunk_ref: Option<&ShardChunk> = last_chunk.as_ref().map(|x| x.as_ref()); - + let last_chunk_header = + prev_block.chunks().get(prev_shard_id as usize).cloned().ok_or_else(|| { + Error::ChunkProducer(format!( + "No last chunk in prev_block_hash {:?}, prev_shard_id: {}", + prev_block_hash, prev_shard_id + )) + })?; + let last_chunk = self.chain.get_chunk(&last_chunk_header.chunk_hash())?; let prepared_transactions = - self.prepare_transactions(shard_uid, prev_block, last_chunk_ref, chunk_extra.as_ref())?; + self.prepare_transactions(shard_uid, prev_block, &last_chunk, chunk_extra.as_ref())?; #[cfg(feature = "test_features")] let prepared_transactions = Self::maybe_insert_invalid_transaction( prepared_transactions, @@ -1035,7 +1036,7 @@ impl Client { &mut self, shard_uid: ShardUId, prev_block: &Block, - last_chunk_opt: Option<&ShardChunk>, + last_chunk: &ShardChunk, chunk_extra: &ChunkExtra, ) -> Result { let Self { chain, sharded_tx_pool, runtime_adapter: runtime, .. } = self; @@ -1051,18 +1052,16 @@ impl Client { }; let epoch_id = self.epoch_manager.get_epoch_id_from_prev_block(&prev_block.hash())?; let protocol_version = self.epoch_manager.get_epoch_protocol_version(&epoch_id)?; - let last_chunk_transactions_size = match last_chunk_opt { - Some(prev_chunk) - if checked_feature!("stable", WitnessTransactionLimits, protocol_version) => - { - borsh::to_vec(prev_chunk.transactions()) + let last_chunk_transactions_size = + if checked_feature!("stable", WitnessTransactionLimits, protocol_version) { + borsh::to_vec(last_chunk.transactions()) .map_err(|e| { Error::ChunkProducer(format!("Failed to serialize transactions: {e}")) })? .len() - } - _ => 0, - }; + } else { + 0 + }; runtime.prepare_transactions( storage_config, PrepareTransactionsChunkContext { From cead630da20eac982581756e7493a9a892fb7b5b Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 15:54:24 +0000 Subject: [PATCH 18/21] Use three slashes for documentation --- core/parameters/src/parameter.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/parameters/src/parameter.rs b/core/parameters/src/parameter.rs index d156021296d..0850c7d968f 100644 --- a/core/parameters/src/parameter.rs +++ b/core/parameters/src/parameter.rs @@ -20,15 +20,15 @@ pub enum Parameter { BurntGasReward, PessimisticGasPriceInflation, - // Stateless validation config + /// Stateless validation config StorageProofSizeSoftLimit, - // Hard per-receipt limit of recorded trie storage proof + /// Hard per-receipt limit of recorded trie storage proof StorageProofSizeReceiptLimit, - // Maximum size of transactions contained inside ChunkStateWitness. - // A witness contains transactions from both the previous chunk and the current one. - // This parameter limits the sum of sizes of transactions from both chunks. + /// Maximum size of transactions contained inside ChunkStateWitness. + /// A witness contains transactions from both the previous chunk and the current one. + /// This parameter limits the sum of sizes of transactions from both chunks. MaxTransactionsSizeInWitness, - // Soft size limit of new transactions storage proof inside ChunkStateWitness. + /// Soft size limit of new transactions storage proof inside ChunkStateWitness. NewTransactionsValidationStateSizeSoftLimit, // Account creation config From ff39b868b1d995ac4e9f1c5a08ff8249e7288d6f Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 17:23:30 +0000 Subject: [PATCH 19/21] Add RuntimeConfig::witness_config and move witness limits there --- chain/chain/src/runtime/mod.rs | 5 ++- core/parameters/src/config.rs | 33 ++++++++++--------- core/parameters/src/parameter_table.rs | 14 ++++---- ...rameters__config_store__tests__0.json.snap | 8 +++-- ...meters__config_store__tests__129.json.snap | 8 +++-- ...meters__config_store__tests__138.json.snap | 8 +++-- ...meters__config_store__tests__142.json.snap | 8 +++-- ...ameters__config_store__tests__35.json.snap | 8 +++-- ...ameters__config_store__tests__42.json.snap | 8 +++-- ...ameters__config_store__tests__46.json.snap | 8 +++-- ...ameters__config_store__tests__48.json.snap | 8 +++-- ...ameters__config_store__tests__49.json.snap | 8 +++-- ...ameters__config_store__tests__50.json.snap | 8 +++-- ...ameters__config_store__tests__52.json.snap | 8 +++-- ...ameters__config_store__tests__53.json.snap | 8 +++-- ...ameters__config_store__tests__55.json.snap | 8 +++-- ...ameters__config_store__tests__57.json.snap | 8 +++-- ...ameters__config_store__tests__59.json.snap | 8 +++-- ...ameters__config_store__tests__61.json.snap | 8 +++-- ...ameters__config_store__tests__62.json.snap | 8 +++-- ...ameters__config_store__tests__63.json.snap | 8 +++-- ...ameters__config_store__tests__64.json.snap | 8 +++-- ...ameters__config_store__tests__66.json.snap | 8 +++-- ...ameters__config_store__tests__67.json.snap | 8 +++-- ...ameters__config_store__tests__83.json.snap | 8 +++-- ...ameters__config_store__tests__85.json.snap | 8 +++-- ...ameters__config_store__tests__87.json.snap | 8 +++-- ...__config_store__tests__testnet_0.json.snap | 8 +++-- ...config_store__tests__testnet_129.json.snap | 8 +++-- ...config_store__tests__testnet_138.json.snap | 8 +++-- ...config_store__tests__testnet_142.json.snap | 8 +++-- ..._config_store__tests__testnet_35.json.snap | 8 +++-- ..._config_store__tests__testnet_42.json.snap | 8 +++-- ..._config_store__tests__testnet_46.json.snap | 8 +++-- ..._config_store__tests__testnet_48.json.snap | 8 +++-- ..._config_store__tests__testnet_49.json.snap | 8 +++-- ..._config_store__tests__testnet_50.json.snap | 8 +++-- ..._config_store__tests__testnet_52.json.snap | 8 +++-- ..._config_store__tests__testnet_53.json.snap | 8 +++-- ..._config_store__tests__testnet_55.json.snap | 8 +++-- ..._config_store__tests__testnet_57.json.snap | 8 +++-- ..._config_store__tests__testnet_59.json.snap | 8 +++-- ..._config_store__tests__testnet_61.json.snap | 8 +++-- ..._config_store__tests__testnet_62.json.snap | 8 +++-- ..._config_store__tests__testnet_63.json.snap | 8 +++-- ..._config_store__tests__testnet_64.json.snap | 8 +++-- ..._config_store__tests__testnet_66.json.snap | 8 +++-- ..._config_store__tests__testnet_67.json.snap | 8 +++-- ..._config_store__tests__testnet_83.json.snap | 8 +++-- ..._config_store__tests__testnet_85.json.snap | 8 +++-- ..._config_store__tests__testnet_87.json.snap | 8 +++-- ...ers__view__tests__runtime_config_view.snap | 8 +++-- core/parameters/src/view.rs | 32 +++++++++++++++--- ...es__views__tests__runtime_config_view.snap | 8 +++-- .../src/costs_to_runtime_config.rs | 5 +-- runtime/runtime/src/lib.rs | 4 +-- 56 files changed, 360 insertions(+), 133 deletions(-) diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index 1792e392442..d65ad76733a 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -818,7 +818,9 @@ impl RuntimeAdapter for NightshadeRuntime { if checked_feature!("stable", WitnessTransactionLimits, protocol_version) && state_update.trie.recorded_storage_size() - > runtime_config.new_transactions_validation_state_size_soft_limit + > runtime_config + .witness_config + .new_transactions_validation_state_size_soft_limit { result.limited_by = Some(PrepareTransactionsLimit::StorageProofSize); break; @@ -1381,6 +1383,7 @@ fn calculate_transactions_size_limit( // Sum of transactions in the previous and current chunks should not exceed the limit. // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. runtime_config + .witness_config .max_transactions_size_in_witness .saturating_sub(last_chunk_transactions_size) .try_into() diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index cc85ed5d7b9..627d1f6b7a6 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -27,16 +27,10 @@ pub struct RuntimeConfig { pub wasm_config: crate::vm::Config, /// Config that defines rules for account creation. pub account_creation_config: AccountCreationConfig, - /// The maximum size of the storage proof in state witness after which we defer execution of any new receipts. - pub storage_proof_size_soft_limit: usize, /// The configuration for congestion control. pub congestion_control_config: CongestionControlConfig, - /// Maximum size of transactions contained inside ChunkStateWitness. - /// A witness contains transactions from both the previous chunk and the current one. - /// This parameter limits the sum of sizes of transactions from both chunks. - pub max_transactions_size_in_witness: usize, - /// Soft size limit of new transactions storage proof inside ChunkStateWitness. - pub new_transactions_validation_state_size_soft_limit: usize, + /// Configuration specific to ChunkStateWitness. + pub witness_config: WitnessConfig, } impl RuntimeConfig { @@ -63,11 +57,8 @@ impl RuntimeConfig { fees: RuntimeFeesConfig::test(), wasm_config, account_creation_config: AccountCreationConfig::default(), - storage_proof_size_soft_limit: usize::MAX, congestion_control_config: runtime_config.congestion_control_config, - max_transactions_size_in_witness: runtime_config.max_transactions_size_in_witness, - new_transactions_validation_state_size_soft_limit: runtime_config - .new_transactions_validation_state_size_soft_limit, + witness_config: runtime_config.witness_config, } } @@ -82,11 +73,8 @@ impl RuntimeConfig { fees: RuntimeFeesConfig::free(), wasm_config, account_creation_config: AccountCreationConfig::default(), - storage_proof_size_soft_limit: usize::MAX, congestion_control_config: runtime_config.congestion_control_config, - max_transactions_size_in_witness: runtime_config.max_transactions_size_in_witness, - new_transactions_validation_state_size_soft_limit: runtime_config - .new_transactions_validation_state_size_soft_limit, + witness_config: runtime_config.witness_config, } } @@ -220,3 +208,16 @@ impl CongestionControlConfig { } } } + +/// Configuration specific to ChunkStateWitness. +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct WitnessConfig { + /// The maximum size of the storage proof in state witness after which we defer execution of any new receipts. + pub storage_proof_size_soft_limit: usize, + /// Maximum size of transactions contained inside ChunkStateWitness. + /// A witness contains transactions from both the previous chunk and the current one. + /// This parameter limits the sum of sizes of transactions from both chunks. + pub max_transactions_size_in_witness: usize, + /// Soft size limit of new transactions storage proof inside ChunkStateWitness. + pub new_transactions_validation_state_size_soft_limit: usize, +} diff --git a/core/parameters/src/parameter_table.rs b/core/parameters/src/parameter_table.rs index 3beac4fa626..4ef103f384a 100644 --- a/core/parameters/src/parameter_table.rs +++ b/core/parameters/src/parameter_table.rs @@ -1,5 +1,5 @@ use super::config::{AccountCreationConfig, RuntimeConfig}; -use crate::config::CongestionControlConfig; +use crate::config::{CongestionControlConfig, WitnessConfig}; use crate::cost::{ ActionCosts, ExtCostsConfig, Fee, ParameterCost, RuntimeFeesConfig, StorageUsageConfig, }; @@ -333,12 +333,14 @@ impl TryFrom<&ParameterTable> for RuntimeConfig { .get(Parameter::MinAllowedTopLevelAccountLength)?, registrar_account_id: params.get(Parameter::RegistrarAccountId)?, }, - storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?, - max_transactions_size_in_witness: params - .get(Parameter::MaxTransactionsSizeInWitness)?, - new_transactions_validation_state_size_soft_limit: params - .get(Parameter::NewTransactionsValidationStateSizeSoftLimit)?, congestion_control_config: get_congestion_control_config(params)?, + witness_config: WitnessConfig { + storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?, + max_transactions_size_in_witness: params + .get(Parameter::MaxTransactionsSizeInWitness)?, + new_transactions_validation_state_size_soft_limit: params + .get(Parameter::NewTransactionsValidationStateSizeSoftLimit)?, + }, }) } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap index 9d43ed34cc6..b15430f5edf 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } 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 b93d7542852..c62b557cebb 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 @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "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 92d04e4e303..2f4745530a8 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 @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap index 92d04e4e303..2f4745530a8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap index 7750372684b..4de236076fd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap index 474b1bd2fd7..e86919296ab 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap index cdf4315e9ab..d901f9b9f7c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap index ca9925e98cb..45964ab0fac 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap index 148a5647dba..7cf60214f3d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap index 6cf18f26963..586d2d69357 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap index 4f199d21a58..9da9ba0bc56 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap index a58d403c9b4..fef776f0188 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap index c8003eeb81d..b7547de80b7 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap index fcc8aecaf6b..f8ce9d1041a 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap index 7f362eaf27b..7e0e2201f5c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap index c288b69255f..311797e3af3 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap index b65b313bdfd..c1d0f43b95f 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap index 8b60a520037..59446203327 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap index c5ec27c1a62..ebdc3906423 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap index 48550a4faae..ccfdbc267de 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap index 1663a04f129..a19d278ecb5 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap index 750af8c5be3..d71afb05bfc 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 16000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 16000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap index 60349cb7759..9319517ca20 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap index 755f9ad828a..69652079499 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap index 9d43ed34cc6..b15430f5edf 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } 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 b93d7542852..c62b557cebb 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 @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "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 92d04e4e303..2f4745530a8 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 @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap index 92d04e4e303..2f4745530a8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap index 7750372684b..4de236076fd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap index 474b1bd2fd7..e86919296ab 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap index cdf4315e9ab..d901f9b9f7c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap index ca9925e98cb..45964ab0fac 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -221,5 +220,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap index 148a5647dba..7cf60214f3d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap index 6cf18f26963..586d2d69357 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap index 4f199d21a58..9da9ba0bc56 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -222,5 +221,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap index a58d403c9b4..fef776f0188 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap index c8003eeb81d..b7547de80b7 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap index fcc8aecaf6b..f8ce9d1041a 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap index 7f362eaf27b..7e0e2201f5c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap index c288b69255f..311797e3af3 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap index b65b313bdfd..c1d0f43b95f 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap index 8b60a520037..59446203327 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 32, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap index c5ec27c1a62..ebdc3906423 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap index 48550a4faae..ccfdbc267de 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap index 1663a04f129..a19d278ecb5 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap index 750af8c5be3..d71afb05bfc 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 16000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 16000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap index 60349cb7759..9319517ca20 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap index 755f9ad828a..69652079499 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap @@ -102,8 +102,7 @@ expression: config_view "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 3000000 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: config_view "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 3000000, + "max_transactions_size_in_witness": 2097152, + "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap index 5951499fd93..0f7881f9ea4 100644 --- a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap +++ b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap @@ -102,8 +102,7 @@ expression: "&view" "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: "&view" "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/view.rs b/core/parameters/src/view.rs index 39487c24989..9ec9d252399 100644 --- a/core/parameters/src/view.rs +++ b/core/parameters/src/view.rs @@ -1,3 +1,4 @@ +use crate::config::WitnessConfig; use crate::{ActionCosts, ExtCosts, Fee, ParameterCost}; use near_account_id::AccountId; use near_primitives_core::serialize::dec_format; @@ -18,6 +19,8 @@ pub struct RuntimeConfigView { pub wasm_config: VMConfigView, /// Config that defines rules for account creation. pub account_creation_config: AccountCreationConfigView, + /// Configuration specific to ChunkStateWitness. + pub witness_config: WitnessConfigView, } #[derive(Debug, serde::Serialize, serde::Deserialize, Clone)] @@ -40,9 +43,6 @@ pub struct RuntimeFeesConfigView { /// Pessimistic gas price inflation ratio. pub pessimistic_gas_price_inflation_ratio: Rational32, - - /// The maximum size of the state witness after which we defer execution of any new receipts. - pub storage_proof_size_soft_limit: usize, } /// The structure describes configuration for creation of new accounts. @@ -182,7 +182,6 @@ impl From for RuntimeConfigView { pessimistic_gas_price_inflation_ratio: config .fees .pessimistic_gas_price_inflation_ratio, - storage_proof_size_soft_limit: config.storage_proof_size_soft_limit, }, wasm_config: VMConfigView::from(config.wasm_config), account_creation_config: AccountCreationConfigView { @@ -191,6 +190,7 @@ impl From for RuntimeConfigView { .min_allowed_top_level_account_length, registrar_account_id: config.account_creation_config.registrar_account_id, }, + witness_config: WitnessConfigView::from(config.witness_config), } } } @@ -610,6 +610,30 @@ impl From for crate::ExtCostsConfig { } } +/// Configuration specific to ChunkStateWitness. +#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Hash, PartialEq, Eq)] +pub struct WitnessConfigView { + /// The maximum size of the storage proof in state witness after which we defer execution of any new receipts. + pub storage_proof_size_soft_limit: usize, + /// Maximum size of transactions contained inside ChunkStateWitness. + /// A witness contains transactions from both the previous chunk and the current one. + /// This parameter limits the sum of sizes of transactions from both chunks. + pub max_transactions_size_in_witness: usize, + /// Soft size limit of new transactions storage proof inside ChunkStateWitness. + pub new_transactions_validation_state_size_soft_limit: usize, +} + +impl From for WitnessConfigView { + fn from(config: WitnessConfig) -> Self { + Self { + storage_proof_size_soft_limit: config.storage_proof_size_soft_limit, + max_transactions_size_in_witness: config.max_transactions_size_in_witness, + new_transactions_validation_state_size_soft_limit: config + .new_transactions_validation_state_size_soft_limit, + } + } +} + #[cfg(test)] #[cfg(not(feature = "nightly"))] #[cfg(not(feature = "statelessnet_protocol"))] diff --git a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap index e7df3feb636..cb0642cd5b4 100644 --- a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap +++ b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap @@ -102,8 +102,7 @@ expression: "&view" "pessimistic_gas_price_inflation_ratio": [ 103, 100 - ], - "storage_proof_size_soft_limit": 999999999999999 + ] }, "wasm_config": { "ext_costs": { @@ -223,5 +222,10 @@ expression: "&view" "account_creation_config": { "min_allowed_top_level_account_length": 65, "registrar_account_id": "registrar" + }, + "witness_config": { + "storage_proof_size_soft_limit": 999999999999999, + "max_transactions_size_in_witness": 999999999999999, + "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs b/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs index 324cee75592..4b4d8c521b5 100644 --- a/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs +++ b/runtime/runtime-params-estimator/src/costs_to_runtime_config.rs @@ -38,11 +38,8 @@ pub fn costs_to_runtime_config(cost_table: &CostTable) -> anyhow::Result Date: Wed, 29 May 2024 17:28:21 +0000 Subject: [PATCH 20/21] Rename max_transactions_size_in_witness to combined_transactions_size_limit --- chain/chain/src/runtime/mod.rs | 2 +- core/parameters/res/runtime_configs/87.yaml | 2 +- core/parameters/res/runtime_configs/parameters.snap | 2 +- core/parameters/res/runtime_configs/parameters.yaml | 2 +- core/parameters/res/runtime_configs/parameters_testnet.yaml | 2 +- core/parameters/src/config.rs | 2 +- core/parameters/src/parameter_table.rs | 2 +- .../near_parameters__config_store__tests__0.json.snap | 2 +- .../near_parameters__config_store__tests__129.json.snap | 2 +- .../near_parameters__config_store__tests__138.json.snap | 2 +- .../near_parameters__config_store__tests__139.json.snap | 2 +- .../near_parameters__config_store__tests__142.json.snap | 2 +- .../near_parameters__config_store__tests__35.json.snap | 2 +- .../near_parameters__config_store__tests__42.json.snap | 2 +- .../near_parameters__config_store__tests__46.json.snap | 2 +- .../near_parameters__config_store__tests__48.json.snap | 2 +- .../near_parameters__config_store__tests__49.json.snap | 2 +- .../near_parameters__config_store__tests__50.json.snap | 2 +- .../near_parameters__config_store__tests__52.json.snap | 2 +- .../near_parameters__config_store__tests__53.json.snap | 2 +- .../near_parameters__config_store__tests__55.json.snap | 2 +- .../near_parameters__config_store__tests__57.json.snap | 2 +- .../near_parameters__config_store__tests__59.json.snap | 2 +- .../near_parameters__config_store__tests__61.json.snap | 2 +- .../near_parameters__config_store__tests__62.json.snap | 2 +- .../near_parameters__config_store__tests__63.json.snap | 2 +- .../near_parameters__config_store__tests__64.json.snap | 2 +- .../near_parameters__config_store__tests__66.json.snap | 2 +- .../near_parameters__config_store__tests__67.json.snap | 2 +- .../near_parameters__config_store__tests__83.json.snap | 2 +- .../near_parameters__config_store__tests__85.json.snap | 2 +- .../near_parameters__config_store__tests__87.json.snap | 2 +- .../near_parameters__config_store__tests__testnet_0.json.snap | 2 +- ...ear_parameters__config_store__tests__testnet_129.json.snap | 2 +- ...ear_parameters__config_store__tests__testnet_138.json.snap | 2 +- ...ear_parameters__config_store__tests__testnet_139.json.snap | 2 +- ...ear_parameters__config_store__tests__testnet_142.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_35.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_42.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_46.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_48.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_49.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_50.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_52.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_53.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_55.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_57.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_59.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_61.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_62.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_63.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_64.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_66.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_67.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_83.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_85.json.snap | 2 +- ...near_parameters__config_store__tests__testnet_87.json.snap | 2 +- .../near_parameters__view__tests__runtime_config_view.snap | 2 +- core/parameters/src/view.rs | 4 ++-- .../near_primitives__views__tests__runtime_config_view.snap | 2 +- 60 files changed, 61 insertions(+), 61 deletions(-) diff --git a/chain/chain/src/runtime/mod.rs b/chain/chain/src/runtime/mod.rs index d65ad76733a..1d292538219 100644 --- a/chain/chain/src/runtime/mod.rs +++ b/chain/chain/src/runtime/mod.rs @@ -1384,7 +1384,7 @@ fn calculate_transactions_size_limit( // Witness keeps transactions from both previous and current chunk, so we have to limit the sum of both. runtime_config .witness_config - .max_transactions_size_in_witness + .combined_transactions_size_limit .saturating_sub(last_chunk_transactions_size) .try_into() .expect("Can't convert usize to u64!") diff --git a/core/parameters/res/runtime_configs/87.yaml b/core/parameters/res/runtime_configs/87.yaml index 0c9f36062da..371da175240 100644 --- a/core/parameters/res/runtime_configs/87.yaml +++ b/core/parameters/res/runtime_configs/87.yaml @@ -1,3 +1,3 @@ max_transaction_size: {old: 4_194_304, new: 1_572_864} -max_transactions_size_in_witness: {old: 999_999_999_999_999, new: 2_097_152} +combined_transactions_size_limit: {old: 999_999_999_999_999, new: 2_097_152} new_transactions_validation_state_size_soft_limit: {old: 999_999_999_999_999, new: 572_864} diff --git a/core/parameters/res/runtime_configs/parameters.snap b/core/parameters/res/runtime_configs/parameters.snap index 106886fdcea..5daf9e4caaa 100644 --- a/core/parameters/res/runtime_configs/parameters.snap +++ b/core/parameters/res/runtime_configs/parameters.snap @@ -6,7 +6,7 @@ burnt_gas_reward 3 / 10 pessimistic_gas_price_inflation 103 / 100 storage_proof_size_soft_limit 999_999_999_999_999 storage_proof_size_receipt_limit 999_999_999_999_999 -max_transactions_size_in_witness 999_999_999_999_999 +combined_transactions_size_limit 999_999_999_999_999 new_transactions_validation_state_size_soft_limit 999_999_999_999_999 min_allowed_top_level_account_length 65 registrar_account_id registrar diff --git a/core/parameters/res/runtime_configs/parameters.yaml b/core/parameters/res/runtime_configs/parameters.yaml index cd8e07c1ead..6c1a59f7776 100644 --- a/core/parameters/res/runtime_configs/parameters.yaml +++ b/core/parameters/res/runtime_configs/parameters.yaml @@ -15,7 +15,7 @@ pessimistic_gas_price_inflation: { # Stateless validation config storage_proof_size_soft_limit: 999_999_999_999_999 storage_proof_size_receipt_limit: 999_999_999_999_999 -max_transactions_size_in_witness: 999_999_999_999_999 +combined_transactions_size_limit: 999_999_999_999_999 new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 # Account creation config diff --git a/core/parameters/res/runtime_configs/parameters_testnet.yaml b/core/parameters/res/runtime_configs/parameters_testnet.yaml index fa6481044fe..f0adf7b1279 100644 --- a/core/parameters/res/runtime_configs/parameters_testnet.yaml +++ b/core/parameters/res/runtime_configs/parameters_testnet.yaml @@ -11,7 +11,7 @@ pessimistic_gas_price_inflation: { # Stateless validation config storage_proof_size_soft_limit: 999_999_999_999_999 storage_proof_size_receipt_limit: 999_999_999_999_999 -max_transactions_size_in_witness: 999_999_999_999_999 +combined_transactions_size_limit: 999_999_999_999_999 new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 # Account creation config diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index 627d1f6b7a6..91e044e99f2 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -217,7 +217,7 @@ pub struct WitnessConfig { /// Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. /// This parameter limits the sum of sizes of transactions from both chunks. - pub max_transactions_size_in_witness: usize, + pub combined_transactions_size_limit: usize, /// Soft size limit of new transactions storage proof inside ChunkStateWitness. pub new_transactions_validation_state_size_soft_limit: usize, } diff --git a/core/parameters/src/parameter_table.rs b/core/parameters/src/parameter_table.rs index 4ef103f384a..ed5a13383ba 100644 --- a/core/parameters/src/parameter_table.rs +++ b/core/parameters/src/parameter_table.rs @@ -336,7 +336,7 @@ impl TryFrom<&ParameterTable> for RuntimeConfig { congestion_control_config: get_congestion_control_config(params)?, witness_config: WitnessConfig { storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?, - max_transactions_size_in_witness: params + combined_transactions_size_limit: params .get(Parameter::MaxTransactionsSizeInWitness)?, new_transactions_validation_state_size_soft_limit: params .get(Parameter::NewTransactionsValidationStateSizeSoftLimit)?, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap index b15430f5edf..b438658290a 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } 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 c62b557cebb..85b177d2eab 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 @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "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 2f4745530a8..58b9fb09e72 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 @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap index e615c68f07b..ed51c574fee 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap @@ -104,7 +104,7 @@ expression: config_view 100 ], "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 }, "wasm_config": { diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap index 2f4745530a8..58b9fb09e72 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap index 4de236076fd..670b7b31aca 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap index e86919296ab..3a0a442af4d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap index d901f9b9f7c..e4b236abf17 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap index 45964ab0fac..c5f9e3b29ad 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap index 7cf60214f3d..c421535bf46 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap index 586d2d69357..44adce4b12b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap index 9da9ba0bc56..99cbacc2356 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap index fef776f0188..dec8019e92c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap index b7547de80b7..bdd9d1caba8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap index f8ce9d1041a..1bc4f21f42f 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap index 7e0e2201f5c..a73ecfa2ea5 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap index 311797e3af3..c443107ed59 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap index c1d0f43b95f..1bd1ed40568 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap index 59446203327..d5867a140bd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap index ebdc3906423..1165b0168dc 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap index ccfdbc267de..fbf44e1de2b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap index a19d278ecb5..76aeabc5798 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap index d71afb05bfc..9ab0ea7a4b2 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 16000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap index 9319517ca20..12a326a63a3 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap index 69652079499..42473d55abe 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap index b15430f5edf..b438658290a 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } 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 c62b557cebb..85b177d2eab 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 @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "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 2f4745530a8..58b9fb09e72 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 @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap index e615c68f07b..ed51c574fee 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap @@ -104,7 +104,7 @@ expression: config_view 100 ], "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 }, "wasm_config": { diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap index 2f4745530a8..58b9fb09e72 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap index 4de236076fd..670b7b31aca 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap index e86919296ab..3a0a442af4d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap index d901f9b9f7c..e4b236abf17 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap index 45964ab0fac..c5f9e3b29ad 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap @@ -223,7 +223,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap index 7cf60214f3d..c421535bf46 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap index 586d2d69357..44adce4b12b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap index 9da9ba0bc56..99cbacc2356 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap @@ -224,7 +224,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap index fef776f0188..dec8019e92c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap index b7547de80b7..bdd9d1caba8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap index f8ce9d1041a..1bc4f21f42f 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap index 7e0e2201f5c..a73ecfa2ea5 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap index 311797e3af3..c443107ed59 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap index c1d0f43b95f..1bd1ed40568 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap index 59446203327..d5867a140bd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap index ebdc3906423..1165b0168dc 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap index ccfdbc267de..fbf44e1de2b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap index a19d278ecb5..76aeabc5798 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap index d71afb05bfc..9ab0ea7a4b2 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 16000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap index 9319517ca20..12a326a63a3 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap index 69652079499..42473d55abe 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap @@ -225,7 +225,7 @@ expression: config_view }, "witness_config": { "storage_proof_size_soft_limit": 3000000, - "max_transactions_size_in_witness": 2097152, + "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } } diff --git a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap index 0f7881f9ea4..95cad4e2ef0 100644 --- a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap +++ b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap @@ -225,7 +225,7 @@ expression: "&view" }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } diff --git a/core/parameters/src/view.rs b/core/parameters/src/view.rs index 9ec9d252399..2eeaca58da8 100644 --- a/core/parameters/src/view.rs +++ b/core/parameters/src/view.rs @@ -618,7 +618,7 @@ pub struct WitnessConfigView { /// Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. /// This parameter limits the sum of sizes of transactions from both chunks. - pub max_transactions_size_in_witness: usize, + pub combined_transactions_size_limit: usize, /// Soft size limit of new transactions storage proof inside ChunkStateWitness. pub new_transactions_validation_state_size_soft_limit: usize, } @@ -627,7 +627,7 @@ impl From for WitnessConfigView { fn from(config: WitnessConfig) -> Self { Self { storage_proof_size_soft_limit: config.storage_proof_size_soft_limit, - max_transactions_size_in_witness: config.max_transactions_size_in_witness, + combined_transactions_size_limit: config.combined_transactions_size_limit, new_transactions_validation_state_size_soft_limit: config .new_transactions_validation_state_size_soft_limit, } diff --git a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap index cb0642cd5b4..643e8badc78 100644 --- a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap +++ b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap @@ -225,7 +225,7 @@ expression: "&view" }, "witness_config": { "storage_proof_size_soft_limit": 999999999999999, - "max_transactions_size_in_witness": 999999999999999, + "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } } From c5579f90dc5301d7f2de4e31f9711d0eb45dfb36 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Wed, 29 May 2024 19:40:34 +0000 Subject: [PATCH 21/21] Rename witness limit parameters to make things clearer --- core/parameters/res/runtime_configs/83.yaml | 2 +- core/parameters/res/runtime_configs/85.yaml | 4 ++-- .../res/runtime_configs/parameters.snap | 6 +++--- .../res/runtime_configs/parameters.yaml | 4 ++-- .../runtime_configs/parameters_testnet.yaml | 4 ++-- core/parameters/src/config.rs | 9 +++++---- core/parameters/src/parameter.rs | 18 ++++++++++-------- core/parameters/src/parameter_table.rs | 5 +++-- ...arameters__config_store__tests__0.json.snap | 4 ++-- ...ameters__config_store__tests__129.json.snap | 4 ++-- ...ameters__config_store__tests__138.json.snap | 4 ++-- ...ameters__config_store__tests__139.json.snap | 4 ++-- ...ameters__config_store__tests__142.json.snap | 4 ++-- ...rameters__config_store__tests__35.json.snap | 4 ++-- ...rameters__config_store__tests__42.json.snap | 4 ++-- ...rameters__config_store__tests__46.json.snap | 4 ++-- ...rameters__config_store__tests__48.json.snap | 4 ++-- ...rameters__config_store__tests__49.json.snap | 4 ++-- ...rameters__config_store__tests__50.json.snap | 4 ++-- ...rameters__config_store__tests__52.json.snap | 4 ++-- ...rameters__config_store__tests__53.json.snap | 4 ++-- ...rameters__config_store__tests__55.json.snap | 4 ++-- ...rameters__config_store__tests__57.json.snap | 4 ++-- ...rameters__config_store__tests__59.json.snap | 4 ++-- ...rameters__config_store__tests__61.json.snap | 4 ++-- ...rameters__config_store__tests__62.json.snap | 4 ++-- ...rameters__config_store__tests__63.json.snap | 4 ++-- ...rameters__config_store__tests__64.json.snap | 4 ++-- ...rameters__config_store__tests__66.json.snap | 4 ++-- ...rameters__config_store__tests__67.json.snap | 4 ++-- ...rameters__config_store__tests__83.json.snap | 4 ++-- ...rameters__config_store__tests__85.json.snap | 4 ++-- ...rameters__config_store__tests__87.json.snap | 4 ++-- ...s__config_store__tests__testnet_0.json.snap | 4 ++-- ..._config_store__tests__testnet_129.json.snap | 4 ++-- ..._config_store__tests__testnet_138.json.snap | 4 ++-- ..._config_store__tests__testnet_139.json.snap | 4 ++-- ..._config_store__tests__testnet_142.json.snap | 4 ++-- ...__config_store__tests__testnet_35.json.snap | 4 ++-- ...__config_store__tests__testnet_42.json.snap | 4 ++-- ...__config_store__tests__testnet_46.json.snap | 4 ++-- ...__config_store__tests__testnet_48.json.snap | 4 ++-- ...__config_store__tests__testnet_49.json.snap | 4 ++-- ...__config_store__tests__testnet_50.json.snap | 4 ++-- ...__config_store__tests__testnet_52.json.snap | 4 ++-- ...__config_store__tests__testnet_53.json.snap | 4 ++-- ...__config_store__tests__testnet_55.json.snap | 4 ++-- ...__config_store__tests__testnet_57.json.snap | 4 ++-- ...__config_store__tests__testnet_59.json.snap | 4 ++-- ...__config_store__tests__testnet_61.json.snap | 4 ++-- ...__config_store__tests__testnet_62.json.snap | 4 ++-- ...__config_store__tests__testnet_63.json.snap | 4 ++-- ...__config_store__tests__testnet_64.json.snap | 4 ++-- ...__config_store__tests__testnet_66.json.snap | 4 ++-- ...__config_store__tests__testnet_67.json.snap | 4 ++-- ...__config_store__tests__testnet_83.json.snap | 4 ++-- ...__config_store__tests__testnet_85.json.snap | 4 ++-- ...__config_store__tests__testnet_87.json.snap | 4 ++-- ...ters__view__tests__runtime_config_view.snap | 4 ++-- core/parameters/src/view.rs | 13 +++++++------ core/parameters/src/vm.rs | 4 ++-- ...ves__views__tests__runtime_config_view.snap | 4 ++-- runtime/near-vm-runner/src/logic/logic.rs | 2 +- runtime/runtime/src/lib.rs | 10 +++++----- 64 files changed, 147 insertions(+), 142 deletions(-) diff --git a/core/parameters/res/runtime_configs/83.yaml b/core/parameters/res/runtime_configs/83.yaml index 0c0b089e043..a38e7147055 100644 --- a/core/parameters/res/runtime_configs/83.yaml +++ b/core/parameters/res/runtime_configs/83.yaml @@ -1 +1 @@ -storage_proof_size_soft_limit: {old: 999_999_999_999_999, new: 16_000_000} \ No newline at end of file +main_storage_proof_size_soft_limit: {old: 999_999_999_999_999, new: 16_000_000} \ No newline at end of file diff --git a/core/parameters/res/runtime_configs/85.yaml b/core/parameters/res/runtime_configs/85.yaml index bbd74ec65ba..62cf672bd54 100644 --- a/core/parameters/res/runtime_configs/85.yaml +++ b/core/parameters/res/runtime_configs/85.yaml @@ -1,2 +1,2 @@ -storage_proof_size_receipt_limit: {old: 999_999_999_999_999, new: 4_000_000} -storage_proof_size_soft_limit: {old: 16_000_000, new: 3_000_000} \ No newline at end of file +per_receipt_storage_proof_size_limit: {old: 999_999_999_999_999, new: 4_000_000} +main_storage_proof_size_soft_limit: {old: 16_000_000, new: 3_000_000} \ No newline at end of file diff --git a/core/parameters/res/runtime_configs/parameters.snap b/core/parameters/res/runtime_configs/parameters.snap index 5daf9e4caaa..22bf854c843 100644 --- a/core/parameters/res/runtime_configs/parameters.snap +++ b/core/parameters/res/runtime_configs/parameters.snap @@ -4,10 +4,10 @@ description: THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. --- burnt_gas_reward 3 / 10 pessimistic_gas_price_inflation 103 / 100 -storage_proof_size_soft_limit 999_999_999_999_999 -storage_proof_size_receipt_limit 999_999_999_999_999 -combined_transactions_size_limit 999_999_999_999_999 +main_storage_proof_size_soft_limit 999_999_999_999_999 +per_receipt_storage_proof_size_limit 999_999_999_999_999 new_transactions_validation_state_size_soft_limit 999_999_999_999_999 +combined_transactions_size_limit 999_999_999_999_999 min_allowed_top_level_account_length 65 registrar_account_id registrar storage_amount_per_byte 10000000000000000000 diff --git a/core/parameters/res/runtime_configs/parameters.yaml b/core/parameters/res/runtime_configs/parameters.yaml index 6c1a59f7776..ecc9a76d3f1 100644 --- a/core/parameters/res/runtime_configs/parameters.yaml +++ b/core/parameters/res/runtime_configs/parameters.yaml @@ -13,8 +13,8 @@ pessimistic_gas_price_inflation: { } # Stateless validation config -storage_proof_size_soft_limit: 999_999_999_999_999 -storage_proof_size_receipt_limit: 999_999_999_999_999 +main_storage_proof_size_soft_limit: 999_999_999_999_999 +per_receipt_storage_proof_size_limit: 999_999_999_999_999 combined_transactions_size_limit: 999_999_999_999_999 new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 diff --git a/core/parameters/res/runtime_configs/parameters_testnet.yaml b/core/parameters/res/runtime_configs/parameters_testnet.yaml index f0adf7b1279..9415eb3b836 100644 --- a/core/parameters/res/runtime_configs/parameters_testnet.yaml +++ b/core/parameters/res/runtime_configs/parameters_testnet.yaml @@ -9,8 +9,8 @@ pessimistic_gas_price_inflation: { } # Stateless validation config -storage_proof_size_soft_limit: 999_999_999_999_999 -storage_proof_size_receipt_limit: 999_999_999_999_999 +main_storage_proof_size_soft_limit: 999_999_999_999_999 +per_receipt_storage_proof_size_limit: 999_999_999_999_999 combined_transactions_size_limit: 999_999_999_999_999 new_transactions_validation_state_size_soft_limit: 999_999_999_999_999 diff --git a/core/parameters/src/config.rs b/core/parameters/src/config.rs index 91e044e99f2..6149583d4a1 100644 --- a/core/parameters/src/config.rs +++ b/core/parameters/src/config.rs @@ -212,12 +212,13 @@ impl CongestionControlConfig { /// Configuration specific to ChunkStateWitness. #[derive(Debug, Copy, Clone, PartialEq)] pub struct WitnessConfig { - /// The maximum size of the storage proof in state witness after which we defer execution of any new receipts. - pub storage_proof_size_soft_limit: usize, + /// Size limit for storage proof generated while executing receipts in a chunk. + /// After this limit is reached we defer execution of any new receipts. + pub main_storage_proof_size_soft_limit: usize, /// Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. - /// This parameter limits the sum of sizes of transactions from both chunks. + /// This parameter limits the sum of sizes of transactions from both of those chunks. pub combined_transactions_size_limit: usize, - /// Soft size limit of new transactions storage proof inside ChunkStateWitness. + /// Soft size limit of storage proof used to validate new transactions in ChunkStateWitness. pub new_transactions_validation_state_size_soft_limit: usize, } diff --git a/core/parameters/src/parameter.rs b/core/parameters/src/parameter.rs index 0850c7d968f..87e37cbdffe 100644 --- a/core/parameters/src/parameter.rs +++ b/core/parameters/src/parameter.rs @@ -21,15 +21,17 @@ pub enum Parameter { PessimisticGasPriceInflation, /// Stateless validation config - StorageProofSizeSoftLimit, - /// Hard per-receipt limit of recorded trie storage proof - StorageProofSizeReceiptLimit, + /// Size limit for storage proof generated while executing receipts in a chunk. + /// After this limit is reached we defer execution of any new receipts. + MainStorageProofSizeSoftLimit, + /// Hard limit on the size of storage proof generated while executing a single receipt. + PerReceiptStorageProofSizeLimit, + /// Soft size limit of storage proof used to validate new transactions in ChunkStateWitness. + NewTransactionsValidationStateSizeSoftLimit, /// Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. - /// This parameter limits the sum of sizes of transactions from both chunks. - MaxTransactionsSizeInWitness, - /// Soft size limit of new transactions storage proof inside ChunkStateWitness. - NewTransactionsValidationStateSizeSoftLimit, + /// This parameter limits the sum of sizes of transactions from both of those chunks. + CombinedTransactionsSizeLimit, // Account creation config MinAllowedTopLevelAccountLength, @@ -255,7 +257,7 @@ impl Parameter { Parameter::AccountIdValidityRulesVersion, Parameter::YieldTimeoutLengthInBlocks, Parameter::MaxYieldPayloadSize, - Parameter::StorageProofSizeReceiptLimit, + Parameter::PerReceiptStorageProofSizeLimit, ] .iter() } diff --git a/core/parameters/src/parameter_table.rs b/core/parameters/src/parameter_table.rs index ed5a13383ba..e0adf1c7f3a 100644 --- a/core/parameters/src/parameter_table.rs +++ b/core/parameters/src/parameter_table.rs @@ -335,9 +335,10 @@ impl TryFrom<&ParameterTable> for RuntimeConfig { }, congestion_control_config: get_congestion_control_config(params)?, witness_config: WitnessConfig { - storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?, + main_storage_proof_size_soft_limit: params + .get(Parameter::MainStorageProofSizeSoftLimit)?, combined_transactions_size_limit: params - .get(Parameter::MaxTransactionsSizeInWitness)?, + .get(Parameter::CombinedTransactionsSizeLimit)?, new_transactions_validation_state_size_soft_limit: params .get(Parameter::NewTransactionsValidationStateSizeSoftLimit)?, }, diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap index b438658290a..98961be9369 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__0.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } 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 85b177d2eab..53261bddf79 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 @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "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 58b9fb09e72..156ed6e8718 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 @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap index ed51c574fee..fb511a178c8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__139.json.snap @@ -103,7 +103,7 @@ expression: config_view 103, 100 ], - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 }, @@ -219,7 +219,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap index 58b9fb09e72..156ed6e8718 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__142.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap index 670b7b31aca..e5d9a1f9a26 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__35.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap index 3a0a442af4d..105a414dcd6 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__42.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap index e4b236abf17..80f699ead57 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__46.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap index c5f9e3b29ad..4a8e3c270a1 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__48.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap index c421535bf46..5075e5f38e4 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__49.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap index 44adce4b12b..8a9285e51fd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__50.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap index 99cbacc2356..b1abdab3fae 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__52.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap index dec8019e92c..4101dfe863e 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__53.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap index bdd9d1caba8..e6da32a2a96 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__55.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap index 1bc4f21f42f..51d09d69eb7 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__57.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap index a73ecfa2ea5..72a1fe84822 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__59.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap index c443107ed59..170e148403b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__61.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap index 1bd1ed40568..eec8c5a7c2b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__62.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap index d5867a140bd..961e67e7198 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__63.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap index 1165b0168dc..e709f702a8d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__64.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap index fbf44e1de2b..04bb62f7e1c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__66.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap index 76aeabc5798..ead0b9830ff 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__67.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap index 9ab0ea7a4b2..b7d4d565e0e 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__83.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 16000000, + "main_storage_proof_size_soft_limit": 16000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap index 12a326a63a3..9f43f2f2168 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__85.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap index 42473d55abe..8c90815cf02 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__87.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap index b438658290a..98961be9369 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_0.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } 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 85b177d2eab..53261bddf79 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 @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "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 58b9fb09e72..156ed6e8718 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 @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap index ed51c574fee..fb511a178c8 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_139.json.snap @@ -103,7 +103,7 @@ expression: config_view 103, 100 ], - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 }, @@ -219,7 +219,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap index 58b9fb09e72..156ed6e8718 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_142.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap index 670b7b31aca..e5d9a1f9a26 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_35.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap index 3a0a442af4d..105a414dcd6 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_42.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap index e4b236abf17..80f699ead57 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_46.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap index c5f9e3b29ad..4a8e3c270a1 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_48.json.snap @@ -214,7 +214,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -222,7 +222,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap index c421535bf46..5075e5f38e4 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_49.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap index 44adce4b12b..8a9285e51fd 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_50.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap index 99cbacc2356..b1abdab3fae 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_52.json.snap @@ -215,7 +215,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -223,7 +223,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap index dec8019e92c..4101dfe863e 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_53.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap index bdd9d1caba8..e6da32a2a96 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_55.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 0, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap index 1bc4f21f42f..51d09d69eb7 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_57.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap index a73ecfa2ea5..72a1fe84822 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_59.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap index c443107ed59..170e148403b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_61.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap index 1bd1ed40568..eec8c5a7c2b 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_62.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap index d5867a140bd..961e67e7198 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_63.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap index 1165b0168dc..e709f702a8d 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_64.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap index fbf44e1de2b..04bb62f7e1c 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_66.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap index 76aeabc5798..ead0b9830ff 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_67.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap index 9ab0ea7a4b2..b7d4d565e0e 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_83.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 16000000, + "main_storage_proof_size_soft_limit": 16000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap index 12a326a63a3..9f43f2f2168 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_85.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap index 42473d55abe..8c90815cf02 100644 --- a/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap +++ b/core/parameters/src/snapshots/near_parameters__config_store__tests__testnet_87.json.snap @@ -216,7 +216,7 @@ expression: config_view "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 4000000 + "per_receipt_storage_proof_size_limit": 4000000 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: config_view "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 3000000, + "main_storage_proof_size_soft_limit": 3000000, "combined_transactions_size_limit": 2097152, "new_transactions_validation_state_size_soft_limit": 572864 } diff --git a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap index 95cad4e2ef0..04334405093 100644 --- a/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap +++ b/core/parameters/src/snapshots/near_parameters__view__tests__runtime_config_view.snap @@ -216,7 +216,7 @@ expression: "&view" "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: "&view" "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/core/parameters/src/view.rs b/core/parameters/src/view.rs index 2eeaca58da8..c723d050a3b 100644 --- a/core/parameters/src/view.rs +++ b/core/parameters/src/view.rs @@ -613,20 +613,21 @@ impl From for crate::ExtCostsConfig { /// Configuration specific to ChunkStateWitness. #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Hash, PartialEq, Eq)] pub struct WitnessConfigView { - /// The maximum size of the storage proof in state witness after which we defer execution of any new receipts. - pub storage_proof_size_soft_limit: usize, - /// Maximum size of transactions contained inside ChunkStateWitness. + /// Size limit for storage proof generated while executing receipts in a chunk. + /// After this limit is reached we defer execution of any new receipts. + pub main_storage_proof_size_soft_limit: usize, + // Maximum size of transactions contained inside ChunkStateWitness. /// A witness contains transactions from both the previous chunk and the current one. - /// This parameter limits the sum of sizes of transactions from both chunks. + /// This parameter limits the sum of sizes of transactions from both of those chunks. pub combined_transactions_size_limit: usize, - /// Soft size limit of new transactions storage proof inside ChunkStateWitness. + /// Soft size limit of storage proof used to validate new transactions in ChunkStateWitness. pub new_transactions_validation_state_size_soft_limit: usize, } impl From for WitnessConfigView { fn from(config: WitnessConfig) -> Self { Self { - storage_proof_size_soft_limit: config.storage_proof_size_soft_limit, + main_storage_proof_size_soft_limit: config.main_storage_proof_size_soft_limit, combined_transactions_size_limit: config.combined_transactions_size_limit, new_transactions_validation_state_size_soft_limit: config .new_transactions_validation_state_size_soft_limit, diff --git a/core/parameters/src/vm.rs b/core/parameters/src/vm.rs index f2f7a46af35..8c62246caf9 100644 --- a/core/parameters/src/vm.rs +++ b/core/parameters/src/vm.rs @@ -136,8 +136,8 @@ pub struct LimitConfig { pub yield_timeout_length_in_blocks: u64, /// Maximum number of bytes for payload passed over a yield resume. pub max_yield_payload_size: u64, - /// Maximum size of the recorded trie storage proof. - pub storage_proof_size_receipt_limit: usize, + /// Hard limit on the size of storage proof generated while executing a single receipt. + pub per_receipt_storage_proof_size_limit: usize, } /// Dynamic configuration parameters required for the WASM runtime to diff --git a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap index 643e8badc78..be77c2d52c4 100644 --- a/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap +++ b/core/primitives/src/snapshots/near_primitives__views__tests__runtime_config_view.snap @@ -216,7 +216,7 @@ expression: "&view" "account_id_validity_rules_version": 1, "yield_timeout_length_in_blocks": 200, "max_yield_payload_size": 1024, - "storage_proof_size_receipt_limit": 999999999999999 + "per_receipt_storage_proof_size_limit": 999999999999999 } }, "account_creation_config": { @@ -224,7 +224,7 @@ expression: "&view" "registrar_account_id": "registrar" }, "witness_config": { - "storage_proof_size_soft_limit": 999999999999999, + "main_storage_proof_size_soft_limit": 999999999999999, "combined_transactions_size_limit": 999999999999999, "new_transactions_validation_state_size_soft_limit": 999999999999999 } diff --git a/runtime/near-vm-runner/src/logic/logic.rs b/runtime/near-vm-runner/src/logic/logic.rs index 68c60341c82..d9979b81a67 100644 --- a/runtime/near-vm-runner/src/logic/logic.rs +++ b/runtime/near-vm-runner/src/logic/logic.rs @@ -155,7 +155,7 @@ impl<'a> VMLogic<'a> { ); let recorded_storage_counter = RecordedStorageCounter::new( ext.get_recorded_storage_size(), - config.limit_config.storage_proof_size_receipt_limit, + config.limit_config.per_receipt_storage_proof_size_limit, ); Self { ext, diff --git a/runtime/runtime/src/lib.rs b/runtime/runtime/src/lib.rs index 9f6d02f65ea..30759db13c8 100644 --- a/runtime/runtime/src/lib.rs +++ b/runtime/runtime/src/lib.rs @@ -1548,7 +1548,7 @@ impl Runtime { let compute_limit = apply_state.gas_limit.unwrap_or(Gas::max_value()); let proof_size_limit = if checked_feature!("stable", StateWitnessSizeLimit, protocol_version) { - Some(apply_state.config.witness_config.storage_proof_size_soft_limit) + Some(apply_state.config.witness_config.main_storage_proof_size_soft_limit) } else { None }; @@ -3128,17 +3128,17 @@ mod tests { } #[test] - fn test_storage_proof_size_soft_limit() { + fn test_main_storage_proof_size_soft_limit() { if !checked_feature!("stable", StateWitnessSizeLimit, PROTOCOL_VERSION) { return; } let (runtime, tries, root, mut apply_state, signer, epoch_info_provider) = setup_runtime(to_yocto(1_000_000), to_yocto(500_000), 10u64.pow(15)); - // Change storage_proof_size_soft_limit to a smaller value + // Change main_storage_proof_size_soft_limit to a smaller value // The value of 500 is small enough to let the first receipt go through but not the second let mut runtime_config = RuntimeConfig::test(); - runtime_config.witness_config.storage_proof_size_soft_limit = 5000; + runtime_config.witness_config.main_storage_proof_size_soft_limit = 5000; apply_state.config = Arc::new(runtime_config); let create_acc_fn = |account_id| { @@ -3184,7 +3184,7 @@ mod tests { ) }; - // The function call to bob_account should hit the storage_proof_size_soft_limit + // The function call to bob_account should hit the main_storage_proof_size_soft_limit let apply_result = runtime .apply( tries.get_trie_for_shard(ShardUId::single_shard(), root).recording_reads(),