From a3f209bec55f19122a1f953f89ff01cdf66e7ad5 Mon Sep 17 00:00:00 2001 From: Phi Date: Sun, 10 Nov 2024 15:46:10 +0700 Subject: [PATCH] feat: add nv25-skeleton feat: add nv25-skeleton --- fvm/Cargo.toml | 1 + fvm/src/gas/price_list.rs | 2 ++ fvm/src/machine/default.rs | 5 +++++ shared/src/version/mod.rs | 4 +++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fvm/Cargo.toml b/fvm/Cargo.toml index 04833a631..8670e24dc 100644 --- a/fvm/Cargo.toml +++ b/fvm/Cargo.toml @@ -61,3 +61,4 @@ gas_calibration = [] # The current implementation keeps it by default for backward compatibility reason. # See verify-signature = [] +nv25-dev = [] diff --git a/fvm/src/gas/price_list.rs b/fvm/src/gas/price_list.rs index 066638064..5768c67cd 100644 --- a/fvm/src/gas/price_list.rs +++ b/fvm/src/gas/price_list.rs @@ -1004,6 +1004,8 @@ pub fn price_list_by_network_version(network_version: NetworkVersion) -> &'stati NetworkVersion::V21 | NetworkVersion::V22 | NetworkVersion::V23 | NetworkVersion::V24 => { &WATERMELON_PRICES } + #[cfg(feature = "nv25-dev")] + NetworkVersion::V25 => &WATERMELON_PRICES, _ => panic!("network version {nv} not supported", nv = network_version), } } diff --git a/fvm/src/machine/default.rs b/fvm/src/machine/default.rs index 279719e8f..7f79927c0 100644 --- a/fvm/src/machine/default.rs +++ b/fvm/src/machine/default.rs @@ -51,9 +51,14 @@ where /// * `blockstore`: The underlying [blockstore][`Blockstore`] for reading/writing state. /// * `externs`: Client-provided ["external"][`Externs`] methods for accessing chain state. pub fn new(context: &MachineContext, blockstore: B, externs: E) -> anyhow::Result { + #[cfg(not(feature = "nv25-dev"))] const SUPPORTED_VERSIONS: RangeInclusive = NetworkVersion::V21..=NetworkVersion::V24; + #[cfg(feature = "nv25-dev")] + const SUPPORTED_VERSIONS: RangeInclusive = + NetworkVersion::V21..=NetworkVersion::V25; + debug!( "initializing a new machine, epoch={}, base_fee={}, nv={:?}, root={}", context.epoch, &context.base_fee, context.network_version, context.initial_state_root diff --git a/shared/src/version/mod.rs b/shared/src/version/mod.rs index 140c85460..46dc7d97b 100644 --- a/shared/src/version/mod.rs +++ b/shared/src/version/mod.rs @@ -61,8 +61,10 @@ impl NetworkVersion { pub const V22: Self = Self(22); /// Waffle (builtin-actors v14) pub const V23: Self = Self(23); - /// TBD (builtin-actors v15) + /// TukTuk (builtin-actors v15) pub const V24: Self = Self(24); + /// TBD (builtin-actors v16) + pub const V25: Self = Self(25); pub const MAX: Self = Self(u32::MAX);