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

[Perf] Avoid fetching already seen Certificates #3439

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

vicsn
Copy link
Contributor

@vicsn vicsn commented Nov 18, 2024

Motivation

To reduce the chance validators have to fetch any certificates, this PR ensures they don't just check their storage of confirmed certificates, but also a cache of certificates which are currently being processed.

This PR is meant not to change any consensus logic.

The second commit is a small optimization to reduce temporary allocations.

Test Plan

  • Local network passed.
  • Deployed network passed

@vicsn vicsn changed the title Reduce fetching overhead [Perf] Reduce fetching overhead Nov 18, 2024
continue;
}
// If we have not fully processed the certificate yet, store it.
if let Some(certificate) = self.storage.get_unprocessed_certificate(*certificate_id) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: we can additionally resolve any outstanding certificate requests for this particular certificate.

@vicsn vicsn changed the title [Perf] Reduce fetching overhead [Perf] Avoid fetching already seen Certificates Nov 19, 2024
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.

1 participant