-
Notifications
You must be signed in to change notification settings - Fork 214
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
Conversation
130480f
to
6a9a733
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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 | ||
} |
There was a problem hiding this comment.
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?)
bors merge |
bors cancel |
Canceled. |
bors merge |
## 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.
Pull request successfully merged into develop. Build succeeded: |
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.
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.