sync: correct vrfBase for ticket check

This commit is contained in:
Łukasz Magiera 2019-11-26 23:53:52 +01:00
parent d5a632f644
commit 407f6fa6f8
2 changed files with 5 additions and 5 deletions

View File

@ -575,7 +575,11 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) err
})
tktsCheck := async.Err(func() error {
if err := syncer.validateTicket(ctx, h.Miner, waddr, h.Ticket, baseTs); err != nil {
vrfBase := gen.TicketHash(baseTs.MinTicket(), h.Miner)
err := gen.VerifyVRF(ctx, waddr, h.Miner, gen.DSepTicket, vrfBase, h.Ticket.VRFProof)
if err != nil {
return xerrors.Errorf("validating block tickets failed: %w", err)
}
return nil

View File

@ -270,7 +270,6 @@ func TestSealAndVerify2(t *testing.T) {
t.Fatalf("%+v", err)
}
cleanup := func() {
sb.Destroy()
if err := os.RemoveAll(dir); err != nil {
t.Error(err)
}
@ -327,8 +326,6 @@ func TestAcquireID(t *testing.T) {
assertAcquire(2)
assertAcquire(3)
sb.Destroy()
sb, err = sectorbuilder.TempSectorbuilderDir(dir, sectorSize, ds)
if err != nil {
t.Fatalf("%+v", err)
@ -338,7 +335,6 @@ func TestAcquireID(t *testing.T) {
assertAcquire(5)
assertAcquire(6)
sb.Destroy()
if err := os.RemoveAll(dir); err != nil {
t.Error(err)
}