Skip to content

Commit

Permalink
yield_resume: stabilize
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed May 9, 2024
1 parent 92ee5d2 commit b903a73
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 94 deletions.
5 changes: 0 additions & 5 deletions core/parameters/res/runtime_configs/139.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions core/parameters/res/runtime_configs/66.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ wasm_contract_loading_bytes: {
old: 216_750,
new: 1_089_295,
}
yield_resume: { old: false, new: true }
wasm_yield_create_base: { old: 300_000_000_000_000, new: 153_411_779_276 }
wasm_yield_create_byte: { old: 300_000_000_000_000, new: 15_643_988 }
wasm_yield_resume_base: { old: 300_000_000_000_000, new: 1_195_627_285_210 }
wasm_yield_resume_byte: { old: 300_000_000_000_000, new: 17_212_011 }
10 changes: 5 additions & 5 deletions core/parameters/res/runtime_configs/parameters.snap
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ wasm_alt_bn128_pairing_check_base 9_686_000_000_000
wasm_alt_bn128_pairing_check_element 5_102_000_000_000
wasm_alt_bn128_g1_sum_base 3_000_000_000
wasm_alt_bn128_g1_sum_element 5_000_000_000
wasm_yield_create_base 300_000_000_000_000
wasm_yield_create_byte 300_000_000_000_000
wasm_yield_resume_base 300_000_000_000_000
wasm_yield_resume_byte 300_000_000_000_000
wasm_yield_create_base 153_411_779_276
wasm_yield_create_byte 15_643_988
wasm_yield_resume_base 1_195_627_285_210
wasm_yield_resume_byte 17_212_011
max_gas_burnt 300_000_000_000_000
max_gas_burnt_view 300_000_000_000_000
max_stack_height 262_144
Expand Down Expand Up @@ -181,4 +181,4 @@ alt_bn128 true
function_call_weight true
vm_kind NearVm
eth_implicit_accounts false
yield_resume false
yield_resume true
1 change: 0 additions & 1 deletion core/parameters/src/config_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ static CONFIG_DIFFS: &[(ProtocolVersion, &str)] = &[
(129, include_config!("129.yaml")),
// Introduce ETH-implicit accounts.
(138, include_config!("138.yaml")),
(139, include_config!("139.yaml")),
];

/// Testnet parameters for versions <= 29, which (incorrectly) differed from mainnet parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": true,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": true,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: config_view
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: config_view
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: "&view"
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: "&view"
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
2 changes: 0 additions & 2 deletions core/primitives-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ protocol_feature_fix_staking_threshold = []
protocol_feature_fix_contract_loading_cost = []
protocol_feature_reject_blocks_with_outdated_protocol_version = []
protocol_feature_nonrefundable_transfer_nep491 = []
yield_resume = []

nightly = [
"nightly_protocol",
"protocol_feature_fix_contract_loading_cost",
"protocol_feature_fix_staking_threshold",
"protocol_feature_nonrefundable_transfer_nep491",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"yield_resume",
]

nightly_protocol = [
Expand Down
5 changes: 1 addition & 4 deletions core/primitives-core/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ impl ProtocolFeature {
| ProtocolFeature::TestnetFewerBlockProducers
| ProtocolFeature::SimpleNightshadeV2 => 64,
ProtocolFeature::SimpleNightshadeV3 => 65,
ProtocolFeature::DecreaseFunctionCallBaseCost => 66,

// Nightly features which should be tested for compatibility with resharding
ProtocolFeature::YieldExecution => 78,
ProtocolFeature::DecreaseFunctionCallBaseCost | ProtocolFeature::YieldExecution => 66,

// This protocol version is reserved for use in resharding tests. An extra resharding
// is simulated on top of the latest shard layout in production. Note that later
Expand Down
2 changes: 0 additions & 2 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ protocol_feature_fix_staking_threshold = ["near-primitives-core/protocol_feature
protocol_feature_fix_contract_loading_cost = ["near-primitives-core/protocol_feature_fix_contract_loading_cost"]
protocol_feature_reject_blocks_with_outdated_protocol_version = ["near-primitives-core/protocol_feature_reject_blocks_with_outdated_protocol_version"]
protocol_feature_nonrefundable_transfer_nep491 = ["near-primitives-core/protocol_feature_nonrefundable_transfer_nep491"]
yield_resume = ["near-primitives-core/yield_resume"]

nightly = [
"near-async/nightly",
Expand All @@ -70,7 +69,6 @@ nightly = [
"protocol_feature_fix_staking_threshold",
"protocol_feature_nonrefundable_transfer_nep491",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"yield_resume",
]

nightly_protocol = [
Expand Down
2 changes: 0 additions & 2 deletions core/primitives/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ impl BorshDeserialize for ReceiptEnum {
match ordinal {
0u8 => Ok(ReceiptEnum::Action(ActionReceipt::deserialize_reader(rd)?)),
1u8 => Ok(ReceiptEnum::Data(DataReceipt::deserialize_reader(rd)?)),
#[cfg(feature = "yield_resume")]
2u8 => Ok(ReceiptEnum::PromiseYield(ActionReceipt::deserialize_reader(rd)?)),
#[cfg(feature = "yield_resume")]
3u8 => Ok(ReceiptEnum::PromiseResume(DataReceipt::deserialize_reader(rd)?)),
_ => Err(Error::from(ErrorKind::InvalidData)),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ expression: "&view"
"alt_bn128_g1_sum_element": 5000000000,
"alt_bn128_pairing_check_base": 9686000000000,
"alt_bn128_pairing_check_element": 5102000000000,
"yield_create_base": 300000000000000,
"yield_create_byte": 300000000000000,
"yield_resume_base": 300000000000000,
"yield_resume_byte": 300000000000000
"yield_create_base": 153411779276,
"yield_create_byte": 15643988,
"yield_resume_base": 1195627285210,
"yield_resume_byte": 1195627285210
},
"grow_mem_cost": 1,
"regular_op_cost": 822756,
Expand All @@ -187,7 +187,7 @@ expression: "&view"
"alt_bn128": true,
"function_call_weight": true,
"eth_implicit_accounts": false,
"yield_resume_host_functions": false,
"yield_resume_host_functions": true,
"limit_config": {
"max_gas_burnt": 300000000000000,
"max_stack_height": 262144,
Expand Down
2 changes: 0 additions & 2 deletions core/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ no_cache = []
single_thread_rocksdb = [] # Deactivate RocksDB IO background threads
test_features = []
new_epoch_sync = []
yield_resume = []

nightly_protocol = [
"near-async/nightly_protocol",
Expand All @@ -102,5 +101,4 @@ nightly = [
"near-primitives/nightly",
"near-vm-runner/nightly",
"nightly_protocol",
"yield_resume",
]
Loading

0 comments on commit b903a73

Please sign in to comment.