Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return null in MinerGetBaseInfo if miner hasn't been around for 900 epochs #4820

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 7 additions & 0 deletions src/state_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down
Loading