Deprecate enableSyncBacktracking flag (#8371)

* Deprecate enableSyncBacktracking flag

* keep deprecated flags
This commit is contained in:
Victor Farazdagi 2021-02-01 03:18:24 -08:00 committed by GitHub
parent 82426abf5f
commit 372dc47b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 21 deletions

View File

@ -33,7 +33,6 @@ go_library(
"//shared:go_default_library", "//shared:go_default_library",
"//shared/abool:go_default_library", "//shared/abool:go_default_library",
"//shared/bytesutil:go_default_library", "//shared/bytesutil:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/mathutil:go_default_library", "//shared/mathutil:go_default_library",
"//shared/params:go_default_library", "//shared/params:go_default_library",
"//shared/rand:go_default_library", "//shared/rand:go_default_library",

View File

@ -11,7 +11,6 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/db" "github.com/prysmaticlabs/prysm/beacon-chain/db"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/beacon-chain/p2p"
beaconsync "github.com/prysmaticlabs/prysm/beacon-chain/sync" beaconsync "github.com/prysmaticlabs/prysm/beacon-chain/sync"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -418,7 +417,7 @@ func (q *blocksQueue) onProcessSkippedEvent(ctx context.Context) eventHandlerFn
// All machines are skipped, FSMs need reset. // All machines are skipped, FSMs need reset.
startSlot := q.chain.HeadSlot() + 1 startSlot := q.chain.HeadSlot() + 1
if featureconfig.Get().EnableSyncBacktracking && q.mode == modeNonConstrained && startSlot > bestFinalizedSlot { if q.mode == modeNonConstrained && startSlot > bestFinalizedSlot {
q.staleEpochs[helpers.SlotToEpoch(startSlot)]++ q.staleEpochs[helpers.SlotToEpoch(startSlot)]++
// If FSMs have been reset enough times, try to explore alternative forks. // If FSMs have been reset enough times, try to explore alternative forks.
if q.staleEpochs[helpers.SlotToEpoch(startSlot)] >= maxResetAttempts { if q.staleEpochs[helpers.SlotToEpoch(startSlot)] >= maxResetAttempts {

View File

@ -17,7 +17,6 @@ import (
p2pt "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing" p2pt "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
beaconsync "github.com/prysmaticlabs/prysm/beacon-chain/sync" beaconsync "github.com/prysmaticlabs/prysm/beacon-chain/sync"
"github.com/prysmaticlabs/prysm/shared/bytesutil" "github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/sliceutil" "github.com/prysmaticlabs/prysm/shared/sliceutil"
"github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil"
"github.com/prysmaticlabs/prysm/shared/testutil/assert" "github.com/prysmaticlabs/prysm/shared/testutil/assert"
@ -1024,11 +1023,6 @@ func TestBlocksQueue_onCheckStaleEvent(t *testing.T) {
} }
func TestBlocksQueue_stuckInUnfavourableFork(t *testing.T) { func TestBlocksQueue_stuckInUnfavourableFork(t *testing.T) {
resetCfg := featureconfig.InitWithReset(&featureconfig.Flags{
EnableSyncBacktracking: true,
})
defer resetCfg()
beaconDB := dbtest.SetupDB(t) beaconDB := dbtest.SetupDB(t)
p2p := p2pt.NewTestP2P(t) p2p := p2pt.NewTestP2P(t)

View File

@ -44,7 +44,6 @@ type Flags struct {
EnableEth1DataMajorityVote bool // EnableEth1DataMajorityVote uses the Voting With The Majority algorithm to vote for eth1data. EnableEth1DataMajorityVote bool // EnableEth1DataMajorityVote uses the Voting With The Majority algorithm to vote for eth1data.
EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p. EnablePeerScorer bool // EnablePeerScorer enables experimental peer scoring in p2p.
EnablePruningDepositProofs bool // EnablePruningDepositProofs enables pruning deposit proofs which significantly reduces the size of a deposit EnablePruningDepositProofs bool // EnablePruningDepositProofs enables pruning deposit proofs which significantly reduces the size of a deposit
EnableSyncBacktracking bool // EnableSyncBacktracking enables backtracking algorithm when searching for alternative forks during initial sync.
EnableLargerGossipHistory bool // EnableLargerGossipHistory increases the gossip history we store in our caches. EnableLargerGossipHistory bool // EnableLargerGossipHistory increases the gossip history we store in our caches.
WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup. WriteWalletPasswordOnWebOnboarding bool // WriteWalletPasswordOnWebOnboarding writes the password to disk after Prysm web signup.
DisableAttestingHistoryDBCache bool // DisableAttestingHistoryDBCache for the validator client increases disk reads/writes. DisableAttestingHistoryDBCache bool // DisableAttestingHistoryDBCache for the validator client increases disk reads/writes.
@ -177,11 +176,6 @@ func ConfigureBeaconChain(ctx *cli.Context) {
log.Warn("Disabling pruning deposit proofs") log.Warn("Disabling pruning deposit proofs")
cfg.EnablePruningDepositProofs = false cfg.EnablePruningDepositProofs = false
} }
cfg.EnableSyncBacktracking = true
if ctx.Bool(disableSyncBacktracking.Name) {
log.Warn("Disabling init-sync backtracking algorithm")
cfg.EnableSyncBacktracking = false
}
if ctx.Bool(enableLargerGossipHistory.Name) { if ctx.Bool(enableLargerGossipHistory.Name) {
log.Warn("Using a larger gossip history for the node") log.Warn("Using a larger gossip history for the node")
cfg.EnableLargerGossipHistory = true cfg.EnableLargerGossipHistory = true

View File

@ -12,14 +12,20 @@ var (
Usage: deprecatedUsage, Usage: deprecatedUsage,
Hidden: true, Hidden: true,
} }
deprecatedDisableSyncBacktracking = &cli.StringFlag{ deprecatedEnableSyncBacktracking = &cli.StringFlag{
Name: "enable-sync-backtracking", Name: "enable-sync-backtracking",
Usage: deprecatedUsage, Usage: deprecatedUsage,
Hidden: true, Hidden: true,
} }
deprecatedDisableSyncBacktracking = &cli.StringFlag{
Name: "disable-sync-backtracking",
Usage: deprecatedUsage,
Hidden: true,
}
) )
var deprecatedFlags = []cli.Flag{ var deprecatedFlags = []cli.Flag{
exampleDeprecatedFeatureFlag, exampleDeprecatedFeatureFlag,
deprecatedEnableSyncBacktracking,
deprecatedDisableSyncBacktracking, deprecatedDisableSyncBacktracking,
} }

View File

@ -78,10 +78,6 @@ var (
Usage: "Disables pruning deposit proofs when they are no longer needed." + Usage: "Disables pruning deposit proofs when they are no longer needed." +
"This will probably significantly increase the amount of memory taken up by deposits.", "This will probably significantly increase the amount of memory taken up by deposits.",
} }
disableSyncBacktracking = &cli.BoolFlag{
Name: "disable-sync-backtracking",
Usage: "Disable alternative fork exploration backtracking algorithm",
}
enableLargerGossipHistory = &cli.BoolFlag{ enableLargerGossipHistory = &cli.BoolFlag{
Name: "enable-larger-gossip-history", Name: "enable-larger-gossip-history",
Usage: "Enables the node to store a larger amount of gossip messages in its cache.", Usage: "Enables the node to store a larger amount of gossip messages in its cache.",
@ -163,7 +159,6 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
enableLargerGossipHistory, enableLargerGossipHistory,
checkPtInfoCache, checkPtInfoCache,
disablePruningDepositProofs, disablePruningDepositProofs,
disableSyncBacktracking,
disableBroadcastSlashingFlag, disableBroadcastSlashingFlag,
enableNextSlotStateCache, enableNextSlotStateCache,
}...) }...)