From c8dbf62a4495181165ce3c41a8f637fce689a85a Mon Sep 17 00:00:00 2001 From: woikos Date: Thu, 22 Jan 2026 20:20:06 +0100 Subject: [PATCH] Increase negentropy sync limit from 100k to 1M events (v0.55.5) - Add MaxEvents config option to negentropy manager - Increase default sync limit from 100,000 to 1,000,000 events - Ensures full database sync for relays with 200k+ events Files modified: - pkg/sync/negentropy/manager.go: Add MaxEvents config, use configurable limit - pkg/sync/negentropy/server/service.go: Increase hardcoded limit to 1M Co-Authored-By: Claude Opus 4.5 --- pkg/sync/negentropy/manager.go | 7 ++++++- pkg/sync/negentropy/server/service.go | 4 ++-- pkg/version/version | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/sync/negentropy/manager.go b/pkg/sync/negentropy/manager.go index 63f7a9a..aa85241 100644 --- a/pkg/sync/negentropy/manager.go +++ b/pkg/sync/negentropy/manager.go @@ -63,6 +63,7 @@ type Config struct { IDSize int ClientSessionTimeout time.Duration Filter *filter.F // Optional filter for selective sync + MaxEvents uint // Max events to sync per cycle (0 = unlimited) } // Manager handles negentropy sync operations. @@ -362,7 +363,11 @@ func (m *Manager) buildStorage(ctx context.Context) (*negentropy.Vector, error) storage := negentropy.NewVector() // Build filter - start with configured filter or empty - limit := uint(100000) + // Use configured MaxEvents or default to 1,000,000 + limit := m.config.MaxEvents + if limit == 0 { + limit = 1000000 // Default to 1M events + } var f *filter.F if m.config.Filter != nil { // Use configured filter with our limit diff --git a/pkg/sync/negentropy/server/service.go b/pkg/sync/negentropy/server/service.go index 08f8318..4bde5ab 100644 --- a/pkg/sync/negentropy/server/service.go +++ b/pkg/sync/negentropy/server/service.go @@ -306,11 +306,11 @@ func (s *Service) buildStorageForFilter(ctx context.Context, protoFilter *common // If no filter provided, use a reasonable limit if f == nil { - limit := uint(100000) + limit := uint(1000000) f = &filter.F{Limit: &limit} } if f.Limit == nil { - limit := uint(100000) + limit := uint(1000000) f.Limit = &limit } diff --git a/pkg/version/version b/pkg/version/version index 83ef1ef..3cb58c3 100644 --- a/pkg/version/version +++ b/pkg/version/version @@ -1 +1 @@ -v0.55.4 +v0.55.5