Skip to content

Commit 07b3b68

Browse files
committed
wire up stub objectstore actor
Signed-off-by: Sander Pick <sanderpick@gmail.com>
1 parent e3d1b21 commit 07b3b68

8 files changed

Lines changed: 30 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fendermint/actors/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ license.workspace = true
99
fendermint_actor_chainmetadata = { path = "chainmetadata", features = [
1010
"fil-actor",
1111
] }
12+
fendermint_actor_objectstore = { path = "objectstore", features = [
13+
"fil-actor",
14+
] }
1215

1316
[dependencies]
1417
cid = { workspace = true }
1518
anyhow = { workspace = true }
1619
fvm_ipld_blockstore = { workspace = true }
1720
fvm_ipld_encoding = { workspace = true }
1821
fendermint_actor_chainmetadata = { path = "chainmetadata" }
22+
fendermint_actor_objectstore = { path = "objectstore" }
1923

2024
[build-dependencies]
2125
fil_actors_runtime = { workspace = true, features = ["test_utils"] }

fendermint/actors/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::path::Path;
88
use std::process::{Command, Stdio};
99
use std::thread;
1010

11-
const ACTORS: &[&str] = &["chainmetadata"];
11+
const ACTORS: &[&str] = &["chainmetadata", "objectstore"];
1212

1313
const FILES_TO_WATCH: &[&str] = &["Cargo.toml", "src", "actors"];
1414

fendermint/actors/src/manifest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
use anyhow::{anyhow, Context};
44
use cid::Cid;
55
use fendermint_actor_chainmetadata::CHAINMETADATA_ACTOR_NAME;
6+
use fendermint_actor_objectstore::OBJECTSTORE_ACTOR_NAME;
67
use fvm_ipld_blockstore::Blockstore;
78
use fvm_ipld_encoding::CborStore;
89
use std::collections::HashMap;
910

1011
// array of required actors
11-
pub const REQUIRED_ACTORS: &[&str] = &[CHAINMETADATA_ACTOR_NAME];
12+
pub const REQUIRED_ACTORS: &[&str] = &[CHAINMETADATA_ACTOR_NAME, OBJECTSTORE_ACTOR_NAME];
1213

1314
/// A mapping of internal actor CIDs to their respective types.
1415
pub struct Manifest {

fendermint/vm/actor_interface/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub mod evm;
5353
pub mod init;
5454
pub mod ipc;
5555
pub mod multisig;
56+
pub mod objectstore;
5657
pub mod placeholder;
5758
pub mod reward;
5859
pub mod system;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright 2022-2024 Protocol Labs
2+
// SPDX-License-Identifier: Apache-2.0, MIT
3+
4+
// Note(sander): No idea what the right id here is or how to choose it
5+
define_id!(OBJECTSTORE { id: 101 });

fendermint/vm/interpreter/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fendermint_eth_hardhat = { path = "../../eth/hardhat" }
2121
fendermint_rpc = { path = "../../rpc" }
2222
fendermint_actors = { path = "../../actors" }
2323
fendermint_actor_chainmetadata = { path = "../../actors/chainmetadata" }
24+
fendermint_actor_objectstore = { path = "../../actors/objectstore" }
2425
ipc_actors_abis = { workspace = true }
2526

2627
ipc-api = { workspace = true }

fendermint/vm/interpreter/src/fvm/genesis.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ use fendermint_vm_actor_interface::diamond::{EthContract, EthContractMap};
1414
use fendermint_vm_actor_interface::eam::EthAddress;
1515
use fendermint_vm_actor_interface::ipc::IPC_CONTRACTS;
1616
use fendermint_vm_actor_interface::{
17-
account, burntfunds, chainmetadata, cron, eam, init, ipc, reward, system, EMPTY_ARR,
17+
account, burntfunds, chainmetadata, cron, eam, init, ipc, objectstore, reward, system,
18+
EMPTY_ARR,
1819
};
1920
use fendermint_vm_core::{chainid, Timestamp};
2021
use fendermint_vm_genesis::{ActorMeta, Genesis, Power, PowerScale, Validator};
@@ -247,6 +248,18 @@ where
247248
)
248249
.context("failed to create chainmetadata actor")?;
249250

251+
// Initialize the object store actor.
252+
let objectstore_state = fendermint_actor_objectstore::State::new(&state.store())?;
253+
state
254+
.create_custom_actor(
255+
fendermint_actor_objectstore::OBJECTSTORE_ACTOR_NAME,
256+
objectstore::OBJECTSTORE_ACTOR_ID,
257+
&objectstore_state,
258+
TokenAmount::zero(),
259+
None,
260+
)
261+
.context("failed to create objectstore actor")?;
262+
250263
// STAGE 2: Create non-builtin accounts which do not have a fixed ID.
251264

252265
// The next ID is going to be _after_ the accounts, which have already been assigned an ID by the `Init` actor.

0 commit comments

Comments
 (0)