-
Notifications
You must be signed in to change notification settings - Fork 215
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 by Bors] - Support poet certificates #5221
Conversation
af7311b
to
2540b1e
Compare
bors try |
tryBuild failed: |
Codecov ReportAttention: Patch coverage is
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 ☔ View full report in Codecov by Sentry. |
bors try |
7c1cd15
to
f1f44be
Compare
acd63d6
to
a2893dc
Compare
bors try |
c19d390
to
ffd77d0
Compare
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
Searching for positioning ATX is slow because: - the SQL query is slow - it usually happens at the same time as many ATXs are being inserted into the DB (the poet CG)
Bors try |
log.ZShortStringer("smesherID", nodeID), | ||
) | ||
challenge []byte, | ||
logger *zap.Logger, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this logger passed as argument? poetClient
has a logger
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it gets a logger already enriched with additional fields like context and smesher ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR, but it doesn't make sense how we handle loggers and contexts to me at the moment. Ideally we would have a situation like this:
ctx = log.WithFields(ctx, log.ZShortStringer("smesherID", nodeID) // probably already in node.go and passed to component
// ... some code to determine which poet to use
ctx = log.WithFields(ctx, zap.String("poet", client.Address())
// ... only pass ctx to child functions
// within child function
logger := c.log.WithOptions(log.ZContext(ctx))
logger.Info("some message") // prints message + smesherID field + poet address field
Right now we are passing both the logger and the context around and store information that should be added to logs in both the context and local loggers...
Wdyt?
tryBuild succeeded: |
bors merge |
## 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
Build failed: |
bors merge |
## 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
Pull request successfully merged into develop. Build succeeded: |
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:
There is a new interface in
activation
packagecertifierService
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 incertifierServiceClient
, which could in future have different implementations for other poet services.Changed the
initial_post
table topost
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