Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stateless_validation] Add a soft size limit for state witness #10703

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/parameters/res/runtime_configs/83.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
storage_proof_size_soft_limit: {old: 999_999_999_999_999, new: 16_000_000}
2 changes: 1 addition & 1 deletion core/parameters/res/runtime_configs/parameters.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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
min_allowed_top_level_account_length 65
registrar_account_id registrar
storage_amount_per_byte 10000000000000000000
Expand Down Expand Up @@ -180,4 +181,3 @@ function_call_weight true
vm_kind NearVm
eth_implicit_accounts false
yield_resume false

3 changes: 3 additions & 0 deletions core/parameters/res/runtime_configs/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pessimistic_gas_price_inflation: {
denominator: 100,
}

# Stateless validation config
storage_proof_size_soft_limit: 999_999_999_999_999

# Account creation config
min_allowed_top_level_account_length: 32
registrar_account_id: "registrar"
Expand Down
3 changes: 3 additions & 0 deletions core/parameters/res/runtime_configs/parameters_testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ pessimistic_gas_price_inflation: {
denominator: 100,
}

# Stateless validation config
storage_proof_size_soft_limit: 999_999_999_999_999

# Account creation config
min_allowed_top_level_account_length: 0
registrar_account_id: "registrar"
Expand Down
4 changes: 4 additions & 0 deletions core/parameters/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ 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,
}

impl RuntimeConfig {
Expand All @@ -45,6 +47,7 @@ impl RuntimeConfig {
fees: RuntimeFeesConfig::test(),
wasm_config,
account_creation_config: AccountCreationConfig::default(),
storage_proof_size_soft_limit: usize::MAX,
}
}

Expand All @@ -57,6 +60,7 @@ impl RuntimeConfig {
fees: RuntimeFeesConfig::free(),
wasm_config,
account_creation_config: AccountCreationConfig::default(),
storage_proof_size_soft_limit: usize::MAX,
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/parameters/src/config_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static CONFIG_DIFFS: &[(ProtocolVersion, &str)] = &[
(62, include_config!("62.yaml")),
(63, include_config!("63.yaml")),
(64, include_config!("64.yaml")),
(83, include_config!("83.yaml")),
(129, include_config!("129.yaml")),
// Introduce ETH-implicit accounts.
(138, include_config!("138.yaml")),
Expand Down Expand Up @@ -317,6 +318,7 @@ mod tests {
/// the new snapshot if it looks right.
#[test]
#[cfg(not(feature = "nightly"))]
#[cfg(not(feature = "statelessnet_protocol"))]
#[cfg(not(feature = "calimero_zero_storage"))]
fn test_json_unchanged() {
use crate::view::RuntimeConfigView;
Expand Down
3 changes: 3 additions & 0 deletions core/parameters/src/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub enum Parameter {
BurntGasReward,
PessimisticGasPriceInflation,

// Stateless validation config
StorageProofSizeSoftLimit,

// Account creation config
MinAllowedTopLevelAccountLength,
RegistrarAccountId,
Expand Down
1 change: 1 addition & 0 deletions core/parameters/src/parameter_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ impl TryFrom<&ParameterTable> for RuntimeConfig {
.get(Parameter::MinAllowedTopLevelAccountLength)?,
registrar_account_id: params.get(Parameter::RegistrarAccountId)?,
},
storage_proof_size_soft_limit: params.get(Parameter::StorageProofSizeSoftLimit)?,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 16000000
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 16000000
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 16000000
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ expression: config_view
"pessimistic_gas_price_inflation_ratio": [
103,
100
]
],
"storage_proof_size_soft_limit": 999999999999999
},
"wasm_config": {
"ext_costs": {
Expand Down
Loading
Loading