INTERACTIVE PROEP IS ALIVE
This commit is contained in:
parent
3e515ab24c
commit
c550e030b1
chain/actors
lib/sectorbuilder
storage
@ -344,7 +344,7 @@ func (sma StorageMinerActor) ProveCommitSector(act *types.Actor, vmctx types.VMC
|
||||
if ok, err := ValidatePoRep(maddr, mi.SectorSize, commD, us.CommR, ticket, params.Proof, seed, params.SectorID); err != nil {
|
||||
return nil, err
|
||||
} else if !ok {
|
||||
return nil, aerrors.New(2, "bad proof!")
|
||||
return nil, aerrors.Newf(2, "bad proof! (t:%x; s:%x(%d); p:%x)", ticket, seed, us.SubmitHeight+build.InteractivePoRepDelay, params.Proof)
|
||||
}
|
||||
|
||||
// Note: There must exist a unique index in the miner's sector set for each
|
||||
|
@ -140,6 +140,7 @@ func VerifySeal(sectorSize uint64, commR, commD []byte, proverID address.Address
|
||||
copy(commDa[:], commD)
|
||||
copy(ticketa[:], ticket)
|
||||
copy(seeda[:], seed)
|
||||
seeda[31] = 0 // Temp Fr hack
|
||||
proverIDa := addressToProverID(proverID)
|
||||
|
||||
return sectorbuilder.VerifySeal(sectorSize, commRa, commDa, proverIDa, ticketa, seeda, sectorID, proof)
|
||||
|
@ -69,7 +69,7 @@ func TestSealAndVerify(t *testing.T) {
|
||||
|
||||
seed := sectorbuilder.SealSeed{
|
||||
BlockHeight: 15,
|
||||
TicketBytes: [32]byte{0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 45, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8},
|
||||
TicketBytes: [32]byte{0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 45, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 0},
|
||||
}
|
||||
|
||||
sco, err := sb.SealCommit(sid, seed)
|
||||
|
@ -143,6 +143,7 @@ func (s *Store) SealPreCommit(ctx context.Context, sectorID uint64) (sectorbuild
|
||||
func (s *Store) SealComputeProof(ctx context.Context, sectorID uint64, height uint64, rand []byte) ([]byte, error) {
|
||||
var tick [32]byte
|
||||
copy(tick[:], rand)
|
||||
tick[31] = 0
|
||||
|
||||
sco, err := s.sb.SealCommit(sectorID, sectorbuilder.SealSeed{
|
||||
BlockHeight: height,
|
||||
|
@ -97,7 +97,7 @@ func (m *Miner) preCommitted(ctx context.Context, sector SectorInfo) (func(*Sect
|
||||
return nil, err
|
||||
}
|
||||
|
||||
randHeight := mw.TipSet.Height() + build.InteractivePoRepDelay
|
||||
randHeight := mw.TipSet.Height() + build.InteractivePoRepDelay - 1 // -1 because of how the messages are applied
|
||||
log.Infof("precommit for sector %d made it on chain, will start post computation at height %d", sector.SectorID, randHeight)
|
||||
|
||||
err = m.events.ChainAt(func(ts *types.TipSet, curH uint64) error {
|
||||
@ -174,7 +174,7 @@ func (m *Miner) committing(ctx context.Context, sector SectorInfo) (func(*Sector
|
||||
}
|
||||
|
||||
if mw.Receipt.ExitCode != 0 {
|
||||
log.Error("UNHANDLED: submitting sector proof failed")
|
||||
log.Errorf("UNHANDLED: submitting sector proof failed (t:%x; s:%x(%d); p:%x)", sector.Ticket.TicketBytes, rand, sector.RandHeight, params.Proof)
|
||||
return nil, xerrors.New("UNHANDLED: submitting sector proof failed")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user