Add extra check sanity check for timing

This commit is contained in:
whyrusleeping 2019-11-01 13:27:59 -07:00
parent 82344649d3
commit a13dfcf96b

View File

@ -308,6 +308,11 @@ func (sma StorageMinerActor) ProveCommitSector(act *types.Actor, vmctx types.VMC
if !ok {
return nil, aerrors.New(1, "no pre-commitment found for sector")
}
if us.SubmitHeight+build.InteractivePoRepDelay > vmctx.BlockHeight() {
return nil, aerrors.New(2, "too early for proof submission")
}
delete(self.PreCommittedSectors, uintToStringKey(params.SectorID))
// TODO: ensure normalization to ID address