non-debug 2k sector build mode

This commit is contained in:
Łukasz Magiera 2020-04-17 17:58:20 +02:00
parent bab352fb44
commit cdbf79fff5
5 changed files with 37 additions and 26 deletions

View File

@ -51,6 +51,9 @@ deps: $(BUILD_DEPS)
debug: GOFLAGS+=-tags=debug
debug: lotus lotus-storage-miner lotus-seal-worker lotus-seed
2k: GOFLAGS+=-tags=2k
2k: lotus lotus-storage-miner lotus-seal-worker lotus-seed
lotus: $(BUILD_DEPS)
rm -f lotus
go build $(GOFLAGS) -o lotus ./cmd/lotus

29
build/params_2k.go Normal file
View File

@ -0,0 +1,29 @@
// +build debug 2k
package build
import (
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/power"
)
func init() {
power.ConsensusMinerMinPower = big.NewInt(2048)
}
var SectorSizes = []abi.SectorSize{2048}
// Seconds
const BlockDelay = 6
const PropagationDelay = 3
// SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after
// which the miner is slashed
//
// Epochs
const SlashablePowerDelay = 20
// Epochs
const InteractivePoRepConfidence = 6

View File

@ -2,30 +2,8 @@
package build
import (
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/power"
)
func init() {
InsecurePoStValidation = true
power.ConsensusMinerMinPower = big.NewInt(2048)
}
var SectorSizes = []abi.SectorSize{2048}
// Seconds
const BlockDelay = 6
const PropagationDelay = 3
// SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after
// which the miner is slashed
//
// Epochs
const SlashablePowerDelay = 20
// Epochs
const InteractivePoRepConfidence = 6
// NOTE: Also includes settings from params_2k

View File

@ -1,4 +1,5 @@
// +build !debug
// +build !2k
package build

View File

@ -48,7 +48,7 @@ func init() {
addr, _ := address.NewIDAddress(1000)
var ticket *types.Ticket
{
w, err := api.StateMinerWorker(ctx, addr, head.Key())
mi, err := api.StateMinerInfo(ctx, addr, head.Key())
if err != nil {
return xerrors.Errorf("StateMinerWorker: %w", err)
}
@ -58,7 +58,7 @@ func init() {
return xerrors.Errorf("failed to get randomness: %w", err)
}
t, err := gen.ComputeVRF(ctx, api.WalletSign, w, rand)
t, err := gen.ComputeVRF(ctx, api.WalletSign, mi.Worker, rand)
if err != nil {
return xerrors.Errorf("compute vrf failed: %w", err)
}
@ -72,7 +72,7 @@ func init() {
uts := head.MinTimestamp() + uint64(build.BlockDelay)
nheight := head.Height() + 1
blk, err := api.MinerCreateBlock(ctx, &lapi.BlockTemplate{
addr, head.Key(), ticket, nil, nil, msgs, nheight, uts,
addr, head.Key(), ticket, nil, nil, msgs, nheight, uts, nil,
})
if err != nil {
return xerrors.Errorf("creating block: %w", err)