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] - Move node key to config directory and enable loading of multiple identities #5592

Closed
wants to merge 40 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d426681
Restructure PostSupervisor to require NodeID on StartSession and Prep…
fasmat Feb 21, 2024
b283295
Load multiple identities during startup
fasmat Feb 21, 2024
6217b6a
Update Recovery for multi-smesher
fasmat Feb 22, 2024
4ffc167
Fix recovery for multi-smeshing
fasmat Feb 22, 2024
1987a82
Add tests
fasmat Feb 22, 2024
900d1d6
Extend checkpoint tests with multi-smeshing setups
fasmat Feb 23, 2024
b1df1b7
Update Node tests
fasmat Feb 24, 2024
7af1f17
Fix node tests
fasmat Feb 24, 2024
30b2db0
Fix failing tests
fasmat Feb 24, 2024
49b26cd
Update CHANGELOG
fasmat Feb 26, 2024
a814bc8
Make sure duplicate keys are detected
fasmat Feb 26, 2024
dae6819
Update post
fasmat Feb 27, 2024
ec8c89b
Review feedback
fasmat Feb 27, 2024
0d92a9a
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 27, 2024
39607a8
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 28, 2024
3047f22
Review feedback
fasmat Feb 28, 2024
23366a6
Use maps instead of slices for deduplication
fasmat Feb 28, 2024
f1ce011
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 28, 2024
801e7b1
Fix failing tests
fasmat Feb 28, 2024
4db9f0e
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 29, 2024
7d26955
Fix failing tests
fasmat Feb 29, 2024
ecaca50
Fix flaky test
fasmat Feb 29, 2024
246599b
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 29, 2024
94d7a12
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 29, 2024
f89edef
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Feb 29, 2024
dfed9a2
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Mar 1, 2024
d775a9c
Fix logging
fasmat Mar 1, 2024
9fdf414
Run test e2e test with random post size
fasmat Mar 1, 2024
cf73444
Update post dependency
fasmat Mar 1, 2024
fe73b3f
Add initial post verification to builder
fasmat Mar 1, 2024
949095c
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Mar 1, 2024
43eff2a
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Mar 1, 2024
62528e5
Fix failing tests
fasmat Mar 1, 2024
ee3cc19
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Mar 1, 2024
b802f65
Update systest makefile
fasmat Mar 1, 2024
e395c8f
Downgrade post-rs
fasmat Mar 1, 2024
c2f9543
Downgrade post
fasmat Mar 1, 2024
d265586
Update CHANGELOG.md
fasmat Mar 4, 2024
310f272
Update CHANGELOG with info that multi-smeshing is still in testing
fasmat Mar 4, 2024
aaf6d26
Merge remote-tracking branch 'origin/develop' into 5089-move-key-to-c…
fasmat Mar 4, 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
Prev Previous commit
Next Next commit
Fix failing tests
fasmat committed Feb 26, 2024
commit 30b2db09f2502e864e387a4b5d12e0ce9c4c8267
38 changes: 22 additions & 16 deletions node/node_test.go
Original file line number Diff line number Diff line change
@@ -417,16 +417,16 @@ func TestSpacemeshApp_NodeService(t *testing.T) {

signer, err := signing.NewEdSigner()
require.NoError(t, err)
app.signers = append(app.signers, signer)
app.signers = []*signing.EdSigner{signer}

mesh, err := mocknet.WithNPeers(1)
require.NoError(t, err)
h, err := p2p.Upgrade(mesh.Hosts()[0])
require.NoError(t, err)
app.host = h

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
appCtx, appCancel := context.WithCancel(context.Background())
defer appCancel()

run := func(c *cobra.Command, args []string) error {
// Give the error channel a buffer
@@ -442,9 +442,12 @@ func TestSpacemeshApp_NodeService(t *testing.T) {
// This will block. We need to run the full app here to make sure that
// the various services are reporting events correctly. This could probably
// be done more surgically, and we don't need _all_ of the services.
return app.Start(context.Background())
return app.Start(appCtx)
}

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

// Run the app in a goroutine. As noted above, it blocks if it succeeds.
// If there's an error in the args, it will return immediately.
var eg errgroup.Group
@@ -455,7 +458,7 @@ func TestSpacemeshApp_NodeService(t *testing.T) {
return nil
})

<-app.started
<-app.Started()
conn, err := grpc.DialContext(
ctx,
app.grpcPublicServer.BoundAddress,
@@ -519,6 +522,7 @@ func TestSpacemeshApp_NodeService(t *testing.T) {

// Cleanup stops all services and thereby the app
<-app.Started() // prevents races when app is not started yet
appCancel()
app.Cleanup(context.Background())

// Wait for everything to stop cleanly before ending test
@@ -527,8 +531,6 @@ func TestSpacemeshApp_NodeService(t *testing.T) {

// E2E app test of the transaction service.
func TestSpacemeshApp_TransactionService(t *testing.T) {
r := require.New(t)

listener := "127.0.0.1:14236"

app := New(WithLog(logtest.New(t)))
@@ -537,12 +539,15 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {
app.Config = &cfg

signer, err := signing.NewEdSigner()
r.NoError(err)
app.signers = append(app.signers, signer)
require.NoError(t, err)
app.signers = []*signing.EdSigner{signer}
address := wallet.Address(signer.PublicKey().Bytes())

appCtx, appCancel := context.WithCancel(context.Background())
defer appCancel()

run := func(c *cobra.Command, args []string) error {
r.NoError(app.Initialize())
require.NoError(t, app.Initialize())

// GRPC configuration
app.Config.API.PublicListener = listener
@@ -572,7 +577,7 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {
// This will block. We need to run the full app here to make sure that
// the various services are reporting events correctly. This could probably
// be done more surgically, and we don't need _all_ of the services.
return app.Start(context.Background())
return app.Start(appCtx)
}

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
@@ -584,8 +589,8 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {
wg.Add(1)
go func() {
str, err := testArgs(ctx, cmdWithRun(run))
r.Empty(str)
r.NoError(err)
require.Empty(t, str)
require.NoError(t, err)
wg.Done()
}()

@@ -605,8 +610,8 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithBlock(),
)
r.NoError(err)
t.Cleanup(func() { r.NoError(conn.Close()) })
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, conn.Close()) })
c := pb.NewTransactionServiceClient(conn)

tx1 := types.NewRawTx(
@@ -653,6 +658,7 @@ func TestSpacemeshApp_TransactionService(t *testing.T) {

// This stops the app
// Cleanup stops all services and thereby the app
appCancel()
app.Cleanup(context.Background())

// Wait for it to stop
@@ -1157,7 +1163,7 @@ func TestAdminEvents_MultiSmesher(t *testing.T) {
})
t.Cleanup(func() { assert.NoError(t, eg.Wait()) })

<-app.started
<-app.Started()
for _, signer := range app.signers {
mgr, err := activation.NewPostSetupManager(
cfg.POST,