-
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] - atx syncer that persists results #5599
Conversation
25b30d8
to
0730bf3
Compare
2259d6d
to
5d36ed9
Compare
5d36ed9
to
addbaa6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5599 +/- ##
========================================
Coverage 79.7% 79.8%
========================================
Files 274 276 +2
Lines 27883 28180 +297
========================================
+ Hits 22228 22490 +262
- Misses 4108 4128 +20
- Partials 1547 1562 +15 ☔ View full report in Codecov by Sentry. |
} | ||
} | ||
|
||
for atx, requests := range state { |
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.
Am I missing something or requests
will always be 0?
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.
it is updated in code below
if errors.As(err, &batchError) {
for hash, err := range batchError.Errors {
if errors.Is(err, server.ErrPeerResponseFailed) {
state[types.ATXID(hash)]++
} else if errors.Is(err, pubsub.ErrValidationReject) {
state[types.ATXID(hash)] = s.cfg.RequestsLimit
}
}
}
bors try |
tryBuild failed: |
bors try |
tryBuild succeeded: |
bors try |
tryBuild succeeded: |
bors try |
tryBuild succeeded: |
bors merge |
part of: #5553 when requested we ask configured number of peers for epoch info (collection of atxs from that epoch). on a successful response we save known ids, and will ask again only in 30 minutes (configurable). also on restart we check persisted data, and potentially avoiding eager queries, if last query was made close to the epoch end. concurrently with requesting epoch info updates, we will download atxs from peers. download is scheduled in batches, so that we can report progress. if peer advertised invalid atx id, we will evict such id after reaching max number of retries (20 in the pr). to make error checking possible i extended errors emitted by p2p/server and fetcher.
Build failed:
|
bors cancel |
bors merge |
part of: #5553 when requested we ask configured number of peers for epoch info (collection of atxs from that epoch). on a successful response we save known ids, and will ask again only in 30 minutes (configurable). also on restart we check persisted data, and potentially avoiding eager queries, if last query was made close to the epoch end. concurrently with requesting epoch info updates, we will download atxs from peers. download is scheduled in batches, so that we can report progress. if peer advertised invalid atx id, we will evict such id after reaching max number of retries (20 in the pr). to make error checking possible i extended errors emitted by p2p/server and fetcher.
bors cancel |
Canceled. |
bors merge |
part of: #5553 when requested we ask configured number of peers for epoch info (collection of atxs from that epoch). on a successful response we save known ids, and will ask again only in 30 minutes (configurable). also on restart we check persisted data, and potentially avoiding eager queries, if last query was made close to the epoch end. concurrently with requesting epoch info updates, we will download atxs from peers. download is scheduled in batches, so that we can report progress. if peer advertised invalid atx id, we will evict such id after reaching max number of retries (20 in the pr). to make error checking possible i extended errors emitted by p2p/server and fetcher.
Pull request successfully merged into develop. Build succeeded: |
…edness (#5600) closes: #5553 this change is on top of #5599, and will be rebased after that one is merged the change always spawns a background worker to download atxs for the ongoing epoch. such background worker for epoch X is spawned when half of the layers of epoch X have passed. this is done so that we always do some useful work to do. such worker will be asking N peers (with a default of 2) every 30 minutes, until we are ready to spawn worker for epoch X + 1. the side effect of this change, is that we are not going to block syncedness if node has all previous atx, but not from the last epoch. so node will be able to rejoin consensus faster after restart without any risk.
@dshulyak could you explain why atx syncer state is persisted into |
no that information is meant only as an optimization to avoid asking peers for a data every time node boots. i would suggest not to copy that, just wait a bit longer when node boots up the first time. in future versions that data will be removed completely, and peers will checking atx consistency always in background. |
part of: #5553
when requested we ask configured number of peers for epoch info (collection of atxs from that epoch). on a successful response we save known ids, and will ask again only in 30 minutes (configurable). also on restart we check persisted data, and potentially avoiding eager queries, if last query was made close to the epoch end.
concurrently with requesting epoch info updates, we will download atxs from peers. download is scheduled in batches, so that we can report progress. if peer advertised invalid atx id, we will evict such id after reaching max number of retries (20 in the pr).
to make error checking possible i extended errors emitted by p2p/server and fetcher.