Skip to content

Commit

Permalink
plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Mar 7, 2024
1 parent 3006fda commit b1130ac
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 750 deletions.
57 changes: 28 additions & 29 deletions Cargo.lock

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

24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ dialoguer = "0.11"
digest = "0.10.5"
directories = "5"
ethereum-types = "0.14.1"
fil_actor_account_state = { version = "10.0.0-dev.1" }
fil_actor_cron_state = { version = "10.0.0-dev.1" }
fil_actor_datacap_state = { version = "10.0.0-dev.1" }
fil_actor_init_state = { version = "10.0.0-dev.1" }
fil_actor_interface = { version = "10.0.0-dev.1" }
fil_actor_market_state = { version = "10.0.0-dev.1" }
fil_actor_miner_state = { version = "10.0.0-dev.1" }
fil_actor_power_state = { version = "10.0.0-dev.1" }
fil_actor_reward_state = { version = "10.0.0-dev.1" }
fil_actor_system_state = { version = "10.0.0-dev.1" }
fil_actor_verifreg_state = { version = "10.0.0-dev.1" }
fil_actors_shared = { version = "10.0.0-dev.1", features = ["json"] }
fil_actor_account_state = { version = "10.0.0-dev.2" }
fil_actor_cron_state = { version = "10.0.0-dev.2" }
fil_actor_datacap_state = { version = "10.0.0-dev.2" }
fil_actor_init_state = { version = "10.0.0-dev.2" }
fil_actor_interface = { version = "10.0.0-dev.2" }
fil_actor_market_state = { version = "10.0.0-dev.2" }
fil_actor_miner_state = { version = "10.0.0-dev.2" }
fil_actor_power_state = { version = "10.0.0-dev.2" }
fil_actor_reward_state = { version = "10.0.0-dev.2" }
fil_actor_system_state = { version = "10.0.0-dev.2" }
fil_actor_verifreg_state = { version = "10.0.0-dev.2" }
fil_actors_shared = { version = "10.0.0-dev.2", features = ["json"] }
filecoin-proofs-api = { version = "16.0", default-features = false }
flume = "0.11"
fs_extra = "1.2"
Expand Down
20 changes: 10 additions & 10 deletions scripts/devnet/.env
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2024-02-29-a2919fe
LOTUS_IMAGE=lotus-devnet
FOREST_DATA_DIR=/forest_data
LOTUS_DATA_DIR=/lotus_data
FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
LOTUS_RPC_PORT=1234
LOTUS_P2P_PORT=1235
MINER_RPC_PORT=2345
FOREST_RPC_PORT=3456
GENESIS_NETWORK_VERSION=18
SHARK_HEIGHT=-10
HYGGE_HEIGHT=-9
LIGHTNING_HEIGHT=3
THUNDER_HEIGHT=6
WATERMELON_HEIGHT=9
DRAGON_HEIGHT=1000
DRAND_QUICKNET_HEIGHT=12
TARGET_HEIGHT=15
GENESIS_NETWORK_VERSION=21
SHARK_HEIGHT=-20
HYGGE_HEIGHT=-22
LIGHTNING_HEIGHT=-23
THUNDER_HEIGHT=-24
WATERMELON_HEIGHT=-1
DRAGON_HEIGHT=20
DRAND_QUICKNET_HEIGHT=140
TARGET_HEIGHT=200
2 changes: 1 addition & 1 deletion scripts/devnet/lotus.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update && apt-get install -y ca-certificates build-essential clang o

WORKDIR /lotus

RUN git clone --depth 1 --branch v1.25.2 https://github.com/filecoin-project/lotus.git .
RUN git clone --depth 1 --branch asr/migration-nv22 https://github.com/filecoin-project/lotus.git .

RUN CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" \
CGO_CFLAGS="-D__BLST_PORTABLE__" \
Expand Down
2 changes: 2 additions & 0 deletions src/networks/actors_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub static ACTOR_BUNDLES: Lazy<Box<[ActorBundleInfo]>> = Lazy::new(|| {
"bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs" @ "v12.0.0-rc.1" for "calibrationnet",
"bafy2bzacebl4w5ptfvuw6746w7ev562idkbf5ppq72e6zub22435ws2rukzru" @ "v12.0.0-rc.2" for "calibrationnet",
"bafy2bzacednzb3pkrfnbfhmoqtb3bc6dgvxszpqklf3qcc7qzcage4ewzxsca" @ "v12.0.0" for "calibrationnet",
"bafy2bzaceap46ftyyuhninmzelt2ev6kus5itrggszrk5wuhzf2khm47dtrfa" @ "v13.0.0-rc.2" for "calibrationnet",
"bafy2bzaceaiy4dsxxus5xp5n5i4tjzkb7sc54mjz7qnk2efhgmsrobjesxnza" @ "v11.0.0" for "butterflynet",
"bafy2bzacectxvbk77ntedhztd6sszp2btrtvsmy7lp2ypnrk6yl74zb34t2cq" @ "v12.0.0" for "butterflynet",
"bafy2bzacedozk3jh2j4nobqotkbofodq4chbrabioxbfrygpldgoxs3zwgggk" @ "v9.0.3" for "devnet",
Expand All @@ -80,6 +81,7 @@ pub static ACTOR_BUNDLES: Lazy<Box<[ActorBundleInfo]>> = Lazy::new(|| {
"bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos" @ "v10.0.0" for "mainnet",
"bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo" @ "v11.0.0" for "mainnet",
"bafy2bzaceapkgfggvxyllnmuogtwasmsv5qi2qzhc2aybockd6kag2g5lzaio" @ "v12.0.0" for "mainnet",
"bafy2bzacea6f5icdp6t6fs5sexjxmo3q5d2qu4g4ghq6s5eaob6svnmhvltmw" @ "v13.0.0-rc.2" for "mainnet",
])
});

Expand Down
8 changes: 6 additions & 2 deletions src/networks/calibnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use libp2p::Multiaddr;
use once_cell::sync::Lazy;
use std::str::FromStr;

use super::{drand::DRAND_MAINNET, parse_bootstrap_peers, DrandPoint, Height, HeightInfo};
use super::{
drand::DRAND_MAINNET, get_upgrade_height_from_env, parse_bootstrap_peers, DrandPoint, Height,
HeightInfo,
};

/// Default genesis car file bytes.
pub const DEFAULT_GENESIS: &[u8] = include_bytes!("genesis.car");
Expand Down Expand Up @@ -191,10 +194,11 @@ pub static HEIGHT_INFOS: Lazy<HashMap<Height, HeightInfo>> = Lazy::new(|| {
),
},
),
// TODO: This shouldn't be modifiable outside of testing
(
Height::Dragon,
HeightInfo {
epoch: 1_413_574,
epoch: get_upgrade_height_from_env("FOREST_DRAGON_HEIGHT").unwrap_or(1_427_974),
bundle: Some(
Cid::try_from("bafy2bzaceap46ftyyuhninmzelt2ev6kus5itrggszrk5wuhzf2khm47dtrfa")
.unwrap(),
Expand Down
4 changes: 2 additions & 2 deletions src/networks/devnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ pub static HEIGHT_INFOS: Lazy<HashMap<Height, HeightInfo>> = Lazy::new(|| {
(
Height::Thunder,
HeightInfo {
epoch: get_upgrade_height_from_env("FOREST_THUNDER_HEIGHT").unwrap_or(-1),
epoch: get_upgrade_height_from_env("FOREST_THUNDER_HEIGHT").unwrap_or(-23),
bundle: None,
},
),
(
Height::Watermelon,
HeightInfo {
epoch: get_upgrade_height_from_env("FOREST_WATERMELON_HEIGHT").unwrap_or(10),
epoch: get_upgrade_height_from_env("FOREST_WATERMELON_HEIGHT").unwrap_or(-1),
bundle: Some(
Cid::try_from("bafy2bzaceasjdukhhyjbegpli247vbf5h64f7uvxhhebdihuqsj2mwisdwa6o")
.unwrap(),
Expand Down
12 changes: 11 additions & 1 deletion src/networks/mainnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::str::FromStr;

use super::{
drand::{DRAND_INCENTINET, DRAND_MAINNET, DRAND_QUICKNET},
parse_bootstrap_peers, DrandPoint, Height, HeightInfo,
get_upgrade_height_from_env, parse_bootstrap_peers, DrandPoint, Height, HeightInfo,
};

const SMOKE_HEIGHT: ChainEpoch = 51000;
Expand Down Expand Up @@ -202,6 +202,16 @@ pub static HEIGHT_INFOS: Lazy<HashMap<Height, HeightInfo>> = Lazy::new(|| {
),
},
),
(
Height::Dragon,
HeightInfo {
epoch: get_upgrade_height_from_env("FOREST_DRAGON_HEIGHT").unwrap_or(i64::MAX),
bundle: Some(
Cid::try_from("bafy2bzacea6f5icdp6t6fs5sexjxmo3q5d2qu4g4ghq6s5eaob6svnmhvltmw")
.unwrap(),
),
},
),
])
});

Expand Down
6 changes: 6 additions & 0 deletions src/state_migration/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ pub(in crate::state_migration) trait ActorMigration<BS: Blockstore> {
store: &BS,
input: ActorMigrationInput,
) -> anyhow::Result<Option<ActorMigrationOutput>>;

/// Some migration jobs might need to be deferred to be executed after the regular state migration.
/// These may require some metadata collected during other migrations.
fn is_deferred(&self) -> bool {
false
}
}

/// Trait that defines the interface for actor migration job to be executed after the state migration.
Expand Down
Loading

0 comments on commit b1130ac

Please sign in to comment.