diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fa75447116..ab3aefe43ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ In order to enable provide following configuration: * [#5032](https://github.com/spacemeshos/go-spacemesh/pull/5032) Ativeset data pruned from ballots. * [#5035](https://github.com/spacemeshos/go-spacemesh/pull/5035) Fix possible nil pointer panic when node fails to persist nipost builder state. * [#5079](https://github.com/spacemeshos/go-spacemesh/pull/5079) increase atx cache to 50 000 to reduce disk reads. +* [#5083](https://github.com/spacemeshos/go-spacemesh/pull/5083) Disable beacon protocol temporarily. ## v1.1.5 diff --git a/beacon/beacon.go b/beacon/beacon.go index 1dea37dbd79..aca51b944b4 100644 --- a/beacon/beacon.go +++ b/beacon/beacon.go @@ -231,13 +231,16 @@ func (pd *ProtocolDriver) setMetricsRegistry(registry *prometheus.Registry) { // Start starts listening for layers and outputs. func (pd *ProtocolDriver) Start(ctx context.Context) { pd.startOnce.Do(func() { - pd.logger.With().Info("starting beacon protocol", log.String("config", fmt.Sprintf("%+v", pd.config))) if pd.sync == nil { pd.logger.Fatal("update sync state provider can't be nil") } - pd.metricsCollector.Start(nil) + if pd.config.RoundsNumber == 0 { + pd.logger.Info("beacon protocol disabled") + return + } + pd.logger.With().Info("starting beacon protocol", log.String("config", fmt.Sprintf("%+v", pd.config))) pd.setProposalTimeForNextEpoch() pd.eg.Go(func() error { pd.listenEpochs(ctx) diff --git a/config/mainnet.go b/config/mainnet.go index c20dfbe4753..34b814727da 100644 --- a/config/mainnet.go +++ b/config/mainnet.go @@ -115,7 +115,7 @@ func MainnetConfig() Config { GracePeriodDuration: 10 * time.Minute, ProposalDuration: 4 * time.Minute, FirstVotingRoundDuration: 30 * time.Minute, - RoundsNumber: 300, + RoundsNumber: 0, VotingRoundDuration: 4 * time.Minute, WeakCoinRoundDuration: 4 * time.Minute, VotesLimit: 100, diff --git a/node/node.go b/node/node.go index e21e5e1d73c..3cfb44bfbc2 100644 --- a/node/node.go +++ b/node/node.go @@ -916,10 +916,12 @@ func (app *App) initServices(ctx context.Context) error { return errors.New("not synced for gossip") } - app.host.Register(pubsub.BeaconWeakCoinProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleWeakCoinProposal), pubsub.WithValidatorInline(true)) - app.host.Register(pubsub.BeaconProposalProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleProposal), pubsub.WithValidatorInline(true)) - app.host.Register(pubsub.BeaconFirstVotesProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleFirstVotes), pubsub.WithValidatorInline(true)) - app.host.Register(pubsub.BeaconFollowingVotesProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleFollowingVotes), pubsub.WithValidatorInline(true)) + if app.Config.Beacon.RoundsNumber > 0 { + app.host.Register(pubsub.BeaconWeakCoinProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleWeakCoinProposal), pubsub.WithValidatorInline(true)) + app.host.Register(pubsub.BeaconProposalProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleProposal), pubsub.WithValidatorInline(true)) + app.host.Register(pubsub.BeaconFirstVotesProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleFirstVotes), pubsub.WithValidatorInline(true)) + app.host.Register(pubsub.BeaconFollowingVotesProtocol, pubsub.ChainGossipHandler(syncHandler, beaconProtocol.HandleFollowingVotes), pubsub.WithValidatorInline(true)) + } app.host.Register(pubsub.ProposalProtocol, pubsub.ChainGossipHandler(syncHandler, proposalListener.HandleProposal)) app.host.Register(pubsub.AtxProtocol, pubsub.ChainGossipHandler(atxSyncHandler, atxHandler.HandleGossipAtx)) app.host.Register(pubsub.TxProtocol, pubsub.ChainGossipHandler(syncHandler, app.txHandler.HandleGossipTransaction))