go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

Support poet certificates

Open poszu opened this issue 1 year ago • 50 comments

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 avatar Nov 03 '23 16:11 poszu

bors try

poszu avatar Nov 03 '23 16:11 poszu

try

Build failed:

bors[bot] avatar Nov 03 '23 16:11 bors[bot]

Codecov Report

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

Project coverage is 80.7%. Comparing base (166e015) to head (7f83cab). Report is 4 commits behind head on develop.

Files Patch % Lines
activation/certifier.go 71.2% 29 Missing and 17 partials :warning:
activation/poet.go 82.3% 8 Missing and 7 partials :warning:
sql/localsql/nipost/post.go 79.5% 9 Missing and 1 partial :warning:
sql/localsql/certifier/db.go 87.8% 3 Missing and 1 partial :warning:
activation/activation.go 90.0% 2 Missing :warning:
node/node.go 91.6% 1 Missing and 1 partial :warning:
activation/nipost.go 88.8% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #5221     +/-   ##
=========================================
- Coverage     80.8%   80.7%   -0.1%     
=========================================
  Files          287     290      +3     
  Lines        29905   30525    +620     
=========================================
+ Hits         24182   24659    +477     
- Misses        4140    4234     +94     
- Partials      1583    1632     +49     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 06 '23 11:11 codecov[bot]

bors try

poszu avatar Nov 06 '23 12:11 poszu

bors try

poszu avatar Nov 10 '23 08:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 10 '23 08:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 10 '23 09:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 10 '23 10:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 13 '23 03:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 13 '23 04:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 13 '23 04:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 13 '23 05:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 14 '23 10:11 poszu

try

Build succeeded:

spacemesh-bors[bot] avatar Nov 14 '23 11:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 20 '23 04:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 20 '23 05:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 20 '23 07:11 poszu

bors try

poszu avatar Nov 20 '23 07:11 poszu

try

Already running a review

spacemesh-bors[bot] avatar Nov 20 '23 07:11 spacemesh-bors[bot]

try

Build failed:

spacemesh-bors[bot] avatar Nov 20 '23 08:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 21 '23 02:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 21 '23 03:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 21 '23 06:11 poszu

try

Build failed:

spacemesh-bors[bot] avatar Nov 21 '23 07:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 21 '23 08:11 poszu

try

Build succeeded:

spacemesh-bors[bot] avatar Nov 21 '23 08:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 21 '23 10:11 poszu

try

Build succeeded:

spacemesh-bors[bot] avatar Nov 21 '23 11:11 spacemesh-bors[bot]

bors try

poszu avatar Nov 23 '23 06:11 poszu

try

Build succeeded:

spacemesh-bors[bot] avatar Nov 23 '23 06:11 spacemesh-bors[bot]