Skip to content

Commit

Permalink
fix serde
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Apr 13, 2023
1 parent 34aa712 commit 20db14d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
2 changes: 1 addition & 1 deletion forest/daemon/src/bundle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ where
1,
"expected one root when loading actors bundle"
);
println!("Loaded actors bundle with CID: {}", result[0]);
info!("Loaded actors bundle with CID: {}", result[0]);
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion networks/src/calibnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub static ref HEIGHT_INFOS: [HeightInfo; 19] = [
height: Height::Hygge,
epoch: 322_354,
bundle: Some(ActorBundleInfo {
manifest: Cid::try_from("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos").unwrap(),
manifest: Cid::try_from("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo").unwrap(),
url: Url::parse("https://github.com/filecoin-project/builtin-actors/releases/download/v10.0.0-rc.1/builtin-actors-calibrationnet.car").unwrap()
}),
},
Expand Down
16 changes: 0 additions & 16 deletions networks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use std::sync::Arc;

use ahash::HashMap;
use cid::Cid;
use fil_actors_runtime_v10::runtime::Policy;
use forest_beacon::{BeaconPoint, BeaconSchedule, DrandBeacon, DrandConfig};
Expand Down Expand Up @@ -119,7 +118,6 @@ pub struct ChainConfig {
#[serde(default = "default_policy")]
pub policy: Policy,
pub eth_chain_id: u64,
pub manifests: HashMap<NetworkVersion, Cid>,
}

impl ChainConfig {
Expand All @@ -133,13 +131,6 @@ impl ChainConfig {
height_infos: HEIGHT_INFOS.to_vec(),
policy: Policy::mainnet(),
eth_chain_id: MAINNET_ETH_CHAIN_ID,
manifests: [(
NetworkVersion::V18,
Cid::try_from("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos")
.unwrap(),
)]
.into_iter()
.collect(),
}
}
pub fn calibnet() -> Self {
Expand All @@ -152,13 +143,6 @@ impl ChainConfig {
height_infos: HEIGHT_INFOS.to_vec(),
policy: Policy::calibnet(),
eth_chain_id: CALIBNET_ETH_CHAIN_ID,
manifests: [(
NetworkVersion::V18,
Cid::try_from("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo")
.unwrap(),
)]
.into_iter()
.collect(),
}
}

Expand Down
19 changes: 11 additions & 8 deletions vm/state_migration/src/nv18/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ use std::sync::Arc;
use anyhow::anyhow;
use cid::Cid;
use fil_actor_system_v9::State as SystemStateV9;
use forest_networks::ChainConfig;
use forest_networks::{ChainConfig, Height};
use forest_shim::{
address::Address,
clock::ChainEpoch,
machine::{Manifest, ManifestV2},
state_tree::{StateTree, StateTreeVersion},
version::NetworkVersion,
};
use forest_utils::db::BlockstoreExt;
use fvm_ipld_blockstore::Blockstore;
Expand Down Expand Up @@ -76,11 +75,15 @@ where
DB: 'static + Blockstore + Clone + Send + Sync,
{
let new_manifest_cid = chain_config
.manifests
.get(&NetworkVersion::V18)
.ok_or_else(|| anyhow!("no manifest for network version NV18"))?;

blockstore.get(new_manifest_cid)?.ok_or_else(|| {
.height_infos
.get(Height::Hygge as usize)
.ok_or_else(|| anyhow!("no height info for network version NV18"))?
.bundle
.as_ref()
.ok_or_else(|| anyhow!("no bundle info for network version NV18"))?
.manifest;

blockstore.get(&new_manifest_cid)?.ok_or_else(|| {
anyhow!(
"manifest for network version NV18 not found in blockstore: {}",
new_manifest_cid
Expand All @@ -97,7 +100,7 @@ where
.collect();

let mut migration = StateMigration::<DB>::new(Some(verifier), post_migration_actions);
migration.add_nv18_migrations(blockstore.clone(), state, new_manifest_cid)?;
migration.add_nv18_migrations(blockstore.clone(), state, &new_manifest_cid)?;

let actors_in = StateTree::new_from_root(blockstore.clone(), state)?;
let actors_out = StateTree::new(blockstore.clone(), StateTreeVersion::V5)?;
Expand Down

0 comments on commit 20db14d

Please sign in to comment.