From 01bcb9e8148f702045e7714bd449bd5eae7df141 Mon Sep 17 00:00:00 2001 From: Phi Date: Sat, 13 Apr 2024 10:58:16 -0500 Subject: [PATCH] Add nv23 skeleton Add nv23 skeleton --- fvm/Cargo.toml | 1 + fvm/src/gas/price_list.rs | 5 +++-- fvm/src/machine/default.rs | 5 +++++ shared/src/version/mod.rs | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/fvm/Cargo.toml b/fvm/Cargo.toml index 213b9f368..bed302101 100644 --- a/fvm/Cargo.toml +++ b/fvm/Cargo.toml @@ -57,3 +57,4 @@ arb = ["arbitrary", "quickcheck", "fvm_shared/arb"] m2-native = [] upgrade-actor = [] gas_calibration = [] +nv23-dev = [] \ No newline at end of file diff --git a/fvm/src/gas/price_list.rs b/fvm/src/gas/price_list.rs index 3baceaafe..fdd1b5329 100644 --- a/fvm/src/gas/price_list.rs +++ b/fvm/src/gas/price_list.rs @@ -967,8 +967,9 @@ impl PriceList { /// Returns gas price list by NetworkVersion for gas consumption. pub fn price_list_by_network_version(network_version: NetworkVersion) -> &'static PriceList { match network_version { - NetworkVersion::V21 => &WATERMELON_PRICES, - _ if network_version == NetworkVersion::V22 => &WATERMELON_PRICES, + NetworkVersion::V21 | NetworkVersion::V22 => &WATERMELON_PRICES, + #[cfg(feature = "nv23-dev")] + _ if network_version == NetworkVersion::V23 => &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 b9a42fd35..e73b40cd5 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 = "nv23-dev"))] const SUPPORTED_VERSIONS: RangeInclusive = NetworkVersion::V21..=NetworkVersion::V22; + #[cfg(feature = "nv23-dev")] + const SUPPORTED_VERSIONS: RangeInclusive = + NetworkVersion::V21..=NetworkVersion::V23; + 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 5f21ea8c3..81addc860 100644 --- a/shared/src/version/mod.rs +++ b/shared/src/version/mod.rs @@ -57,8 +57,10 @@ impl NetworkVersion { pub const V20: Self = Self(20); /// Watermelon (builtin-actors v12) pub const V21: Self = Self(21); - /// TBD builtin-actors v13 + /// Dragon (builtin-actors v13) pub const V22: Self = Self(22); + /// TBD (builtin-actors v14) + pub const V23: Self = Self(23); pub const MAX: Self = Self(u32::MAX);