Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update types for all new V2 network upgrades #906

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fil_types"
description = "Filecoin types used in Forest."
version = "0.1.7"
version = "0.1.9"
license = "MIT OR Apache-2.0"
authors = ["ChainSafe Systems <info@chainsafe.io>"]
edition = "2018"
Expand Down
37 changes: 32 additions & 5 deletions types/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,24 @@ pub const UPGRADE_ACTORS_V2_HEIGHT: ChainEpoch = 138720;
pub const UPGRADE_TAPE_HEIGHT: ChainEpoch = 140760;
/// v6 network upgrade
pub const UPGRADE_KUMQUAT_HEIGHT: ChainEpoch = 170000;
/// v7 network upgrade
pub const UPGRADE_CALICO_HEIGHT: ChainEpoch = 265200;
/// v8 network upgrade
pub const UPGRADE_PERSIAN_HEIGHT: ChainEpoch = 272400;
/// v9 network upgrade
pub const UPGRADE_ORANGE_HEIGHT: ChainEpoch = 336458;
/// Remove burn on window PoSt fork
// TODO implement updates for height https://github.com/ChainSafe/forest/issues/905
pub const UPGRADE_CLAUS_HEIGHT: ChainEpoch = 343200;

pub const UPGRADE_LIFTOFF_HEIGHT: i64 = 148888;

pub const NEWEST_NETWORK_VERSION: NetworkVersion = NetworkVersion::V6;

struct Upgrade {
height: ChainEpoch,
network: NetworkVersion,
}

const MAINNET_SCHEDULE: [Upgrade; 6] = [
const MAINNET_SCHEDULE: [Upgrade; 9] = [
Upgrade {
height: UPGRADE_BREEZE_HEIGHT,
network: NetworkVersion::V1,
Expand All @@ -51,6 +58,18 @@ const MAINNET_SCHEDULE: [Upgrade; 6] = [
height: UPGRADE_KUMQUAT_HEIGHT,
network: NetworkVersion::V6,
},
Upgrade {
height: UPGRADE_CALICO_HEIGHT,
network: NetworkVersion::V7,
},
Upgrade {
height: UPGRADE_PERSIAN_HEIGHT,
network: NetworkVersion::V8,
},
Upgrade {
height: UPGRADE_ORANGE_HEIGHT,
network: NetworkVersion::V9,
},
];

/// Specifies the network version
Expand All @@ -69,10 +88,18 @@ pub enum NetworkVersion {
V4,
/// tape (increases max prove commit size by 10x)
V5,
// kumquat (specs-actors v2.2.0)
// kumquat (specs-actors v2.2.0)
V6,
/// upcoming
/// calico (specs-actors v2.3.2)
V7,
/// persian (post-2.3.2 behaviour transition)
V8,
/// orange
V9,
/// reserved
V10,
/// reserved
V11,
}

/// this function helps us check if we shoudl be getting the newest network
Expand Down
4 changes: 1 addition & 3 deletions vm/actor_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ impl From<NetworkVersion> for ActorVersion {
NetworkVersion::V0 | NetworkVersion::V1 | NetworkVersion::V2 | NetworkVersion::V3 => {
ActorVersion::V0
}
NetworkVersion::V4 | NetworkVersion::V5 | NetworkVersion::V6 | NetworkVersion::V7 => {
ActorVersion::V2
}
_ => ActorVersion::V2,
}
}
}
Expand Down