Skip to content

Commit

Permalink
near-vm: add a nightly feature (near#9119)
Browse files Browse the repository at this point in the history
This replaces the wasmer2 test instead of adding a new one because of near#8590.
  • Loading branch information
nagisa authored and nikurt committed Jun 8, 2023
1 parent 26e1e56 commit 57a13b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ protocol_feature_fix_staking_threshold = []
protocol_feature_fix_contract_loading_cost = []
protocol_feature_reject_blocks_with_outdated_protocol_version = []
protocol_feature_preparation_v2 = []
protocol_feature_near_vm_runtime = []
nightly = [
"nightly_protocol",
"protocol_feature_fix_staking_threshold",
"protocol_feature_fix_contract_loading_cost",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"protocol_feature_preparation_v2",
"protocol_feature_near_vm_runtime",
]

nightly_protocol = []
Expand Down
4 changes: 4 additions & 0 deletions core/primitives/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ pub enum ProtocolFeature {
RejectBlocksWithOutdatedProtocolVersions,
#[cfg(feature = "protocol_feature_preparation_v2")]
PreparationV2,
#[cfg(feature = "protocol_feature_near_vm_runtime")]
NearVmRuntime,
}

/// Both, outgoing and incoming tcp connections to peers, will be rejected if `peer's`
Expand Down Expand Up @@ -266,6 +268,8 @@ impl ProtocolFeature {
ProtocolFeature::RejectBlocksWithOutdatedProtocolVersions => 132,
#[cfg(feature = "protocol_feature_preparation_v2")]
ProtocolFeature::PreparationV2 => 133,
#[cfg(feature = "protocol_feature_near_vm_runtime")]
ProtocolFeature::NearVmRuntime => 133,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions integration-tests/src/tests/client/features/nearvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use near_primitives::transaction::{Action, FunctionCallAction, Transaction};
use nearcore::config::GenesisExt;

#[cfg_attr(all(target_arch = "aarch64", target_vendor = "apple"), ignore)]
#[cfg(feature = "nightly")]
#[test]
fn test_nearvm_upgrade() {
let mut capture = near_o11y::testonly::TracingCapture::enable();
Expand Down
1 change: 1 addition & 0 deletions runtime/near-vm-runner/src/vm_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl VMKind {
if cfg!(not(target_arch = "x86_64")) {
return VMKind::Wasmtime;
}
#[cfg(feature = "nightly")]
if checked_feature!("stable", NearVmRuntime, protocol_version) {
return VMKind::NearVm;
}
Expand Down

0 comments on commit 57a13b2

Please sign in to comment.