Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexport avalanche constant from common package #2327

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion snow/engine/avalanche/bootstrap/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions snow/engine/common/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading