Skip to content

Commit

Permalink
Merge pull request #9358 from filecoin-project/asr/propagation
Browse files Browse the repository at this point in the history
fix: build: set PropagationDelaySecs correctly
  • Loading branch information
arajasek authored Sep 22, 2022
2 parents 7a2bc47 + 906d8bf commit ecc9af6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@ func init() {

Devnet = true

// 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)
pds, 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 {
PropagationDelaySecs = pds
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)
}
Expand All @@ -107,7 +110,7 @@ func init() {

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)

const PropagationDelaySecs = uint64(10)
var PropagationDelaySecs = uint64(10)

// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
Expand Down
4 changes: 2 additions & 2 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ func init() {
//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)
pds, 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 {
PropagationDelaySecs = pds
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)
}
Expand Down

0 comments on commit ecc9af6

Please sign in to comment.