Prep for e=5

This commit is contained in:
Łukasz Magiera 2019-10-13 03:18:59 +02:00
parent a576b72364
commit 16a9ab875c
3 changed files with 6 additions and 1 deletions

View File

@ -38,6 +38,9 @@ const AllowableClockDrift = BlockDelay * 2
// Blocks // Blocks
const ForkLengthThreshold = 100 const ForkLengthThreshold = 100
// Blocks (e)
const BlocksPerRound = 1
// ///// // /////
// Proofs / Mining // Proofs / Mining

View File

@ -413,7 +413,7 @@ func IsRoundWinner(ctx context.Context, ts *types.TipSet, ticks []*types.Ticket,
return false, nil, xerrors.Errorf("failed to check power: %w", err) return false, nil, xerrors.Errorf("failed to check power: %w", err)
} }
return types.PowerCmp(vrfout, pow.MinerPower, pow.TotalPower), vrfout, nil return types.PowerCmp(vrfout, types.BigMul(pow.MinerPower, types.NewInt(build.BlocksPerRound)), pow.TotalPower), vrfout, nil
} }
type SignFunc func(context.Context, address.Address, []byte) (*types.Signature, error) type SignFunc func(context.Context, address.Address, []byte) (*types.Signature, error)

View File

@ -75,6 +75,8 @@ func NewTipSet(blks []*BlockHeader) (*TipSet, error) {
return nil, fmt.Errorf("cannot create tipset with mismatching heights") return nil, fmt.Errorf("cannot create tipset with mismatching heights")
} }
ts.cids = append(ts.cids, b.Cid()) ts.cids = append(ts.cids, b.Cid())
// TODO: ensure the same parents
} }
ts.height = blks[0].Height ts.height = blks[0].Height