From 7749f753beaa599cd72702cc1b5eb80a737d34cd 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 | 4 ++-- rescan.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neutrino.go b/neutrino.go index ef36f42af..e9307faa5 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: 100, DBWritesTickerDuration: time.Millisecond * 500, PutItems: s.FilterDB.PutFilters, } diff --git a/query.go b/query.go index f406a04df..57c58765e 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 @@ -294,7 +294,7 @@ func (s *ChainService) queryAllPeers( // Starting with the set of default options, we'll apply any specified // functional options to the query. qo := defaultQueryOptions() - qo.numRetries = 1 + qo.numRetries = 8 qo.applyQueryOptions(options...) // This is done in a single-threaded query because the peerState is 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, )