diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb112fa25c..3557434757 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: CACHE_SKIP_SAVE: ${{ matrix.push == '' || matrix.push == 'false' }} strategy: matrix: - network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs' ] + network: [ 'mainnet', 'caterpillarnet', 'butterflynet', 'calibrationnet', 'devnet', 'testing', 'testing-fake-proofs', 'wallaby', 'devnet-wasm' ] steps: - name: Checking out uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 609dd565a3..5b6079d6c6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ target *.wasm .idea/ **/.DS_Store -output/builtin-actors.car +output/*.car diff --git a/Makefile b/Makefile index 7336b03dc2..6496b0bfe4 100644 --- a/Makefile +++ b/Makefile @@ -72,8 +72,11 @@ bundle-calibrationnet: deps-build bundle-devnet: deps-build BUILD_FIL_NETWORK=devnet cargo run -- -o output/builtin-actors-devnet.car -bundle-devnet-m2-native: deps-build - BUILD_FIL_NETWORK=devnet-m2-native cargo run -- -o output/builtin-actors-devnet-m2-native.car +bundle-wallaby: deps-build + BUILD_FIL_NETWORK=wallaby cargo run -- -o output/builtin-actors-wallaby.car + +bundle-devnet-wasm: deps-build + BUILD_FIL_NETWORK=devnet-wasm cargo run -- -o output/builtin-actors-devnet-wasm.car bundle-testing: deps-build BUILD_FIL_NETWORK=testing cargo run -- -o output/builtin-actors-testing.car diff --git a/actors/init/Cargo.toml b/actors/init/Cargo.toml index 1f3e88a94f..4aa90ce4d1 100644 --- a/actors/init/Cargo.toml +++ b/actors/init/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["filecoin", "web3", "wasm"] crate-type = ["cdylib", "lib"] [dependencies] -fil_actors_runtime = { version = "9.0.0-alpha.1", path = "../../runtime", features = ["fil-actor"] } +fil_actors_runtime = { version = "9.0.0-alpha.1", path = "../../runtime" } fvm_shared = { version = "0.8.0", default-features = false } fvm_ipld_hamt = "0.5.1" serde = { version = "1.0.136", features = ["derive"] } @@ -30,5 +30,5 @@ fvm_ipld_encoding = "0.2.2" fil_actors_runtime = { version = "9.0.0-alpha.1", path = "../../runtime", features = ["test_utils", "sector-default"] } [features] -fil-actor = [] +fil-actor = ["fil_actors_runtime/fil-actor"] m2-native = ["fil_actors_runtime/m2-native"] diff --git a/build.rs b/build.rs index d552a9ad6d..66d593b829 100644 --- a/build.rs +++ b/build.rs @@ -32,6 +32,8 @@ const DEFAULT_CARGO_FEATURES: &[&str] = &["fil-actor"]; /// Extra Cargo-level features to enable per network. const EXTRA_CARGO_FEATURES: &[(&str, &[&str])] = &[ + ("devnet-wasm", &["m2-native"]), + /*("devnet-evm", &["m2-fevm"]),*/ ("wallaby", &["m2-native"]), ]; @@ -51,8 +53,10 @@ fn network_name() -> String { Some("calibrationnet") } else if cfg!(feature = "devnet") { Some("devnet") - } else if cfg!(feature = "devnet-m2-native") { - Some("devnet-m2-native") + } else if cfg!(feature = "devnet-wasm") { + Some("devnet-wasm") + }else if cfg!(feature = "wallaby") { + Some("wallaby") } else if cfg!(feature = "testing") { Some("testing") } else if cfg!(feature = "testing-fake-proofs") { diff --git a/runtime/build.rs b/runtime/build.rs index 54fbf7b5d8..a73e1fd50e 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -1,7 +1,7 @@ -static NETWORKS: &[(&str, &[&str])] = &[ - ("mainnet", &["sector-32g", "sector-64g"]), +static NETWORKS: &[(&[&str], &[&str])] = &[ + (&["mainnet"], &["sector-32g", "sector-64g"]), ( - "caterpillarnet", + &["caterpillarnet"], &[ "sector-512m", "sector-32g", @@ -11,15 +11,11 @@ static NETWORKS: &[(&str, &[&str])] = &[ "min-power-2k", ], ), - ("butterflynet", &["sector-512m", "sector-32g", "sector-64g", "min-power-2g"]), - ("calibrationnet", &["sector-32g", "sector-64g", "min-power-32g"]), - ("devnet", &["sector-2k", "sector-8m", "small-deals", "short-precommit", "min-power-2k"]), + (&["butterflynet", "wallaby"], &["sector-512m", "sector-32g", "sector-64g", "min-power-2g"]), + (&["calibrationnet"], &["sector-32g", "sector-64g", "min-power-32g"]), + (&["devnet", "devnet-wasm", /*devnet-fevm*/], &["sector-2k", "sector-8m", "small-deals", "short-precommit", "min-power-2k"]), ( - "devnet-m2-native", - &["sector-2k", "sector-8m", "small-deals", "short-precommit", "min-power-2k", "m2-native"], - ), - ( - "testing", + &["testing"], &[ "sector-2k", "sector-8m", @@ -33,7 +29,7 @@ static NETWORKS: &[(&str, &[&str])] = &[ ], ), ( - "testing-fake-proofs", + &["testing-fake-proofs"], &[ "sector-2k", "sector-8m", @@ -50,12 +46,22 @@ static NETWORKS: &[(&str, &[&str])] = &[ ]; const NETWORK_ENV: &str = "BUILD_FIL_NETWORK"; +/// This build script enables _local_ compile features. These features do not +/// affect the dependency graph (they are not processed by Cargo). They are only +/// in effect for conditional compilation _in this crate_. +/// +/// The reason we can't set these features as Cargo features from the root build +/// is that this crate is only ever used as a _transitive_ dependency from actor +/// crates. +/// +/// So the only two options are: (a) actors crates set the features when +/// importing us as a dependency (super repetitive), or (b) this. fn main() { let network = std::env::var(NETWORK_ENV).ok(); println!("cargo:rerun-if-env-changed={}", NETWORK_ENV); let network = network.as_deref().unwrap_or("mainnet"); - let features = NETWORKS.iter().find(|(k, _)| k == &network).expect("unknown network").1; + let features = NETWORKS.iter().find(|(k, _)| k.contains(&network)).expect("unknown network").1; for feature in features { println!("cargo:rustc-cfg=feature=\"{}\"", feature); }