From be7806ba618c41f0834e0945260bc0e3bed299ed Mon Sep 17 00:00:00 2001 From: acud <12988138+acud@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:06:26 -0600 Subject: [PATCH] chore: disable hare4 --- config/config.go | 2 +- config/mainnet.go | 4 +--- config/presets/fastnet.go | 11 +---------- config/presets/testnet.go | 10 +--------- node/node.go | 1 + 5 files changed, 5 insertions(+), 23 deletions(-) diff --git a/config/config.go b/config/config.go index 83a3832a49..aac864e8da 100644 --- a/config/config.go +++ b/config/config.go @@ -193,7 +193,7 @@ func DefaultConfig() Config { P2P: p2p.DefaultConfig(), API: grpcserver.DefaultConfig(), HARE3: hare3.DefaultConfig(), - HARE4: hare4.DefaultConfig(), + HARE4: hare4.DefaultConfig(), // DEFAULT HARE4 IS DISABLED HareEligibility: eligibility.DefaultConfig(), Beacon: beacon.DefaultConfig(), TIME: timeConfig.DefaultConfig(), diff --git a/config/mainnet.go b/config/mainnet.go index cdf5bb8a9d..fdcc88d9aa 100644 --- a/config/mainnet.go +++ b/config/mainnet.go @@ -74,9 +74,7 @@ func MainnetConfig() Config { hare3conf.DisableLayer = forkLayer hare4conf := hare4.DefaultConfig() - hare4conf.Committee = 50 - hare4conf.Enable = true - hare4conf.EnableLayer = forkLayer + hare4conf.Enable = false return Config{ BaseConfig: BaseConfig{ DataDirParent: defaultDataDir, diff --git a/config/presets/fastnet.go b/config/presets/fastnet.go index aabc1bb236..de09ac0d19 100644 --- a/config/presets/fastnet.go +++ b/config/presets/fastnet.go @@ -33,22 +33,13 @@ func fastnet() config.Config { conf.ATXGradeDelay = 1 * time.Second conf.HARE3.Enable = true - conf.HARE3.DisableLayer = 22 + conf.HARE3.DisableLayer = types.LayerID(math.MaxUint32) conf.HARE3.Committee = 800 conf.HARE3.Leaders = 10 conf.HARE3.PreroundDelay = 3 * time.Second conf.HARE3.RoundDuration = 700 * time.Millisecond conf.HARE3.IterationsLimit = 2 - conf.HARE4.Enable = true - conf.HARE4.EnableLayer = types.LayerID(22) - conf.HARE4.DisableLayer = types.LayerID(math.MaxUint32) - conf.HARE4.Committee = 800 - conf.HARE4.Leaders = 10 - conf.HARE4.PreroundDelay = 3 * time.Second - conf.HARE4.RoundDuration = 700 * time.Millisecond - conf.HARE4.IterationsLimit = 2 - conf.P2P.MinPeers = 10 conf.Genesis = config.GenesisConfig{ diff --git a/config/presets/testnet.go b/config/presets/testnet.go index 4b9133cd40..892d924aaf 100644 --- a/config/presets/testnet.go +++ b/config/presets/testnet.go @@ -22,7 +22,6 @@ import ( "github.com/spacemeshos/go-spacemesh/fetch" "github.com/spacemeshos/go-spacemesh/hare3" "github.com/spacemeshos/go-spacemesh/hare3/eligibility" - "github.com/spacemeshos/go-spacemesh/hare4" "github.com/spacemeshos/go-spacemesh/miner" "github.com/spacemeshos/go-spacemesh/p2p" "github.com/spacemeshos/go-spacemesh/syncer" @@ -52,16 +51,10 @@ func testnet() config.Config { } hare3conf := hare3.DefaultConfig() hare3conf.Enable = true - hare3conf.EnableLayer = 0 - hare3conf.DisableLayer = 50 + hare3conf.EnableLayer = 7366 // NOTE(dshulyak) i forgot to set protocol name for testnet when we configured it manually. // we can't do rolling upgrade if protocol name changes, so lets keep it like that temporarily. hare3conf.ProtocolName = "" - hare4conf := hare4.DefaultConfig() - hare4conf.Enable = true - hare4conf.EnableLayer = 50 // TODO THIS NEEDS A VALUE - hare4conf.DisableLayer = math.MaxUint32 - defaultdir := filepath.Join(home, "spacemesh-testnet", "/") return config.Config{ Preset: "testnet", @@ -102,7 +95,6 @@ func testnet() config.Config { MinimalActiveSetWeight: []types.EpochMinimalActiveWeight{{Weight: 10_000}}, }, HARE3: hare3conf, - HARE4: hare4conf, HareEligibility: eligibility.Config{ ConfidenceParam: 20, }, diff --git a/node/node.go b/node/node.go index 7e06b83613..58e385f1fa 100644 --- a/node/node.go +++ b/node/node.go @@ -900,6 +900,7 @@ func (app *App) initServices(ctx context.Context) error { } if app.Config.HARE4.Enable { + panic("hare4 still not enabled") app.hare4 = hare4.New( app.clock, app.host,