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

fix(p2p/client/peer_agnostic): limit sync request block ranges #2227

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

kkovaacs
Copy link
Contributor

Some nodes (like Juno) do not limit how many responses they return for a sync query. Since Pathfinder requests the whole gap (possibly hundreds of thousands of blocks) by default this leads to a sync request that then times out (because we currently have a "global" timeout on the sync protocol streams).

This change makes sure that we never request more than 500 blocks worth of data at once.

Closes #2121

@kkovaacs kkovaacs requested a review from a team as a code owner September 10, 2024 12:03
@kkovaacs kkovaacs force-pushed the krisztian/limit-p2p-sync-query-block-ranges branch from 0b116e6 to 148c8cf Compare September 10, 2024 12:09
Copy link
Contributor

@t00ts t00ts left a comment

Choose a reason for hiding this comment

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

LGTM

crates/p2p/src/client/peer_agnostic.rs Show resolved Hide resolved
@kkovaacs kkovaacs force-pushed the krisztian/limit-p2p-sync-query-block-ranges branch 4 times, most recently from b9c0527 to 60aecf2 Compare September 12, 2024 09:05
Some nodes (like Juno) do not limit how many responses they return for a
sync query. Since Pathfinder requests the whole gap (possibly hundreds
of thousands of blocks) by default this leads to a sync request that
then times out (because we currently have a "global" timeout on the sync
protocol streams).

This change makes sure that we never request more than 500 blocks worth
of data at once.

Closes #2121
@kkovaacs kkovaacs force-pushed the krisztian/limit-p2p-sync-query-block-ranges branch from 60aecf2 to cfb0a7c Compare September 13, 2024 09:32
@kkovaacs kkovaacs merged commit 19aebe9 into main Sep 13, 2024
7 checks passed
@kkovaacs kkovaacs deleted the krisztian/limit-p2p-sync-query-block-ranges branch September 13, 2024 12:00
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.

P2P: checkpoint sync requests too large
4 participants