From 486ce845bf5575fb5fe90ee15118bd4ee8fbd20d Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Thu, 1 Feb 2024 13:05:17 +0000 Subject: [PATCH 1/2] sync: disable mesh agreement on mainnet (#5522) 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: https://github.com/spacemeshos/go-spacemesh/issues/5519 --- config/mainnet.go | 1 + syncer/state_syncer.go | 2 +- syncer/syncer.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/mainnet.go b/config/mainnet.go index 7b2c04d68b..898ec3e6bf 100644 --- a/config/mainnet.go +++ b/config/mainnet.go @@ -169,6 +169,7 @@ func MainnetConfig() Config { Standalone: false, GossipDuration: 50 * time.Second, OutOfSyncThresholdLayers: 36, // 3h + DisableMeshAgreement: true, DisableAtxReconciliation: true, }, Recovery: checkpoint.DefaultConfig(), diff --git a/syncer/state_syncer.go b/syncer/state_syncer.go index 09c1bdd926..9ba1d7a37b 100644 --- a/syncer/state_syncer.go +++ b/syncer/state_syncer.go @@ -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). diff --git a/syncer/syncer.go b/syncer/syncer.go index 840bdab45a..956b045d80 100644 --- a/syncer/syncer.go +++ b/syncer/syncer.go @@ -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"` } From 678761fc92e4d3b4ba9525762837a888fb7813ed Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 13 Feb 2024 08:20:00 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea16fefcd0..d8134c7f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ See [RELEASE](./RELEASE.md) for workflow instructions. +## UNRELEASED + +### Improvements + +* [#5548](https://github.com/spacemeshos/go-spacemesh/pull/5548) Disable mesh aggremenet sync protocol. + + It reduces number of requests for historical activation ids. + ## Release v1.3.9 ### Improvements