Skip to content

Commit

Permalink
sync: disable mesh agreement on mainnet (spacemeshos#5522)
Browse files Browse the repository at this point in the history
the goal of mesh agreement is to download ballots and activations when partitions made individual progress.
such as in Partition_50_50 or 70_30 tests.

however on mainnet it creates unnecessary load by triggering queries to download atx. i suggest to disable that and wait for set reconciliation to fix it.

related: spacemeshos#5519
  • Loading branch information
dshulyak committed Feb 7, 2024
1 parent 74170d9 commit 486ce84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func MainnetConfig() Config {
Standalone: false,
GossipDuration: 50 * time.Second,
OutOfSyncThresholdLayers: 36, // 3h
DisableMeshAgreement: true,
DisableAtxReconciliation: true,
},
Recovery: checkpoint.DefaultConfig(),
Expand Down
2 changes: 1 addition & 1 deletion syncer/state_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (s *Syncer) processLayers(ctx context.Context) error {
Warning("failed to adopt peer opinions", lid, log.Err(err))
}
}
if s.IsSynced(ctx) {
if s.IsSynced(ctx) && !s.cfg.DisableMeshAgreement {
if err = s.checkMeshAgreement(ctx, lid, opinions); err != nil &&
errors.Is(err, errMeshHashDiverged) {
s.logger.WithContext(ctx).
Expand Down
1 change: 1 addition & 0 deletions syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Config struct {
MaxStaleDuration time.Duration
Standalone bool
GossipDuration time.Duration
DisableMeshAgreement bool `mapstructure:"disable-mesh-agreement"`
DisableAtxReconciliation bool `mapstructure:"disable-atx-reconciliation"`
OutOfSyncThresholdLayers uint32 `mapstructure:"out-of-sync-threshold"`
}
Expand Down

0 comments on commit 486ce84

Please sign in to comment.