Skip to content

Commit

Permalink
feat(runtime): restrict creation of non-implicit TLA (#9589)
Browse files Browse the repository at this point in the history
Implements near/NEPs#492
  • Loading branch information
bowenwang1996 authored and nikurt committed Oct 11, 2023
1 parent f94e2dc commit 877f113
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/primitives-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ protocol_feature_fix_staking_threshold = []
protocol_feature_fix_contract_loading_cost = []
protocol_feature_reject_blocks_with_outdated_protocol_version = []
protocol_feature_simple_nightshade_v2 = []
protocol_feature_restrict_tla = []

nightly = [
"nightly_protocol",
"protocol_feature_fix_contract_loading_cost",
"protocol_feature_fix_staking_threshold",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"protocol_feature_restrict_tla",
"protocol_feature_simple_nightshade_v2",
]

Expand Down
2 changes: 2 additions & 0 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ 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_simple_nightshade_v2 = ["near-primitives-core/protocol_feature_simple_nightshade_v2"]
protocol_feature_restrict_tla = ["near-primitives-core/protocol_feature_restrict_tla"]
nightly = [
"nightly_protocol",
"protocol_feature_fix_contract_loading_cost",
"protocol_feature_fix_staking_threshold",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"protocol_feature_restrict_tla",
"protocol_feature_simple_nightshade_v2",
"near-fmt/nightly",
"near-primitives-core/nightly",
Expand Down
2 changes: 2 additions & 0 deletions core/primitives/res/runtime_configs/139.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Implements NEP-492, disallowing all top-level accounts.
min_allowed_top_level_account_length: { old: 32, new: 65 }
1 change: 1 addition & 0 deletions core/primitives/src/runtime/config_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static CONFIG_DIFFS: &[(ProtocolVersion, &str)] = &[
(63, include_config!("63.yaml")),
(64, include_config!("64.yaml")),
(129, include_config!("129.yaml")),
(139, include_config!("139.yaml")),
];

/// Testnet parameters for versions <= 29, which (incorrectly) differed from mainnet parameters
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ protocol_feature_reject_blocks_with_outdated_protocol_version = [
protocol_feature_simple_nightshade_v2 = [
"near-primitives/protocol_feature_simple_nightshade_v2",
]
protocol_feature_restrict_tla = [
"near-primitives/protocol_feature_restrict_tla",
]

nightly = [
"nightly_protocol",
"protocol_feature_fix_contract_loading_cost",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"protocol_feature_restrict_tla",
"protocol_feature_simple_nightshade_v2",
"near-actix-test-utils/nightly",
"near-async/nightly",
Expand Down

0 comments on commit 877f113

Please sign in to comment.