Skip to content

Commit

Permalink
add buggy miner cid
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Nov 3, 2023
1 parent 47c1de3 commit 32351c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions fil_actor_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fvm_shared4 = { workspace = true }
lazy_static.workspace = true
multihash = { workspace = true, features = ["identity"] }
num.workspace = true
once_cell = "1.18.0"
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
Expand Down
9 changes: 8 additions & 1 deletion fil_actor_interface/src/builtin/miner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0, MIT

use std::borrow::Cow;
use std::str::FromStr;

use crate::convert::*;
use crate::Policy;
Expand All @@ -18,6 +19,7 @@ use fvm_shared::{
sector::{RegisteredPoStProof, RegisteredSealProof, SectorNumber, SectorSize},
};
use num::BigInt;
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};

use crate::{io::get_obj, power::Claim};
Expand All @@ -41,7 +43,12 @@ pub fn is_v11_miner_cid(cid: &Cid) -> bool {
}

pub fn is_v12_miner_cid(cid: &Cid) -> bool {
crate::KNOWN_CIDS.actor.miner.v12.contains(cid)
// The following code cid existed temporarily on the calibnet testnet, as a "buggy" storage miner actor implementation.
// See corresponding Lotus PR: https://github.com/filecoin-project/lotus/pull/11363
let v12_buggy_miner = Lazy::new(|| {
Cid::from_str("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq").unwrap()
});
crate::KNOWN_CIDS.actor.miner.v12.contains(cid) || cid == &*v12_buggy_miner
}

/// Miner actor state.
Expand Down

0 comments on commit 32351c7

Please sign in to comment.