Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(f3): allow to disable f3 passive testing #12672

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions build/params_shared_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,24 @@ func IsF3Enabled() bool {
return false
}
}

func IsF3PassiveTestingEnabled() bool {
if !IsF3Enabled() {
return false
}
const F3DisablePassiveTesting = "LOTUS_DISABLE_F3_PASSIVE_TESTING"

v, disableEnvVarSet := os.LookupEnv(F3DisablePassiveTesting)
if !disableEnvVarSet {
// Environment variable to disable F3 passive testing is not set.
return true
}
switch strings.TrimSpace(strings.ToLower(v)) {
case "", "0", "false", "no":
// Consider these values as "do not disable".
return true
default:
// Consider any other value as disable.
return false
}
}
3 changes: 2 additions & 1 deletion chain/lf3/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/filecoin-project/go-f3/ec"
"github.com/filecoin-project/go-f3/manifest"

"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/modules/helpers"
Expand All @@ -35,7 +36,7 @@ func (hg *headGetter) GetHead(context.Context) (ec.TipSet, error) {
var MaxDynamicManifestChangesAllowed = 1000

func NewManifestProvider(mctx helpers.MetricsCtx, config *Config, cs *store.ChainStore, ps *pubsub.PubSub, mds dtypes.MetadataDS) (prov manifest.ManifestProvider, err error) {
if config.DynamicManifestProvider == "" {
if config.DynamicManifestProvider == "" || !build.IsF3PassiveTestingEnabled() {
if config.StaticManifest == nil {
return manifest.NoopManifestProvider{}, nil
}
Expand Down
Loading