Skip to content

Fix master certificate retrieval #1007

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
merged 3 commits into from
Jun 26, 2023

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Jun 23, 2023

Content

This PR fix master certificate retrieval on a edge case:
If on the queried epoch, epoch with already existing certificates, a genesis certificate is added then the returned certificate when asking the master of that epoch would not be the new genesis but the first certificate of the epoch.

This PR also fix a bad behavior when CertificateRecord are converted back to Certificate: this would recompute the certificate hash, meaning that the real hash, used as the id of the certificate table, would be lost.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #1006

@Alenar Alenar requested review from jpraynaud and ghubertpalo June 23, 2023 10:08
@Alenar Alenar temporarily deployed to testing-preview June 23, 2023 10:15 — with GitHub Actions Inactive
@Alenar Alenar force-pushed the djo/1006/fix_master_certificate_computation branch from d2bc85a to a549318 Compare June 26, 2023 07:57
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM

Alenar added 3 commits June 26, 2023 11:40
When querying for a master certificate when a new genesis certificate
have been created on an epoch where certificates already existed, the
returned certificate would not be the new genesis but the first of the
epoch.
@Alenar Alenar force-pushed the djo/1006/fix_master_certificate_computation branch from a549318 to e73e2cd Compare June 26, 2023 09:43
@Alenar Alenar temporarily deployed to testing-preview June 26, 2023 10:05 — with GitHub Actions Inactive
@Alenar Alenar merged commit 72e8874 into main Jun 26, 2023
@Alenar Alenar deleted the djo/1006/fix_master_certificate_computation branch June 26, 2023 10:06
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.

Computation of master certificate of an epoch is incorrect
2 participants