From c8fd04d4f772fec06ae5f71da5c641dd37db34c8 Mon Sep 17 00:00:00 2001 From: djkazic Date: Tue, 28 May 2024 12:57:32 -0400 Subject: [PATCH] neutrino: improve perf in high latency networks --- neutrino.go | 2 +- query.go | 2 +- rescan.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/neutrino.go b/neutrino.go index ef36f42af..c3817dccf 100644 --- a/neutrino.go +++ b/neutrino.go @@ -753,7 +753,7 @@ func NewChainService(cfg Config) (*ChainService, error) { if s.persistToDisk { cfg := &chanutils.BatchWriterConfig[*filterdb.FilterData]{ QueueBufferSize: chanutils.DefaultQueueSize, - MaxBatch: 1000, + MaxBatch: 10, DBWritesTickerDuration: time.Millisecond * 500, PutItems: s.FilterDB.PutFilters, } diff --git a/query.go b/query.go index f406a04df..d16effe6b 100644 --- a/query.go +++ b/query.go @@ -49,7 +49,7 @@ var ( // each peer before we've concluded we aren't going to get a valid // response. This allows to make up for missed messages in some // instances. - QueryNumRetries = 2 + QueryNumRetries = 8 // QueryPeerConnectTimeout specifies how long to wait for the // underlying chain service to connect to a peer before giving up diff --git a/rescan.go b/rescan.go index 6034c22b0..e4906a43a 100644 --- a/rescan.go +++ b/rescan.go @@ -956,7 +956,7 @@ func (rs *rescanState) handleBlockConnected(ntfn *blockntfns.Connected) error { // Otherwise, we'll attempt to fetch the filter to retrieve the relevant // transactions and notify them. - queryOptions := NumRetries(0) + queryOptions := NumRetries(2) blockFilter, err := chain.GetCFilter( newStamp.Hash, wire.GCSFilterRegular, queryOptions, )