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

Support poet certificates #5221

Open
wants to merge 63 commits into
base: develop
Choose a base branch
from
Open

Support poet certificates #5221

wants to merge 63 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Nov 3, 2023

Motivation

Closes #5204

Changes

Added support for registering in the poet services using a certificate instead of PoW. It still supports both ways and will fallback to the PoW if:

  • certificate is not available (couldn't certify)
  • the poet service doesn't support certificates

There is a new interface in activation package certifierService that provides a generic way to obtain a certificate for a given poet. It abstracts away the fact that a POST proof is used - it is hidden in certifierServiceClient, which could in future have different implementations for other poet services.

Changed the initial_post table to post as it now holds the latest POST proof. Relying solely on initial post proof OR an existing ATX could not work in case of a checkpoint (in fact this way it failed systests).

Test Plan

  • added UTs
  • added system tests

@poszu
Copy link
Contributor Author

poszu commented Nov 3, 2023

bors try

bors bot added a commit that referenced this pull request Nov 3, 2023
Copy link

bors bot commented Nov 3, 2023

try

Build failed:

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: Patch coverage is 79.25408% with 89 lines in your changes are missing coverage. Please review.

Project coverage is 80.5%. Comparing base (8dcd43d) to head (c0b306c).

Files Patch % Lines
activation/certifier.go 73.9% 36 Missing and 22 partials ⚠️
sql/localsql/nipost/post.go 79.5% 9 Missing and 1 partial ⚠️
activation/nipost.go 86.2% 3 Missing and 4 partials ⚠️
activation/poet.go 78.5% 3 Missing and 3 partials ⚠️
sql/localsql/certifier/db.go 87.8% 3 Missing and 1 partial ⚠️
activation/activation.go 88.2% 2 Missing ⚠️
node/node.go 91.6% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #5221     +/-   ##
=========================================
- Coverage     80.5%   80.5%   -0.1%     
=========================================
  Files          286     288      +2     
  Lines        29547   29878    +331     
=========================================
+ Hits         23812   24063    +251     
- Misses        4137    4185     +48     
- Partials      1598    1630     +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poszu
Copy link
Contributor Author

poszu commented Nov 6, 2023

bors try

@poszu
Copy link
Contributor Author

poszu commented Nov 10, 2023

bors try

spacemesh-bors bot added a commit that referenced this pull request Nov 10, 2023
@spacemesh-bors
Copy link

try

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Nov 10, 2023

bors try

spacemesh-bors bot added a commit that referenced this pull request Nov 10, 2023
@spacemesh-bors
Copy link

try

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Nov 13, 2023

bors try

spacemesh-bors bot added a commit that referenced this pull request Nov 13, 2023
systest/tests/poets_test.go Show resolved Hide resolved
systest/Makefile Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
activation/activation.go Outdated Show resolved Hide resolved
activation/activation.go Outdated Show resolved Hide resolved
activation/certifier.go Show resolved Hide resolved
activation/certifier.go Outdated Show resolved Hide resolved
activation/certifier.go Outdated Show resolved Hide resolved
activation/certifier.go Outdated Show resolved Hide resolved
activation/certifier.go Outdated Show resolved Hide resolved
activation/interface.go Outdated Show resolved Hide resolved
activation/interface.go Outdated Show resolved Hide resolved
activation/nipost.go Outdated Show resolved Hide resolved
activation/interface.go Outdated Show resolved Hide resolved
activation/poet.go Outdated Show resolved Hide resolved
@poszu
Copy link
Contributor Author

poszu commented Apr 18, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Apr 18, 2024
@spacemesh-bors
Copy link

try

Build succeeded:

activation/activation_test.go Outdated Show resolved Hide resolved
activation/poet.go Show resolved Hide resolved
@poszu poszu requested a review from fasmat April 23, 2024 11:25
@poszu
Copy link
Contributor Author

poszu commented Apr 23, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Apr 23, 2024
@spacemesh-bors
Copy link

try

Build succeeded:

sql/atxs/atxs.go Outdated Show resolved Hide resolved
activation/validation.go Outdated Show resolved Hide resolved
@poszu poszu requested a review from fasmat April 26, 2024 07:25
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.

support for certifier service and registering in poet with certificates
2 participants