diff --git a/actors/miner/src/testing.rs b/actors/miner/src/testing.rs index 79a0ece39..4559ed905 100644 --- a/actors/miner/src/testing.rs +++ b/actors/miner/src/testing.rs @@ -3,7 +3,7 @@ use crate::{ SectorOnChainInfo, SectorPreCommitOnChainInfo, Sectors, State, }; use fil_actors_runtime::runtime::Policy; -use fil_actors_runtime::{parse_uint_key, Map, MessageAccumulator}; +use fil_actors_runtime::{parse_uint_key, Map, MessageAccumulator, DEFAULT_HAMT_CONFIG}; use fvm_ipld_bitfield::BitField; use fvm_ipld_blockstore::Blockstore; use fvm_ipld_encoding::CborStore; @@ -343,8 +343,11 @@ fn check_precommits( let mut precommit_total = TokenAmount::zero(); - let precommited_sectors = - Map::<_, SectorPreCommitOnChainInfo>::load(&state.pre_committed_sectors, store); + let precommited_sectors = Map::<_, SectorPreCommitOnChainInfo>::load_with_config( + &state.pre_committed_sectors, + store, + DEFAULT_HAMT_CONFIG, + ); match precommited_sectors { Ok(precommited_sectors) => { diff --git a/state/src/check.rs b/state/src/check.rs index 2988e7b22..cba3dc325 100644 --- a/state/src/check.rs +++ b/state/src/check.rs @@ -22,6 +22,7 @@ use fil_actor_reward::State as RewardState; use fil_actor_verifreg::{DataCap, State as VerifregState}; use fil_actors_runtime::runtime::Policy; +use fil_actors_runtime::DEFAULT_HAMT_CONFIG; use fil_actors_runtime::VERIFIED_REGISTRY_ACTOR_ADDR; use fil_actors_runtime::Map; @@ -82,7 +83,7 @@ where impl<'a, BS: Blockstore> Tree<'a, BS> { /// Loads a tree from a root CID and store pub fn load(store: &'a BS, root: &Cid) -> anyhow::Result { - let map = Map::load(root, store)?; + let map = Map::load_with_config(root, store, DEFAULT_HAMT_CONFIG)?; Ok(Tree { map, store }) } diff --git a/test_vm/src/lib.rs b/test_vm/src/lib.rs index 3a350a490..a68659b53 100644 --- a/test_vm/src/lib.rs +++ b/test_vm/src/lib.rs @@ -14,8 +14,8 @@ use fil_actor_verifreg::State as VerifRegState; use fil_actors_runtime::cbor::serialize; use fil_actors_runtime::runtime::builtins::Type; use fil_actors_runtime::runtime::{Policy, Primitives, EMPTY_ARR_CID}; -use fil_actors_runtime::test_utils::*; use fil_actors_runtime::DATACAP_TOKEN_ACTOR_ADDR; +use fil_actors_runtime::{test_utils::*, DEFAULT_HAMT_CONFIG}; use fil_actors_runtime::{ BURNT_FUNDS_ACTOR_ADDR, CRON_ACTOR_ADDR, EAM_ACTOR_ADDR, INIT_ACTOR_ADDR, REWARD_ACTOR_ADDR, STORAGE_MARKET_ACTOR_ADDR, STORAGE_POWER_ACTOR_ADDR, SYSTEM_ACTOR_ADDR, @@ -70,7 +70,11 @@ where BS: Blockstore, { pub fn new(store: &'bs MemoryBlockstore) -> TestVM<'bs, MemoryBlockstore> { - let mut actors = Hamt::<&'bs MemoryBlockstore, ActorState, BytesKey, Sha256>::new(store); + let mut actors = + Hamt::<&'bs MemoryBlockstore, ActorState, BytesKey, Sha256>::new_with_config( + store, + DEFAULT_HAMT_CONFIG, + ); TestVM { primitives: FakePrimitives {}, store, @@ -240,9 +244,10 @@ where pub fn checkpoint(&self) -> Cid { // persist cache on top of latest checkpoint and clear - let mut actors = Hamt::<&'bs BS, ActorState, BytesKey, Sha256>::load( + let mut actors = Hamt::<&'bs BS, ActorState, BytesKey, Sha256>::load_with_config( &self.state_root.borrow(), self.store, + DEFAULT_HAMT_CONFIG, ) .unwrap(); for (addr, act) in self.actors_cache.borrow().iter() { @@ -383,9 +388,10 @@ where return Some(act.clone()); } // go to persisted map - let actors = Hamt::<&'bs BS, ActorState, BytesKey, Sha256>::load( + let actors = Hamt::<&'bs BS, ActorState, BytesKey, Sha256>::load_with_config( &self.state_root.borrow(), self.store, + DEFAULT_HAMT_CONFIG, ) .unwrap(); let actor = actors.get(&address.to_bytes()).unwrap().cloned();