Skip to content

Commit a877aa2

Browse files
authored
Merge pull request #6411 from filecoin-project/feat/disable-f3-env
feat: Disable f3 environment variables
2 parents dfef682 + b1f10b4 commit a877aa2

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

fixtures/networks/network_parse.go

+9
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ import (
55
"strings"
66

77
"github.com/filecoin-project/venus/pkg/config"
8+
"github.com/filecoin-project/venus/pkg/constants"
89
"github.com/filecoin-project/venus/venus-shared/types"
910
"github.com/filecoin-project/venus/venus-shared/utils"
11+
logging "github.com/ipfs/go-log/v2"
1012
)
1113

14+
var log = logging.Logger("network-params")
15+
1216
func GetNetworkFromName(name string) (types.NetworkType, error) {
1317
if name == "2k" || strings.HasPrefix(name, "localnet-") {
1418
return types.Network2k, nil
@@ -43,6 +47,11 @@ func SetConfigFromNetworkType(cfg *config.Config, networkType types.NetworkType)
4347
cfg.NetworkParams = &netcfg.Network
4448
// not change, expect to adjust the value through the configuration file
4549
cfg.NetworkParams.AllowableClockDriftSecs = oldAllowableClockDriftSecs
50+
51+
if constants.DisableF3 {
52+
cfg.NetworkParams.F3Enabled = false
53+
log.Warnf("F3 is disabled")
54+
}
4655
return nil
4756
}
4857

pkg/constants/env.go

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ var NoSlashFilter = os.Getenv("VENUS_NO_SLASHFILTER") == "_yes_i_know_and_i_acce
1313

1414
// NoMigrationResultCache will not use cached migration results
1515
var NoMigrationResultCache = os.Getenv("VENUS_NO_MIGRATION_RESULT_CACHE") == "1"
16+
17+
// DisableF3 disable f3
18+
var DisableF3 = os.Getenv("VENUS_DISABLE_F3") == "1"

venus-shared/api/chain/v1/method.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1805,9 +1805,10 @@ Response:
18051805
```
18061806

18071807
### StateGetBeaconEntry
1808-
StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If
1809-
the entry has not yet been produced, the call will block until the entry
1810-
becomes available
1808+
StateGetBeaconEntry returns the beacon entry for the given filecoin epoch
1809+
by using the recorded entries on the chain. If the entry for the requested
1810+
epoch has not yet been produced, the call will block until the entry
1811+
becomes available.
18111812

18121813

18131814
Perms: read

0 commit comments

Comments
 (0)