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

Calibnet Support #1370

Merged
merged 22 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
899b440
scaffold network params
connormullett Dec 10, 2021
f18f887
Merge branch 'main' into connor/calibnet
connormullett Jan 12, 2022
bdeb708
Merge branch 'main' into connor/calibnet
connormullett Jan 18, 2022
8c6d20c
add new option for consensus min miner power
connormullett Jan 18, 2022
d1a0cbf
fix drand schedule; enable features
connormullett Jan 18, 2022
011af6e
add actor/calibnet feature
connormullett Jan 18, 2022
e2673f4
add calibnet feature to actor_interface
connormullett Jan 18, 2022
04010c3
Merge branch 'main' into connor/calibnet
connormullett Jan 26, 2022
0662347
debugging calibnet syncing
connormullett Jan 29, 2022
c5aaad4
Merge branch 'main' into connor/calibnet
connormullett Jan 31, 2022
e332842
add NL @ EOF
connormullett Feb 3, 2022
b202340
Merge branch 'main' into connor/calibnet
connormullett Feb 8, 2022
92dbb55
syncs with calib net
ec2 Feb 16, 2022
ffa619d
Merge branch 'main' into connor/calibnet
connormullett Feb 16, 2022
390d65d
Merge branch 'main' into connor/calibnet
q9f Feb 17, 2022
7909b00
vm/actors: run cargo fmt
q9f Feb 17, 2022
8857e16
Merge branch 'main' into connor/calibnet
q9f Feb 17, 2022
8d59c63
forest: fix cli network version
q9f Feb 17, 2022
02f44bf
test snapshot with more state
connormullett Feb 17, 2022
4d03a3c
Merge branch 'connor/calibnet' of github.com:ChainSafe/forest into co…
connormullett Feb 17, 2022
252e6ad
Merge branch 'main' into connor/calibnet
connormullett Feb 23, 2022
177b8c7
fix for sync panics
connormullett Feb 23, 2022
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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ interopnet:
devnet:
cargo build --manifest-path=forest/Cargo.toml --no-default-features --features "devnet, rocksdb"

calibnet:
cargo build --release --manifest-path=forest/Cargo.toml --no-default-features --features "calibnet, rocksdb"

docker-run:
docker build -t forest:latest -f ./Dockerfile . && docker run forest

Expand Down
1 change: 1 addition & 0 deletions forest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ rocksdb = ["db/rocksdb", "ipld_blockstore/rocksdb"]
sled = ["db/sled", "ipld_blockstore/sled"]
devnet = ["actor/devnet", "networks/devnet", "testnet"]
interopnet = ["actor/interopnet", "networks/interopnet", "testnet"]
calibnet = ["networks/calibnet"]
q9f marked this conversation as resolved.
Show resolved Hide resolved
insecure_post = ["chain_sync/insecure_post"]
testnet = []
release = []
3 changes: 2 additions & 1 deletion types/networks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ serde_json = "1.0"
mainnet = []
interopnet = []
devnet = []
conformance = []
conformance = []
calibnet = []
q9f marked this conversation as resolved.
Show resolved Hide resolved
Binary file added types/networks/src/calibnet/genesis.car
Binary file not shown.
104 changes: 104 additions & 0 deletions types/networks/src/calibnet/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use super::{
drand::{DRAND_INCENTINET, DRAND_MAINNET},
DrandPoint,
};
use clock::{ChainEpoch, EPOCH_DURATION_SECONDS};
use fil_types::NetworkVersion;

/// Default genesis car file bytes.
pub const DEFAULT_GENESIS: &[u8] = include_bytes!("genesis.car");

/// V1 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_BREEZE_HEIGHT: ChainEpoch = -1;

/// V2 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_SMOKE_HEIGHT: ChainEpoch = -2;

/// V3 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_IGNITION_HEIGHT: ChainEpoch = -3;

/// V4 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_ACTORS_V2_HEIGHT: ChainEpoch = 30;

/// V5 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_TAPE_HEIGHT: ChainEpoch = 60;

#[cfg(feature = "calibnet")]
pub const UPGRADE_LIFTOFF_HEIGHT: i64 = -5;

/// V6 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_KUMQUAT_HEIGHT: ChainEpoch = 90;

/// V7 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_CALICO_HEIGHT: ChainEpoch = 120;

/// V8 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_PERSIAN_HEIGHT: ChainEpoch = 272400;

/// V9 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_ORANGE_HEIGHT: ChainEpoch = 300;

/// Remove burn on window PoSt fork
#[cfg(feature = "calibnet")]
pub const UPGRADE_CLAUS_HEIGHT: ChainEpoch = 270;

/// V10 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_ACTORS_V3_HEIGHT: ChainEpoch = 330;

/// V11 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_NORWEGIAN_HEIGHT: ChainEpoch = 360;

/// V12 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_ACTORS_V4_HEIGHT: ChainEpoch = 390;

/// V13 network upgrade
#[cfg(feature = "calibnet")]
pub const UPGRADE_HYPERDRIVE_HEIGHT: ChainEpoch = 420;

/// V14 network update
#[cfg(feature = "calibnet")]
pub const UPGRADE_ACTORS_V6_HEIGHT: ChainEpoch = 312746;

pub const UPGRADE_PLACEHOLDER_HEIGHT: ChainEpoch = 9999999;

/// Current network version for the network
pub const NEWEST_NETWORK_VERSION: NetworkVersion = NetworkVersion::V14;

/// Bootstrap peer ids
pub const DEFAULT_BOOTSTRAP: &[&str] = &[
"/dns4/bootstrap-0.calibration.fildev.network/tcp/1347/p2p/12D3KooWRLZAseMo9h7fRD6ojn6YYDXHsBSavX5YmjBZ9ngtAEec",
q9f marked this conversation as resolved.
Show resolved Hide resolved
"/dns4/bootstrap-1.calibration.fildev.network/tcp/1347/p2p/12D3KooWJFtDXgZEQMEkjJPSrbfdvh2xfjVKrXeNFG1t8ioJXAzv",
"/dns4/bootstrap-2.calibration.fildev.network/tcp/1347/p2p/12D3KooWP1uB9Lo7yCA3S17TD4Y5wStP5Nk7Vqh53m8GsFjkyujD",
"/dns4/bootstrap-3.calibration.fildev.network/tcp/1347/p2p/12D3KooWLrPM4WPK1YRGPCUwndWcDX8GCYgms3DiuofUmxwvhMCn",
];

lazy_static! {
pub(super) static ref DRAND_SCHEDULE: [DrandPoint<'static>; 2] = [
q9f marked this conversation as resolved.
Show resolved Hide resolved
DrandPoint {
height: 0,
config: &*DRAND_INCENTINET,
},
DrandPoint {
height: UPGRADE_SMOKE_HEIGHT,
config: &*DRAND_MAINNET,
},
];
}

/// Time, in seconds, between each block.
pub const BLOCK_DELAY_SECS: u64 = EPOCH_DURATION_SECONDS as u64;
55 changes: 47 additions & 8 deletions types/networks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,75 @@ mod drand;
not(feature = "devnet"),
not(feature = "mainnet"),
not(feature = "conformance"),
not(feature = "calibnet")
))]
compile_error!(
"No network feature selected. Exactly one of \"mainnet\", \"devnet\", \"interopnet\", or \"conformance\" must be enabled for this crate."
);

#[cfg(all(
feature = "mainnet",
any(feature = "interopnet", feature = "devnet", feature = "conformance",)
any(
feature = "interopnet",
feature = "devnet",
feature = "conformance",
feature = "calibnet"
q9f marked this conversation as resolved.
Show resolved Hide resolved
)
))]
compile_error!(
"\"mainnet\" feature cannot be combined with \"devnet\", \"interopnet\", or \"conformance\"."
"\"mainnet\" feature cannot be combined with \"devnet\", \"interopnet\", or \"conformance\", or \"calibnet\"."
);

#[cfg(all(
feature = "conformance",
any(feature = "interopnet", feature = "devnet", feature = "mainnet",)
any(
feature = "interopnet",
feature = "devnet",
feature = "mainnet",
feature = "calibnet"
)
))]
compile_error!(
"\"conformance\" feature cannot be combined with \"devnet\", \"interopnet\", or \"mainnet\"."
"\"conformance\" feature cannot be combined with \"devnet\", \"interopnet\", or \"mainnet\", \"calibnet\"."
);

#[cfg(all(
feature = "devnet",
any(feature = "interopnet", feature = "conformance", feature = "mainnet",)
any(
feature = "interopnet",
feature = "conformance",
feature = "mainnet",
feature = "calibnet"
)
))]
compile_error!(
"\"devnet\" feature cannot be combined with \"conformance\", \"interopnet\", or \"mainnet\"."
"\"devnet\" feature cannot be combined with \"conformance\", \"interopnet\", or \"mainnet\", \"calibnet\"."
);

#[cfg(all(
feature = "interopnet",
any(feature = "conformance", feature = "devnet", feature = "mainnet",)
any(
feature = "conformance",
feature = "devnet",
feature = "mainnet",
feature = "calibnet"
)
))]
compile_error!(
"\"interopnet\" feature cannot be combined with \"devnet\", \"conformance\", or \"mainnet\"."
"\"interopnet\" feature cannot be combined with \"devnet\", \"conformance\", or \"mainnet\", \"calibnet\"."
);

#[cfg(all(
feature = "calibnet",
any(
feature = "conformance",
feature = "devnet",
feature = "mainnet",
feature = "interopnet"
)
))]
compile_error!(
"\"interopnet\" feature cannot be combined with \"devnet\", \"conformance\", or \"mainnet\", \"interopnet\"."
);

// Both mainnet and conformance parameters are kept in the 'mainnet' module.
Expand All @@ -68,6 +102,11 @@ mod devnet;
#[cfg(feature = "devnet")]
pub use self::devnet::*;

#[cfg(feature = "calibnet")]
mod calibnet;
#[cfg(feature = "calibnet")]
pub use self::calibnet::*;

/// Defines the different hard fork parameters.
struct Upgrade {
/// When the hard fork will happen
Expand Down
3 changes: 3 additions & 0 deletions vm/actor/src/builtin/sector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub fn consensus_miner_min_power(p: RegisteredPoStProof) -> Result<StoragePower,
if cfg!(feature = "interopnet") {
return Ok(StoragePower::from(2 << 30));
}
if cfg!(feature = "calibnet") {
q9f marked this conversation as resolved.
Show resolved Hide resolved
return Ok(StoragePower::from(32 << 30));
}

Ok(StoragePower::from(10u64 << 40))
}
Expand Down