From b291215da4a08507c9da572fbc989410428a347d Mon Sep 17 00:00:00 2001 From: lemmih Date: Mon, 30 Sep 2024 13:46:59 +0200 Subject: [PATCH 1/2] return null if miner hasn't been around for 900 epochs --- src/state_manager/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/state_manager/mod.rs b/src/state_manager/mod.rs index 9179cdfa5f0c..cf50250b8118 100644 --- a/src/state_manager/mod.rs +++ b/src/state_manager/mod.rs @@ -1214,7 +1214,14 @@ where epoch, )?; + // If the miner actor doesn't exist in the current tipset, it is a + // user-error and we must return an error message. If the miner exists + // in the current tipset but not in the lookback tipset, we may not + // error and should instead return None. let actor = self.get_required_actor(&addr, *tipset.parent_state())?; + if self.get_actor(&addr, lb_state_root)?.is_none() { + return Ok(None); + } let miner_state = miner::State::load(self.blockstore(), actor.code, actor.state)?; From 14bc35771d6b6cfddc3b848ec1e3c6ae1677c640 Mon Sep 17 00:00:00 2001 From: lemmih Date: Mon, 30 Sep 2024 13:49:41 +0200 Subject: [PATCH 2/2] changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da3b10f39246..de5f06aebb86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ - [#4809](https://github.com/ChainSafe/forest/issues/4777) the Mac OS X build on Apple silicons works +- [#4820](https://github.com/ChainSafe/forest/pull/4820) Fix edge-case in + `Filecoin.MinerGetBaseInfo` RPC method. ## Forest 0.20.0 "Brexit"