From 508375a55c8b166c28c9ab6a835daed20b83cacd Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 6 Nov 2020 21:05:47 -0800 Subject: [PATCH] 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. --- node/impl/full/state.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 126ff0d7b..5bacd19c9 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -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) {