Skip to content

Commit

Permalink
Check piece before PRU2 instead of PRU1 as PRU2 is the heavy computat…
Browse files Browse the repository at this point in the history
…ion part
  • Loading branch information
jennijuju committed Jan 11, 2022
1 parent 6b953a0 commit e99b988
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extern/storage-sealing/states_replica_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ func (m *Sealing) handleProveReplicaUpdate(ctx statemachine.Context, sector Sect
return xerrors.Errorf("invalid sector %d with nil CommR", sector.SectorNumber)
}

if err := checkPieces(ctx.Context(), m.maddr, sector, m.Api); err != nil { // Sanity check state
return handleErrors(ctx, err, sector)
}

vanillaProofs, err := m.sealer.ProveReplicaUpdate1(sector.sealingCtx(ctx.Context()), m.minerSector(sector.SectorType, sector.SectorNumber), *sector.CommR, *sector.UpdateSealed, *sector.UpdateUnsealed)
if err != nil {
return ctx.Send(SectorProveReplicaUpdateFailed{xerrors.Errorf("prove replica update (1) failed: %w", err)})
}

if err := checkPieces(ctx.Context(), m.maddr, sector, m.Api); err != nil { // Sanity check state
return handleErrors(ctx, err, sector)
}

proof, err := m.sealer.ProveReplicaUpdate2(sector.sealingCtx(ctx.Context()), m.minerSector(sector.SectorType, sector.SectorNumber), *sector.CommR, *sector.UpdateSealed, *sector.UpdateUnsealed, vanillaProofs)
if err != nil {
return ctx.Send(SectorProveReplicaUpdateFailed{xerrors.Errorf("prove replica update (2) failed: %w", err)})
Expand Down

0 comments on commit e99b988

Please sign in to comment.