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: GOFLAGS+=-tags=debug
|
||||||
debug: lotus lotus-storage-miner lotus-seal-worker lotus-seed
|
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)
|
lotus: $(BUILD_DEPS)
|
||||||
rm -f lotus
|
rm -f lotus
|
||||||
go build $(GOFLAGS) -o lotus ./cmd/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
|
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() {
|
func init() {
|
||||||
InsecurePoStValidation = true
|
InsecurePoStValidation = true
|
||||||
|
|
||||||
power.ConsensusMinerMinPower = big.NewInt(2048)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var SectorSizes = []abi.SectorSize{2048}
|
// NOTE: Also includes settings from params_2k
|
||||||
|
|
||||||
// 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
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// +build !debug
|
// +build !debug
|
||||||
|
// +build !2k
|
||||||
|
|
||||||
package build
|
package build
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func init() {
|
|||||||
addr, _ := address.NewIDAddress(1000)
|
addr, _ := address.NewIDAddress(1000)
|
||||||
var ticket *types.Ticket
|
var ticket *types.Ticket
|
||||||
{
|
{
|
||||||
w, err := api.StateMinerWorker(ctx, addr, head.Key())
|
mi, err := api.StateMinerInfo(ctx, addr, head.Key())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("StateMinerWorker: %w", err)
|
return xerrors.Errorf("StateMinerWorker: %w", err)
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ func init() {
|
|||||||
return xerrors.Errorf("failed to get randomness: %w", err)
|
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 {
|
if err != nil {
|
||||||
return xerrors.Errorf("compute vrf failed: %w", err)
|
return xerrors.Errorf("compute vrf failed: %w", err)
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ func init() {
|
|||||||
uts := head.MinTimestamp() + uint64(build.BlockDelay)
|
uts := head.MinTimestamp() + uint64(build.BlockDelay)
|
||||||
nheight := head.Height() + 1
|
nheight := head.Height() + 1
|
||||||
blk, err := api.MinerCreateBlock(ctx, &lapi.BlockTemplate{
|
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 {
|
if err != nil {
|
||||||
return xerrors.Errorf("creating block: %w", err)
|
return xerrors.Errorf("creating block: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user