Skip to content

Commit

Permalink
Add nv23 skeleton
Browse files Browse the repository at this point in the history
Add nv23 skeleton
  • Loading branch information
rjan90 committed Apr 14, 2024
1 parent ea72025 commit 01bcb9e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions fvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ arb = ["arbitrary", "quickcheck", "fvm_shared/arb"]
m2-native = []
upgrade-actor = []
gas_calibration = []
nv23-dev = []
5 changes: 3 additions & 2 deletions fvm/src/gas/price_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand Down
5 changes: 5 additions & 0 deletions fvm/src/machine/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
#[cfg(not(feature = "nv23-dev"))]
const SUPPORTED_VERSIONS: RangeInclusive<NetworkVersion> =
NetworkVersion::V21..=NetworkVersion::V22;

#[cfg(feature = "nv23-dev")]
const SUPPORTED_VERSIONS: RangeInclusive<NetworkVersion> =
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
Expand Down
4 changes: 3 additions & 1 deletion shared/src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 01bcb9e

Please sign in to comment.