Upgrade seal proof version in miner info after the upgrade.

This is terrible, but we don't (currently) update this in the miner info.

Q: Maybe we should delay this by a few epochs? Some pre-commits could fail if we
get a reorg.
This commit is contained in:
Steven Allen 2020-11-06 21:05:47 -08:00 committed by Łukasz Magiera
parent 1f91e7267d
commit 508375a55c

View File

@ -133,7 +133,16 @@ func (m *StateModule) StateMinerInfo(ctx context.Context, actor address.Address,
return miner.MinerInfo{}, xerrors.Errorf("failed to load miner actor state: %w", err)
}
return mas.Info()
// TODO: You know, this is terrible.
// I mean, we _really_ shouldn't do this. Maybe we should convert somewhere else?
info, err := mas.Info()
if err != nil {
return miner.MinerInfo{}, err
}
if m.StateManager.GetNtwkVersion(ctx, ts.Height()) >= network.Version7 && info.SealProofType < abi.RegisteredSealProof_StackedDrg2KiBV1_1 {
info.SealProofType += abi.RegisteredSealProof_StackedDrg2KiBV1_1
}
return info, nil
}
func (a *StateAPI) StateMinerDeadlines(ctx context.Context, m address.Address, tsk types.TipSetKey) ([]api.Deadline, error) {