Browse Source

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 <noreply@anthropic.com>
main v0.55.5
woikos 4 months ago
parent
commit
c8dbf62a44
No known key found for this signature in database
  1. 7
      pkg/sync/negentropy/manager.go
  2. 4
      pkg/sync/negentropy/server/service.go
  3. 2
      pkg/version/version

7
pkg/sync/negentropy/manager.go

@ -63,6 +63,7 @@ type Config struct { @@ -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) @@ -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

4
pkg/sync/negentropy/server/service.go

@ -306,11 +306,11 @@ func (s *Service) buildStorageForFilter(ctx context.Context, protoFilter *common @@ -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
}

2
pkg/version/version

@ -1 +1 @@ @@ -1 +1 @@
v0.55.4
v0.55.5

Loading…
Cancel
Save