condition randomness changes on fork height
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
7a46c5ff31
commit
db6bd890d9
@ -358,7 +358,9 @@ func (cg *ChainGen) nextBlockProof(ctx context.Context, pts *types.TipSet, m add
|
|||||||
return nil, nil, nil, xerrors.Errorf("failed to cbor marshal address: %w", err)
|
return nil, nil, nil, xerrors.Errorf("failed to cbor marshal address: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.Write(pts.MinTicket().VRFProof)
|
if round > build.UpgradeSmokeHeight {
|
||||||
|
buf.Write(pts.MinTicket().VRFProof)
|
||||||
|
}
|
||||||
|
|
||||||
ticketRand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_TicketProduction, round-build.TicketRandomnessLookback, buf.Bytes())
|
ticketRand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_TicketProduction, round-build.TicketRandomnessLookback, buf.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -891,7 +891,9 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) (er
|
|||||||
return xerrors.Errorf("failed to marshal miner address to cbor: %w", err)
|
return xerrors.Errorf("failed to marshal miner address to cbor: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.Write(baseTs.MinTicket().VRFProof)
|
if h.Height > build.UpgradeSmokeHeight {
|
||||||
|
buf.Write(baseTs.MinTicket().VRFProof)
|
||||||
|
}
|
||||||
|
|
||||||
beaconBase := *prevBeacon
|
beaconBase := *prevBeacon
|
||||||
if len(h.BeaconEntries) != 0 {
|
if len(h.BeaconEntries) != 0 {
|
||||||
|
@ -447,9 +447,12 @@ func (m *Miner) computeTicket(ctx context.Context, brand *types.BeaconEntry, bas
|
|||||||
return nil, xerrors.Errorf("failed to marshal address to cbor: %w", err)
|
return nil, xerrors.Errorf("failed to marshal address to cbor: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.Write(base.TipSet.MinTicket().VRFProof)
|
round := base.TipSet.Height() + base.NullRounds + 1
|
||||||
|
if round > build.UpgradeSmokeHeight {
|
||||||
|
buf.Write(base.TipSet.MinTicket().VRFProof)
|
||||||
|
}
|
||||||
|
|
||||||
input, err := store.DrawRandomness(brand.Data, crypto.DomainSeparationTag_TicketProduction, base.TipSet.Height()+base.NullRounds+1-build.TicketRandomnessLookback, buf.Bytes())
|
input, err := store.DrawRandomness(brand.Data, crypto.DomainSeparationTag_TicketProduction, round-build.TicketRandomnessLookback, buf.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user