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] Cache block requests on the gateway #3369

Draft
wants to merge 2 commits into
base: mainnet-staging
Choose a base branch
from

Conversation

niklaslong
Copy link
Collaborator

@niklaslong niklaslong commented Jul 25, 2024

This PR implements caching for block requests so they can be rate limited and matched to inbound block responses. I have also refactored some verbose branching logic to use match statements in the second commit. It can be dropped, if a smaller diff is preferred.

I've opted to clear the outbound block request cache in the same way as the validator requests (#3254). Time-based expiry isn't necessary as the committee is bounded and the collection is cleared on peer disconnect. Inbound requests use a time-based expiry.

Fixes #3324.

@niklaslong niklaslong changed the title Cache block requests in the gateway's cache [Feature] Cache block requests in the gateway's cache Jul 25, 2024
@niklaslong niklaslong changed the title [Feature] Cache block requests in the gateway's cache [Fix] Cache block requests in the gateway's cache Jul 25, 2024
@niklaslong niklaslong force-pushed the fix/3324-block-request-cache branch from b320493 to 406e323 Compare July 25, 2024 14:28
@niklaslong niklaslong changed the title [Fix] Cache block requests in the gateway's cache [Fix] Cache block requests on the gateway Jul 25, 2024
@niklaslong niklaslong force-pushed the fix/3324-block-request-cache branch 4 times, most recently from 360d462 to 6576f25 Compare July 25, 2024 14:52
Pjrich1313

This comment was marked as off-topic.

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.

[Proposal] The bft module's gateway should check block request and block response from peers to avoid spam
2 participants