Skip to content

Commit

Permalink
sync: disable mesh agreement on mainnet (#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: #5519
  • Loading branch information
dshulyak committed Feb 1, 2024
1 parent 9260b26 commit 122f44c
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 @@ -187,6 +187,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 `mapstructure:"maxstaleduration"`
Standalone bool
GossipDuration time.Duration `mapstructure:"gossipduration"`
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 122f44c

Please sign in to comment.