Skip to content

Commit

Permalink
neutrino: improve perf in high latency networks
Browse files Browse the repository at this point in the history
  • Loading branch information
djkazic committed May 29, 2024
1 parent a2d891c commit dee0742
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand 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
Expand Down
2 changes: 1 addition & 1 deletion rescan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit dee0742

Please sign in to comment.