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

[Merged by Bors] - Simplify switch to different poet services #6116

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
726b49d
check registrations by poet address
ConvallariaMaj Jul 2, 2024
3f68831
Merge branch 'refs/heads/develop' into fix/issue-5563
ConvallariaMaj Jul 9, 2024
5bba175
added:
ConvallariaMaj Jul 10, 2024
8080ed0
fixed:
ConvallariaMaj Jul 11, 2024
7a371a2
fix lint
ConvallariaMaj Jul 11, 2024
89696b1
fix lint2
ConvallariaMaj Jul 11, 2024
189aa4c
- added new test
ConvallariaMaj Jul 14, 2024
97aed33
Merge branch 'refs/heads/develop' into fix/issue-5563
ConvallariaMaj Jul 14, 2024
66ea05e
make linter happy
ConvallariaMaj Jul 15, 2024
f6f2277
fixed review issues
ConvallariaMaj Jul 18, 2024
9a5bad8
refactor tests
ConvallariaMaj Jul 23, 2024
9ffb962
refactored tests
ConvallariaMaj Jul 23, 2024
c4bb081
fix text and make linter happy
ConvallariaMaj Jul 24, 2024
46ce146
fix minor issues
ConvallariaMaj Jul 29, 2024
105e872
final review issues fix
ConvallariaMaj Aug 1, 2024
11a5323
fix test
ConvallariaMaj Aug 1, 2024
0d5dfe8
Merge branch 'refs/heads/develop' into fix/issue-5563
ConvallariaMaj Aug 1, 2024
b245229
fix issues
ConvallariaMaj Aug 2, 2024
8140012
verifying poets configuration
ConvallariaMaj Aug 2, 2024
a02a90c
verifying poets configuration on poet service layer, fixing tests, fi…
ConvallariaMaj Aug 6, 2024
e910e34
test fix
ConvallariaMaj Aug 6, 2024
28f8c17
Merge branch 'refs/heads/develop' into fix/issue-5563
ConvallariaMaj Aug 6, 2024
6d12ab6
review fixes
ConvallariaMaj Aug 6, 2024
71bd472
fix lint
ConvallariaMaj Aug 6, 2024
0ea3dc1
fix merge
ConvallariaMaj Aug 6, 2024
9dc3874
fix mocks
ConvallariaMaj Aug 6, 2024
4c44a49
Fix tests
fasmat Aug 6, 2024
15ebc7b
Fix e2e tests
fasmat Aug 6, 2024
8c8945a
Merge branch 'refs/heads/develop' into fix/issue-5563
ConvallariaMaj Aug 7, 2024
2206f37
fix test
ConvallariaMaj Aug 7, 2024
f9af85a
fix test2
ConvallariaMaj Aug 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ the build folder you need to ensure that you have the gpu setup dynamic library
binary. The simplest way to do this is just copy the library file to be in the
same directory as the go-spacemesh binary. Alternatively you can modify your
system's library search paths (e.g. LD_LIBRARY_PATH) to ensure that the
library is found._
library is found.

go-spacemesh is p2p software which is designed to form a decentralized network by connecting to other instances of
go-spacemesh running on remote computers.
Expand Down
29 changes: 29 additions & 0 deletions activation/activation_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import (
"errors"
"fmt"
"strings"
)

var (
Expand All @@ -26,3 +27,31 @@
}

func (e *PoetSvcUnstableError) Unwrap() error { return e.source }

type PoetRegistrationMismatchError struct {
registrations []string
configuredPoets []string
}

func (e *PoetRegistrationMismatchError) Error() string {
var sb strings.Builder
sb.WriteString("builder: none of configured poets matches the existing registrations.\n")
sb.WriteString("registrations:\n")
for _, r := range e.registrations {
sb.WriteString("\t")
sb.WriteString(r)
sb.WriteString("\n")
}
sb.WriteString("\n configured poets:\n")
for _, p := range e.configuredPoets {
sb.WriteString("\t")
sb.WriteString(p)
sb.WriteString("\n")
}
return sb.String()
}

func (e *PoetRegistrationMismatchError) As(target error) bool {

Check failure on line 54 in activation/activation_errors.go

View workflow job for this annotation

GitHub Actions / lint

stdmethods: method As(target error) bool should have signature As(any) bool (govet)
var poetRegistrationMismatchError *PoetRegistrationMismatchError
return errors.As(target, &poetRegistrationMismatchError)
}
fasmat marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 6 additions & 3 deletions activation/e2e/poet_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"net/url"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -66,8 +65,12 @@ func (p *TestPoet) Submit(
return &types.PoetRound{ID: strconv.Itoa(round), End: time.Now()}, nil
}

func (p *TestPoet) CertifierInfo(ctx context.Context) (*url.URL, []byte, error) {
return nil, nil, errors.New("not supported")
func (p *TestPoet) CertifierInfo(ctx context.Context) (*types.CertifierInfo, error) {
return nil, errors.New("CertifierInfo: not supported")
}

func (p *TestPoet) Info(ctx context.Context) (*types.PoetInfo, error) {
return nil, errors.New("Info: not supported")
}

// Build a proof.
Expand Down
8 changes: 4 additions & 4 deletions activation/e2e/poet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ func TestCertifierInfo(t *testing.T) {
)
require.NoError(t, err)

url, pubkey, err := client.CertifierInfo(context.Background())
certInfo, err := client.CertifierInfo(context.Background())
r.NoError(err)
r.Equal("http://localhost:8080", url.String())
r.Equal([]byte("pubkey"), pubkey)
r.Equal("http://localhost:8080", certInfo.Url.String())
r.Equal([]byte("pubkey"), certInfo.Pubkey)
}

func TestNoCertifierInfo(t *testing.T) {
Expand Down Expand Up @@ -291,6 +291,6 @@ func TestNoCertifierInfo(t *testing.T) {
)
require.NoError(t, err)

_, _, err = client.CertifierInfo(context.Background())
_, err = client.CertifierInfo(context.Background())
r.ErrorContains(err, "poet doesn't support certificates")
}
40 changes: 40 additions & 0 deletions activation/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading