From c652b305ab718f2c39efa432507c6467495b6e36 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Thu, 16 Nov 2023 23:51:36 -0500 Subject: [PATCH] Unexport avalanche constant from common package --- snow/engine/avalanche/bootstrap/bootstrapper.go | 6 +++++- snow/engine/common/bootstrapper.go | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snow/engine/avalanche/bootstrap/bootstrapper.go b/snow/engine/avalanche/bootstrap/bootstrapper.go index e58538b541ba..c6ef6513b668 100644 --- a/snow/engine/avalanche/bootstrap/bootstrapper.go +++ b/snow/engine/avalanche/bootstrap/bootstrapper.go @@ -29,6 +29,10 @@ const ( stripeDistance = 2000 stripeWidth = 5 cacheSize = 100000 + + // maxOutstandingGetAncestorsRequests is the maximum number of GetAncestors + // sent but not yet responded to/failed + maxOutstandingGetAncestorsRequests = 10 ) var _ common.BootstrapableEngine = (*bootstrapper)(nil) @@ -384,7 +388,7 @@ func (b *bootstrapper) GetVM() common.VM { // to fetch or we are at the maximum number of outstanding requests. func (b *bootstrapper) fetch(ctx context.Context, vtxIDs ...ids.ID) error { b.needToFetch.Add(vtxIDs...) - for b.needToFetch.Len() > 0 && b.OutstandingRequests.Len() < common.MaxOutstandingGetAncestorsRequests { + for b.needToFetch.Len() > 0 && b.OutstandingRequests.Len() < maxOutstandingGetAncestorsRequests { vtxID := b.needToFetch.CappedList(1)[0] b.needToFetch.Remove(vtxID) diff --git a/snow/engine/common/bootstrapper.go b/snow/engine/common/bootstrapper.go index 0455a46cc203..befb3628771b 100644 --- a/snow/engine/common/bootstrapper.go +++ b/snow/engine/common/bootstrapper.go @@ -19,10 +19,6 @@ const ( // logs StatusUpdateFrequency = 5000 - // MaxOutstandingGetAncestorsRequests is the maximum number of GetAncestors - // sent but not responded to/failed - MaxOutstandingGetAncestorsRequests = 10 - // MaxOutstandingBroadcastRequests is the maximum number of requests to have // outstanding when broadcasting. MaxOutstandingBroadcastRequests = 50