Skip to content

Commit

Permalink
Try #5592:
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemesh-bors[bot] authored Feb 22, 2024
2 parents 5e7397f + 82fcacf commit 56d5909
Show file tree
Hide file tree
Showing 56 changed files with 2,656 additions and 2,328 deletions.
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,35 @@ configuration is as follows:

### Improvements

* [#5564](https://github.com/spacemeshos/go-spacemesh/pull/5564) Use decaying tags for fetch peers. This prevents
libp2p's Connection Manager from breaking sync.
* [#5418](https://github.com/spacemeshos/go-spacemesh/pull/5418) Add `grpc-post-listener` to separate post service from
`grpc-private-listener` and not require mTLS for the post service.

If you are not using a remote post service you do not need to adjust anything. If you are using a remote setup
make sure your post service now connects to `grpc-post-listener` instead of `grpc-private-listener`. If you are
connecting to a remote post service over the internet we strongly recommend using mTLS via `grpc-tls-listener`.

## Release v1.3.10

### Improvements

* [#5564](https://github.com/spacemeshos/go-spacemesh/pull/5564) Use decaying tags for fetch peers. This prevents
libp2p's Connection Manager from breaking sync.

* [#5522](https://github.com/spacemeshos/go-spacemesh/pull/5522) Disable mesh agreement sync protocol.
It reduces number of requests for historical activation ids.

* [#5571](https://github.com/spacemeshos/go-spacemesh/pull/5571) Adjust to 2.2M ATXs

## Release v1.3.9

### Improvements

* [#5530](https://github.com/spacemeshos/go-spacemesh/pull/5530)
Adjusted cache sizes for the increased number of ATXs on the network.

* [#5511](https://github.com/spacemeshos/go-spacemesh/pull/5511)
Fix dialing peers on their private IPs, which was causing "portscan" complaints.

## Release v1.3.8

### Features
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ install:
go mod download
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2
go install github.com/spacemeshos/go-scale/[email protected]
go install go.uber.org/mock/mockgen@v0.3.0
go install go.uber.org/mock/mockgen@v0.4.0
go install gotest.tools/[email protected]
go install honnef.co/go/tools/cmd/[email protected]
.PHONY: install
Expand Down
6 changes: 3 additions & 3 deletions activation/e2e/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
opts := opts
eg.Go(func() error {
validator := activation.NewMocknipostValidator(ctrl)
mgr, err := activation.NewPostSetupManager(sig.NodeID(), cfg, logger, cdb, goldenATX, syncer, validator)
mgr, err := activation.NewPostSetupManager(cfg, logger, cdb, goldenATX, syncer, validator)
require.NoError(t, err)

opts.DataDir = t.TempDir()
initPost(t, mgr, opts)
t.Cleanup(launchPostSupervisor(t, logger, mgr, grpcCfg, opts))
initPost(t, mgr, opts, sig.NodeID())
t.Cleanup(launchPostSupervisor(t, logger, mgr, sig.NodeID(), grpcCfg, opts))

require.Eventually(t, func() bool {
_, err := svc.Client(sig.NodeID())
Expand Down
25 changes: 13 additions & 12 deletions activation/e2e/nipost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func launchPostSupervisor(
tb testing.TB,
log *zap.Logger,
mgr *activation.PostSetupManager,
id types.NodeID,
cfg grpcserver.Config,
postOpts activation.PostSetupOpts,
) func() {
Expand All @@ -76,7 +77,7 @@ func launchPostSupervisor(
ps, err := activation.NewPostSupervisor(log, cmdCfg, postCfg, provingOpts, mgr)
require.NoError(tb, err)
require.NotNil(tb, ps)
require.NoError(tb, ps.Start(postOpts))
require.NoError(tb, ps.Start(postOpts, id))
return func() { assert.NoError(tb, ps.Stop(false)) }
}

Expand All @@ -99,12 +100,12 @@ func launchServer(tb testing.TB, services ...grpcserver.ServiceAPI) (grpcserver.
return cfg, func() { assert.NoError(tb, server.Close()) }
}

func initPost(tb testing.TB, mgr *activation.PostSetupManager, opts activation.PostSetupOpts) {
func initPost(tb testing.TB, mgr *activation.PostSetupManager, opts activation.PostSetupOpts, id types.NodeID) {
tb.Helper()

// Create data.
require.NoError(tb, mgr.PrepareInitializer(context.Background(), opts))
require.NoError(tb, mgr.StartSession(context.Background()))
require.NoError(tb, mgr.PrepareInitializer(context.Background(), opts, id))
require.NoError(tb, mgr.StartSession(context.Background(), id))
require.Equal(tb, activation.PostSetupStateComplete, mgr.Status().State)
}

Expand All @@ -128,14 +129,14 @@ func TestNIPostBuilderWithClients(t *testing.T) {
})

validator := activation.NewMocknipostValidator(ctrl)
mgr, err := activation.NewPostSetupManager(sig.NodeID(), cfg, logger, cdb, goldenATX, syncer, validator)
mgr, err := activation.NewPostSetupManager(cfg, logger, cdb, goldenATX, syncer, validator)
require.NoError(t, err)

opts := activation.DefaultPostSetupOpts()
opts.DataDir = t.TempDir()
opts.ProviderID.SetUint32(initialization.CPUProviderID())
opts.Scrypt.N = 2 // Speedup initialization in tests.
initPost(t, mgr, opts)
initPost(t, mgr, opts, sig.NodeID())

// ensure that genesis aligns with layer timings
genesis := time.Now().Add(layerDuration).Round(layerDuration)
Expand Down Expand Up @@ -173,7 +174,7 @@ func TestNIPostBuilderWithClients(t *testing.T) {
grpcCfg, cleanup := launchServer(t, svc)
t.Cleanup(cleanup)

t.Cleanup(launchPostSupervisor(t, logger, mgr, grpcCfg, opts))
t.Cleanup(launchPostSupervisor(t, logger, mgr, sig.NodeID(), grpcCfg, opts))

require.Eventually(t, func() bool {
_, err := svc.Client(sig.NodeID())
Expand Down Expand Up @@ -274,7 +275,7 @@ func TestNewNIPostBuilderNotInitialized(t *testing.T) {
})

validator := activation.NewMocknipostValidator(ctrl)
mgr, err := activation.NewPostSetupManager(sig.NodeID(), cfg, logger, cdb, goldenATX, syncer, validator)
mgr, err := activation.NewPostSetupManager(cfg, logger, cdb, goldenATX, syncer, validator)
require.NoError(t, err)

// ensure that genesis aligns with layer timings
Expand Down Expand Up @@ -325,7 +326,7 @@ func TestNewNIPostBuilderNotInitialized(t *testing.T) {
opts.DataDir = t.TempDir()
opts.ProviderID.SetUint32(initialization.CPUProviderID())
opts.Scrypt.N = 2 // Speedup initialization in tests.
t.Cleanup(launchPostSupervisor(t, logger, mgr, grpcCfg, opts))
t.Cleanup(launchPostSupervisor(t, logger, mgr, sig.NodeID(), grpcCfg, opts))

require.Eventually(t, func() bool {
_, err := svc.Client(sig.NodeID())
Expand Down Expand Up @@ -393,12 +394,12 @@ func Test_NIPostBuilderWithMultipleClients(t *testing.T) {
sig := sig
opts := opts
eg.Go(func() error {
mgr, err := activation.NewPostSetupManager(sig.NodeID(), cfg, logger, cdb, goldenATX, syncer, validator)
mgr, err := activation.NewPostSetupManager(cfg, logger, cdb, goldenATX, syncer, validator)
require.NoError(t, err)

opts.DataDir = t.TempDir()
initPost(t, mgr, opts)
t.Cleanup(launchPostSupervisor(t, logger, mgr, grpcCfg, opts))
initPost(t, mgr, opts, sig.NodeID())
t.Cleanup(launchPostSupervisor(t, logger, mgr, sig.NodeID(), grpcCfg, opts))

require.Eventually(t, func() bool {
_, err := svc.Client(sig.NodeID())
Expand Down
6 changes: 3 additions & 3 deletions activation/e2e/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ func TestValidator_Validate(t *testing.T) {
return synced
})

mgr, err := activation.NewPostSetupManager(sig.NodeID(), cfg, logger, cdb, goldenATX, syncer, validator)
mgr, err := activation.NewPostSetupManager(cfg, logger, cdb, goldenATX, syncer, validator)
require.NoError(t, err)

opts := activation.DefaultPostSetupOpts()
opts.DataDir = t.TempDir()
opts.ProviderID.SetUint32(initialization.CPUProviderID())
opts.Scrypt.N = 2 // Speedup initialization in tests.
initPost(t, mgr, opts)
initPost(t, mgr, opts, sig.NodeID())

// ensure that genesis aligns with layer timings
genesis := time.Now().Add(layerDuration).Round(layerDuration)
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestValidator_Validate(t *testing.T) {
grpcCfg, cleanup := launchServer(t, svc)
t.Cleanup(cleanup)

t.Cleanup(launchPostSupervisor(t, logger, mgr, grpcCfg, opts))
t.Cleanup(launchPostSupervisor(t, logger, mgr, sig.NodeID(), grpcCfg, opts))

require.Eventually(t, func() bool {
_, err := svc.Client(sig.NodeID())
Expand Down
4 changes: 2 additions & 2 deletions activation/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ type atxProvider interface {
// This interface is used by the atx builder and currently implemented by the PostSetupManager.
// Eventually most of the functionality will be moved to the PoSTClient.
type postSetupProvider interface {
PrepareInitializer(ctx context.Context, opts PostSetupOpts) error
StartSession(context context.Context) error
PrepareInitializer(ctx context.Context, opts PostSetupOpts, id types.NodeID) error
StartSession(context context.Context, id types.NodeID) error
Status() *PostSetupStatus
Reset() error
}
Expand Down
Loading

0 comments on commit 56d5909

Please sign in to comment.