Merge pull request #9290 from filecoin-project/jen/propgation
feat: env: propagation delay
This commit is contained in:
commit
b6d36436c3
@ -4,6 +4,9 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
@ -86,13 +89,25 @@ func init() {
|
|||||||
|
|
||||||
Devnet = true
|
Devnet = true
|
||||||
|
|
||||||
|
if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 {
|
||||||
|
PropagationDelaySecs, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
PropagationDelaySecs = uint64(10)
|
||||||
|
log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err,
|
||||||
|
PropagationDelaySecs)
|
||||||
|
} else {
|
||||||
|
log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+
|
||||||
|
"this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BuildType = BuildCalibnet
|
BuildType = BuildCalibnet
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||||
|
|
||||||
const PropagationDelaySecs = uint64(6)
|
const PropagationDelaySecs = uint64(10)
|
||||||
|
|
||||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||||
const BootstrapPeerThreshold = 4
|
const BootstrapPeerThreshold = 4
|
||||||
|
@ -6,6 +6,7 @@ package build
|
|||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
@ -87,6 +88,7 @@ var SupportedProofTypes = []abi.RegisteredSealProof{
|
|||||||
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||||
|
var PropagationDelaySecs = uint64(10)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
||||||
@ -97,6 +99,21 @@ func init() {
|
|||||||
UpgradeV17Height = math.MaxInt64
|
UpgradeV17Height = math.MaxInt64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
|
||||||
|
//set this value too high may impacts your block submission; set this value too low may cause you miss
|
||||||
|
//parent tipsets for blocking forming and mining.
|
||||||
|
if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 {
|
||||||
|
PropagationDelaySecs, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
PropagationDelaySecs = uint64(10)
|
||||||
|
log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err,
|
||||||
|
PropagationDelaySecs)
|
||||||
|
} else {
|
||||||
|
log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+
|
||||||
|
"this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Devnet = false
|
Devnet = false
|
||||||
|
|
||||||
BuildType = BuildMainnet
|
BuildType = BuildMainnet
|
||||||
@ -104,8 +121,6 @@ func init() {
|
|||||||
|
|
||||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||||
|
|
||||||
const PropagationDelaySecs = uint64(6)
|
|
||||||
|
|
||||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||||
const BootstrapPeerThreshold = 4
|
const BootstrapPeerThreshold = 4
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user