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

[Merged by Bors] - Don't limit get hash requests for fetching ATX deps #5467

Closed
wants to merge 4 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Jan 18, 2024

Motivation

The original limiting of ATX fetching didn't consider the recursiveness of fetching an ATX (fetching an ATX can trigger fetching its dependencies). The simultaneous fetching of many ATXs could stall, waiting for a slot to fetch dependencies, without a way to unblock and starve.

Changes

Don't limit ATX fetches when fetching dependencies of a processed ATX. Huge batch fetches of ATXs from processing an active set or epoch info are limited.

Test Plan

I ran against the mainnet and didn't observe fetch stalls.

@poszu poszu force-pushed the dont-limit-fetching-atx-deps branch from 130480f to 6a9a733 Compare January 18, 2024 12:59
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6f2fd00) 77.6% compared to head (3c60ed0) 77.7%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5467   +/-   ##
=======================================
  Coverage     77.6%   77.7%           
=======================================
  Files          266     267    +1     
  Lines        30889   30901   +12     
=======================================
+ Hits         23997   24011   +14     
+ Misses        5377    5375    -2     
  Partials      1515    1515           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pigmej pigmej self-requested a review January 18, 2024 13:30
Comment on lines +29 to 44
type GetAtxOpts struct {
LimitingOff bool
}

type GetAtxOpt func(*GetAtxOpts)

func WithoutLimiting() GetAtxOpt {
return func(opts *GetAtxOpts) {
opts.LimitingOff = true
}
}

// AtxFetcher defines an interface for fetching ATXs from remote peers.
type AtxFetcher interface {
GetAtxs(context.Context, []types.ATXID) error
GetAtxs(context.Context, []types.ATXID, ...GetAtxOpt) error
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I feel like these options and the interface don't belong here; the options should be where the implementation is (fetch package) and the interface probably where it is used (atxsync and activation package?)

@poszu
Copy link
Contributor Author

poszu commented Jan 18, 2024

bors merge

@poszu
Copy link
Contributor Author

poszu commented Jan 18, 2024

bors cancel

@spacemesh-bors
Copy link

Canceled.

@poszu
Copy link
Contributor Author

poszu commented Jan 18, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Jan 18, 2024
## Motivation
The original limiting of ATX fetching didn't consider the recursiveness of fetching an ATX (fetching an ATX can trigger fetching its dependencies). The simultaneous fetching of many ATXs could stall, waiting for a slot to fetch dependencies, without a way to unblock and starve.

## Changes
Don't limit ATX fetches when fetching dependencies of a processed ATX. Huge batch fetches of ATXs from processing an active set or epoch info are limited.

## Test Plan
I ran against the mainnet and didn't observe fetch stalls.
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Don't limit get hash requests for fetching ATX deps [Merged by Bors] - Don't limit get hash requests for fetching ATX deps Jan 18, 2024
@spacemesh-bors spacemesh-bors bot closed this Jan 18, 2024
@spacemesh-bors spacemesh-bors bot deleted the dont-limit-fetching-atx-deps branch January 18, 2024 14:45
poszu added a commit that referenced this pull request Jan 18, 2024
The original limiting of ATX fetching didn't consider the recursiveness of fetching an ATX (fetching an ATX can trigger fetching its dependencies). The simultaneous fetching of many ATXs could stall, waiting for a slot to fetch dependencies, without a way to unblock and starve.

Don't limit ATX fetches when fetching dependencies of a processed ATX. Huge batch fetches of ATXs from processing an active set or epoch info are limited.

I ran against the mainnet and didn't observe fetch stalls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants