Merge pull request #1658 from filecoin-project/fix/winning-post-rand-epoch
winning post wants the actual epoch of the block, not the previous
This commit is contained in:
commit
63bc34a1a0
@ -479,8 +479,7 @@ func MinerGetBaseInfo(ctx context.Context, sm *StateManager, bcn beacon.RandomBe
|
|||||||
return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
|
return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use the right dst, also NB: not using any 'entropy' in this call because nicola really didnt want it
|
prand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, round, buf.Bytes())
|
||||||
prand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, round-1, buf.Bytes())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
|
return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -752,7 +752,7 @@ func (syncer *Syncer) VerifyWinningPoStProof(ctx context.Context, h *types.Block
|
|||||||
rbase = h.BeaconEntries[len(h.BeaconEntries)-1]
|
rbase = h.BeaconEntries[len(h.BeaconEntries)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, h.Height-1, buf.Bytes())
|
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, h.Height, buf.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("failed to get randomness for verifying winningPost proof: %w", err)
|
return xerrors.Errorf("failed to get randomness for verifying winningPost proof: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ func (m *Miner) mineOne(ctx context.Context, addr address.Address, base *MiningB
|
|||||||
return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
|
return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, base.TipSet.Height()+base.NullRounds, buf.Bytes())
|
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, base.TipSet.Height()+base.NullRounds+1, buf.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
|
return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user