From 2e8b61ef939e69053dea9664064b8c58d3d793dd Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 30 Dec 2020 11:14:09 -0500 Subject: [PATCH 1/2] Update types for all new V2 network upgrades --- Cargo.lock | 48 +++++++++++++++++------------------ types/Cargo.toml | 2 +- types/src/version.rs | 36 +++++++++++++++++++++++--- vm/actor_interface/src/lib.rs | 4 +-- 4 files changed, 58 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ae54e8be26f..8923ed8313f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,7 +15,7 @@ name = "actor_interface" version = "0.1.0" dependencies = [ "fil_clock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_actor 0.1.0", "forest_actor 0.1.3", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -909,7 +909,7 @@ dependencies = [ "blake2b_simd", "byteorder 1.3.4", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", @@ -948,7 +948,7 @@ dependencies = [ "chain", "commcid 0.1.1", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", @@ -1120,7 +1120,7 @@ dependencies = [ "chain", "chain_sync", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flate2", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "fil_types" -version = "0.1.7" +version = "0.1.9" dependencies = [ "async-std", "base64 0.13.0", @@ -1951,9 +1951,9 @@ dependencies = [ [[package]] name = "fil_types" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbbaccb5a7e09ae8d86bd3f5677b970a8bc207b2f3eab5597653fabf8f1e3ccc" +checksum = "e67ed4efd05fbbd97b833c9096666a3591351f6c6e2a3b2d4ac999b87cc6f46c" dependencies = [ "async-std", "base64 0.13.0", @@ -2112,7 +2112,7 @@ dependencies = [ "chain", "chain_sync", "ctrlc", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", @@ -2154,7 +2154,7 @@ dependencies = [ "commcid 0.1.1", "derive_builder", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bitfield 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2191,7 +2191,7 @@ dependencies = [ "byteorder 1.3.4", "commcid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "fil_clock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bitfield 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2305,7 +2305,7 @@ dependencies = [ "byteorder 1.3.4", "derive_builder", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2558,7 +2558,7 @@ version = "0.6.1" dependencies = [ "base64 0.13.0", "derive_builder", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2579,7 +2579,7 @@ checksum = "4935036b1da07044b4c50cc7c228517be74f12a66fbbc6661c6f359a05f1dc74" dependencies = [ "base64 0.13.0", "derive_builder", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2598,7 +2598,7 @@ dependencies = [ "base64 0.13.0", "commcid 0.1.1", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "filecoin-proofs-api", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2620,7 +2620,7 @@ dependencies = [ "base64 0.13.0", "commcid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "fil_clock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "filecoin-proofs-api", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2890,7 +2890,7 @@ version = "0.1.0" dependencies = [ "async-std", "chain", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_blocks", "forest_car", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3316,7 +3316,7 @@ dependencies = [ "ahash 0.5.9", "byteorder 1.3.4", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", "forest_blocks", @@ -4186,7 +4186,7 @@ dependencies = [ "async-trait", "blake2b_simd", "chain", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", @@ -4721,7 +4721,7 @@ version = "0.1.0" dependencies = [ "async-std", "blake2b_simd", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.8", "isahc", "log", @@ -5404,7 +5404,7 @@ dependencies = [ "chain", "chain_sync", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5745,7 +5745,7 @@ version = "0.1.0" dependencies = [ "base64 0.13.0", "bls-signatures", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_blocks", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5998,7 +5998,7 @@ dependencies = [ "beacon", "chain", "fil_clock 0.1.0", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "filecoin-proofs-api", "flo_stream", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6030,7 +6030,7 @@ name = "state_tree" version = "0.1.0" dependencies = [ "actor_interface", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_bigint 0.1.3", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6047,7 +6047,7 @@ version = "0.1.0" dependencies = [ "colored", "difference", - "fil_types 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "fil_types 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "forest_address 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "forest_cid 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "forest_ipld 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/types/Cargo.toml b/types/Cargo.toml index 69cc4cca3416..6e1671be9f99 100644 --- a/types/Cargo.toml +++ b/types/Cargo.toml @@ -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 "] edition = "2018" diff --git a/types/src/version.rs b/types/src/version.rs index d74aae011f32..f6c078cd119b 100644 --- a/types/src/version.rs +++ b/types/src/version.rs @@ -16,17 +16,25 @@ 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, @@ -51,6 +59,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 @@ -69,10 +89,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 diff --git a/vm/actor_interface/src/lib.rs b/vm/actor_interface/src/lib.rs index b6cd04b54e0c..100d5912d303 100644 --- a/vm/actor_interface/src/lib.rs +++ b/vm/actor_interface/src/lib.rs @@ -24,9 +24,7 @@ impl From for ActorVersion { NetworkVersion::V0 | NetworkVersion::V1 | NetworkVersion::V2 | NetworkVersion::V3 => { ActorVersion::V0 } - NetworkVersion::V4 | NetworkVersion::V5 | NetworkVersion::V6 | NetworkVersion::V7 => { - ActorVersion::V2 - } + _ => ActorVersion::V2, } } } From 1543cef6cbd9bbde0d71632d560a43731ea29e28 Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 30 Dec 2020 15:21:25 -0500 Subject: [PATCH 2/2] fmt --- types/src/version.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/types/src/version.rs b/types/src/version.rs index f6c078cd119b..3775b00108df 100644 --- a/types/src/version.rs +++ b/types/src/version.rs @@ -28,7 +28,6 @@ pub const UPGRADE_CLAUS_HEIGHT: ChainEpoch = 343200; pub const UPGRADE_LIFTOFF_HEIGHT: i64 = 148888; - struct Upgrade { height: ChainEpoch, network: NetworkVersion,