8000 Trusted pubkeys by ConvallariaMaj · Pull Request #514 · spacemeshos/poet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Trusted pubkeys #514

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 27 commits into from
Oct 2, 2024
Merged

Trusted pubkeys #514

merged 27 commits into from
Oct 2, 2024

Conversation

ConvallariaMaj
Copy link
Contributor
@ConvallariaMaj ConvallariaMaj commented Aug 31, 2024

Closes #501

PR includes:

  • reading trusted keys from dir (each pubkey must be in separate file)
  • API to invoke reloading trusted keys
  • verification certs to handle changes above
  • new tests

Connected with PR:
spacemeshos/go-spacemesh#6313

@ConvallariaMaj ConvallariaMaj marked this pull request as draft August 31, 2024 14:58
Copy link
codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 82.25806% with 22 lines in your changes missing coverage. Please review.

Project coverage is 80.6%. Comparing base (a406138) to head (9afeae6).
Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
registration/registration.go 83.3% 6 Missing and 4 partials ⚠️
server/server.go 75.0% 4 Missing and 4 partials ⚠️
rpc/rpcserver.go 69.2% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #514     +/-   ##
=========================================
- Coverage     81.2%   80.6%   -0.7%     
=========================================
  Files           27      27             
  Lines         1776    1868     +92     
=========================================
+ Hits          1443    1506     +63     
- Misses         214     231     +17     
- Partials       119     131     +12     

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

@ConvallariaMaj ConvallariaMaj requested a review from poszu September 2, 2024 08:41
@ConvallariaMaj ConvallariaMaj marked this pull request as ready for review September 2, 2024 08:42
Copy link
Member
@fasmat fasmat left a comment

Choose a reason for hiding this comment

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

Tests share a lot of (setup) code. Some tests even start failing if executed individually or in different orders.

A quick fix for this is to just move the shared setup code into a function:

func Test_Test1(t *testing.T) {
    setup := func(t *testing.T) {
        // setup code
    }
    t.Run("subtest1", func(t *testing.T) {
         setup(t)
         // execute test
    })

This ensures that all tests setup their environment individually and that they don't leak into other tests.

poszu and others added 4 commits October 1, 2024 09:31
Co-authored-by: Matthias Fasching <5011972+fasmat@users.noreply.github.com>
Co-authored-by: Matthias Fasching <5011972+fasmat@users.noreply.github.com>
@poszu poszu requested review from poszu and removed request for poszu October 1, 2024 08:29
@poszu
Copy link
Contributor
poszu commented Oct 1, 2024

Tests share a lot of (setup) code. Some tests even start failing if executed individually or in different orders.

A quick fix for this is to just move the shared setup code into a function:

func Test_Test1(t *testing.T) {
    setup := func(t *testing.T) {
        // setup code
    }
    t.Run("subtest1", func(t *testing.T) {
         setup(t)
         // execute test
    })

This ensures that all tests setup their environment individually and that they don't leak into other tests.

Which tests depend on the order they are executed in?

@poszu poszu requested a review from fasmat October 1, 2024 11:54
@fasmat
Copy link
Member
fasmat commented Oct 1, 2024

Which tests depend on the order they are executed in?

"valid certificate (with loaded trusted keys)" if executed individually does not read key files from disk:

go test -run ^Test_CheckCertificate$/^valid_certificate_\(with_loaded_trusted_keys\)$ github.com/spacemeshos/poet/registration

but it actually looks like if executed like this the test isn't run at all. Maybe that's because the tests are double nested?

Copy link
Member
@fasmat fasmat left a comment

Choose a reason for hiding this comment

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

Should we fix the Docker linting error as well in this PR so GH stops complaining that AS should be capitalized when FROM is? 🙂

@poszu
Copy link
Contributor
poszu commented Oct 1, 2024

Which tests depend on the order they are executed in?

"valid certificate (with loaded trusted keys)" if executed individually does not read key files from disk:

go test -run ^Test_CheckCertificate$/^valid_certificate_\(with_loaded_trusted_keys\)$ github.com/spacemeshos/poet/registration

but it actually looks like if executed like this the test isn't run at all. Maybe that's because the tests are double nested?

I've already removed this test and refactored others. Please check again :)

@poszu poszu added this pull request to the merge queue Oct 2, 2024
Merged via the queue into develop with commit ae0594a Oct 2, 2024
11 checks passed
@fasmat fasmat deleted the issue-501 branch October 4, 2024 16:31
Sign up for free to join this conversation on G 6B5C itHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for accepting additional trusted certifier public keys
4 participants
0