Skip to content

Commit

Permalink
chore: disable hare4
Browse files Browse the repository at this point in the history
  • Loading branch information
acud committed Jul 23, 2024
1 parent 45745c7 commit be7806b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 1 addition & 3 deletions config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 1 addition & 10 deletions config/presets/fastnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
10 changes: 1 addition & 9 deletions config/presets/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -102,7 +95,6 @@ func testnet() config.Config {
MinimalActiveSetWeight: []types.EpochMinimalActiveWeight{{Weight: 10_000}},
},
HARE3: hare3conf,
HARE4: hare4conf,
HareEligibility: eligibility.Config{
ConfidenceParam: 20,
},
Expand Down
1 change: 1 addition & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check failure on line 904 in node/node.go

View workflow job for this annotation

GitHub Actions / lint

unreachable: unreachable code (govet)
app.clock,
app.host,
Expand Down

0 comments on commit be7806b

Please sign in to comment.