non-debug 2k sector build mode
This commit is contained in:
parent
bab352fb44
commit
cdbf79fff5
3
Makefile
3
Makefile
@ -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
29
build/params_2k.go
Normal 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
|
@ -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
|
||||
|
@ -1,4 +1,5 @@
|
||||
// +build !debug
|
||||
// +build !2k
|
||||
|
||||
package build
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user