Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into atxmerge/detect-do…
Browse files Browse the repository at this point in the history
…uble-merge
  • Loading branch information
poszu committed Jul 30, 2024
2 parents aa7c037 + 53610a3 commit 627de2d
Show file tree
Hide file tree
Showing 113 changed files with 960 additions and 883 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-swagger-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:

on:
release:
types: [published]
types: [created]

jobs:
check-version:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ jobs:
os:
- ubuntu-22.04
- ubuntu-latest-arm-8-cores
- macos-13
# FIXME: reenable the macos runner
# - macos-13
- [self-hosted, macOS, ARM64, go-spacemesh]
- windows-2022
steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/systest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ jobs:
timeout-minutes: 60
env:
test_id: systest-${{ steps.vars.outputs.sha_short }}
label: sanity
storage: premium-rwo=10Gi
node_selector: cloud.google.com/gke-nodepool=systemtest
size: 20
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

See [RELEASE](./RELEASE.md) for workflow instructions.

## UNRELEASED

### Upgrade information

### Highlights

### Features

### Improvements

* [#6185](https://github.com/spacemeshos/go-spacemesh/pull/6185) Optimize mempool

## Release v1.6.4

### Improvements

* [#6107](https://github.com/spacemeshos/go-spacemesh/pull/6107) Cache PoET queries between multiple identities on the
same node. This will reduce the number of requests the node makes to the PoET server during the cyclegap.

* [#6152](https://github.com/spacemeshos/go-spacemesh/pull/6152) Fixed a bug where in rare cases the node would panic
due to the closing of a closed channel in the fetcher.

* [#6142](https://github.com/spacemeshos/go-spacemesh/pull/6142) Fix node not dropping peers that are broadcasting
invalid ATXs.

## Release v1.6.3

### Improvements

* [#6137](https://github.com/spacemeshos/go-spacemesh/pull/6137) Fix hanging ATX sync.

## Release v1.6.2

### Improvements

* [#5793](https://github.com/spacemeshos/go-spacemesh/pull/5793) Reduced hare committee 8x from 400 to 50 to decrease
network traffic caused by Hare.

* [#6099](https://github.com/spacemeshos/go-spacemesh/pull/6099) Adds new metrics to the API to provide insights into
the performance and behavior of the node's APIs.

* [#6115](https://github.com/spacemeshos/go-spacemesh/pull/6115) Increase the number of supported ATXs to 8.0 Mio.

### Features

* [#6112](https://github.com/spacemeshos/go-spacemesh/pull/6112) Adds vesting, vault, and drain vault contents to the
v2alpha2 Transaction API. Fixes the 'unspecified' transaction type.

## Release v1.6.1

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ FROM linux AS spacemesh

# Finally we copy the statically compiled Go binary.
COPY --from=builder /src/build/go-spacemesh /bin/
COPY --from=builder /src/build/service /bin/
COPY --from=builder /src/build/post-service /bin/
COPY --from=builder /src/build/libpost.so /bin/
COPY --from=builder /src/build/gen-p2p-identity /bin/
COPY --from=builder /src/build/merge-nodes /bin/
Expand Down
8 changes: 4 additions & 4 deletions Makefile-libs.Inc
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ else
endif
endif

POSTRS_SETUP_REV = 0.7.8
POSTRS_SETUP_REV = 0.7.11
POSTRS_SETUP_ZIP = libpost-$(platform)-v$(POSTRS_SETUP_REV).zip
POSTRS_SETUP_URL_ZIP ?= https://github.com/spacemeshos/post-rs/releases/download/v$(POSTRS_SETUP_REV)/$(POSTRS_SETUP_ZIP)

POSTRS_PROFILER_ZIP = profiler-$(platform)-v$(POSTRS_SETUP_REV).zip
POSTRS_PROFILER_URL ?= https://github.com/spacemeshos/post-rs/releases/download/v$(POSTRS_SETUP_REV)/$(POSTRS_PROFILER_ZIP)

POSTRS_SERVICE_ZIP = service-$(platform)-v$(POSTRS_SETUP_REV).zip
POSTRS_SERVICE_ZIP = post-service-$(platform)-v$(POSTRS_SETUP_REV).zip
POSTRS_SERVICE_URL ?= https://github.com/spacemeshos/post-rs/releases/download/v$(POSTRS_SETUP_REV)/$(POSTRS_SERVICE_ZIP)

ifeq ($(platform), windows)
POSTRS_SETUP_LIBS = post.h post.dll

POSTRS_PROFILER_BIN = profiler.exe
POSTRS_SERVICE_BIN = service.exe
POSTRS_SERVICE_BIN = post-service.exe
else
ifeq ($(platform), $(filter $(platform), macos macos-m1))
POSTRS_SETUP_LIBS = post.h libpost.dylib
Expand All @@ -73,7 +73,7 @@ else
endif

POSTRS_PROFILER_BIN = profiler
POSTRS_SERVICE_BIN = service
POSTRS_SERVICE_BIN = post-service
endif

BINDIR_POSTRS_SETUP_LIBS = $(foreach X,$(POSTRS_SETUP_LIBS),$(BIN_DIR)$(X))
Expand Down
2 changes: 1 addition & 1 deletion activation/e2e/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
clock, err := timesync.NewClock(
timesync.WithGenesisTime(genesis),
timesync.WithLayerDuration(layerDuration),
timesync.WithTickInterval(100*time.Millisecond),
timesync.WithTickInterval(10*time.Millisecond),
timesync.WithLogger(zap.NewNop()),
)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions activation/e2e/atx_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func Test_MarryAndMerge(t *testing.T) {
require.NoError(t, eg.Wait())

// ensure that genesis aligns with layer timings
genesis := time.Now().Round(layerDuration)
genesis := time.Now().Add(layerDuration).Round(layerDuration)
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
Expand All @@ -252,7 +252,7 @@ func Test_MarryAndMerge(t *testing.T) {
clock, err := timesync.NewClock(
timesync.WithGenesisTime(genesis),
timesync.WithLayerDuration(layerDuration),
timesync.WithTickInterval(100*time.Millisecond),
timesync.WithTickInterval(10*time.Millisecond),
timesync.WithLogger(zap.NewNop()),
)
require.NoError(t, err)
Expand Down
10 changes: 7 additions & 3 deletions activation/e2e/builds_atx_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package activation_test

import (
"context"
"sync/atomic"
"testing"
"time"

Expand Down Expand Up @@ -74,7 +75,7 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
atxsdata := atxsdata.New()

// ensure that genesis aligns with layer timings
genesis := time.Now().Round(layerDuration)
genesis := time.Now().Add(layerDuration).Round(layerDuration)
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
Expand All @@ -85,7 +86,7 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
clock, err := timesync.NewClock(
timesync.WithGenesisTime(genesis),
timesync.WithLayerDuration(layerDuration),
timesync.WithTickInterval(100*time.Millisecond),
timesync.WithTickInterval(10*time.Millisecond),
timesync.WithLogger(zap.NewNop()),
)
require.NoError(t, err)
Expand Down Expand Up @@ -135,6 +136,7 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
)

var previous *types.ActivationTx
var publishedAtxs atomic.Uint32
gomock.InOrder(
mpub.EXPECT().Publish(gomock.Any(), pubsub.AtxProtocol, gomock.Any()).DoAndReturn(
func(ctx context.Context, _ string, msg []byte) error {
Expand All @@ -157,6 +159,7 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
atx, err := atxs.Get(db, watx.ID())
require.NoError(t, err)
previous = atx
publishedAtxs.Add(1)
return nil
},
),
Expand Down Expand Up @@ -189,6 +192,7 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
require.NotZero(t, atx.TickHeight())
require.Equal(t, opts.NumUnits, atx.NumUnits)
previous = atx
publishedAtxs.Add(1)
return nil
},
).Times(2),
Expand All @@ -211,6 +215,6 @@ func TestBuilder_SwitchesToBuildV2(t *testing.T) {
tab.Register(sig)

require.NoError(t, tab.StartSmeshing(coinbase))
require.Eventually(t, ctrl.Satisfied, epoch*4, time.Millisecond*100)
require.Eventually(t, func() bool { return publishedAtxs.Load() >= 3 }, epoch*4, time.Millisecond*100)
require.NoError(t, tab.StopSmeshing(false))
}
4 changes: 2 additions & 2 deletions activation/e2e/checkpoint_merged_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Test_CheckpointAfterMerge(t *testing.T) {
require.NoError(t, eg.Wait())

// ensure that genesis aligns with layer timings
genesis := time.Now().Round(layerDuration)
genesis := time.Now().Add(layerDuration).Round(layerDuration)
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
Expand All @@ -87,7 +87,7 @@ func Test_CheckpointAfterMerge(t *testing.T) {
clock, err := timesync.NewClock(
timesync.WithGenesisTime(genesis),
timesync.WithLayerDuration(layerDuration),
timesync.WithTickInterval(100*time.Millisecond),
timesync.WithTickInterval(10*time.Millisecond),
timesync.WithLogger(zap.NewNop()),
)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion activation/e2e/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestValidator_Validate(t *testing.T) {
newNIPost := *nipost.NIPost
newNIPost.Post = &types.Post{}
_, err = v.NIPost(context.Background(), sig.NodeID(), goldenATX, &newNIPost, challenge, nipost.NumUnits)
require.ErrorContains(t, err, "invalid Post")
require.ErrorContains(t, err, "validating Post: verifying PoST: proof indices are empty")

newPostCfg := cfg
newPostCfg.MinNumUnits = nipost.NumUnits + 1
Expand Down
2 changes: 1 addition & 1 deletion activation/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (h *Handler) handleAtx(

opaqueAtx, err := h.decodeATX(msg)
if err != nil {
return nil, fmt.Errorf("decoding ATX: %w", err)
return nil, fmt.Errorf("%w: decoding ATX: %w", pubsub.ErrValidationReject, err)
}
id := opaqueAtx.ID()

Expand Down
6 changes: 5 additions & 1 deletion activation/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func TestHandler_HandleGossipAtx(t *testing.T) {
atxHdlr.mockFetch.EXPECT().GetPoetProof(gomock.Any(), types.Hash32(second.NIPost.PostMetadata.Challenge))
atxHdlr.mockFetch.EXPECT().GetAtxs(gomock.Any(), []types.ATXID{second.PrevATXID}, gomock.Any())
err = atxHdlr.HandleGossipAtx(context.Background(), "", codec.MustEncode(second))
require.ErrorContains(t, err, "syntactically invalid based on deps")
require.ErrorIs(t, err, sql.ErrNotFound)

// valid first comes in
atxHdlr.expectAtxV1(first, sig.NodeID())
Expand Down Expand Up @@ -514,6 +514,7 @@ func TestHandler_HandleSyncedAtx(t *testing.T) {
err := atxHdlr.HandleSyncedAtx(context.Background(), atx.ID().Hash32(), p2p.NoPeer, buf)
require.ErrorIs(t, err, errMalformedData)
require.ErrorContains(t, err, "invalid atx signature")
require.ErrorIs(t, err, pubsub.ErrValidationReject)
})
t.Run("atx V2", func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -857,12 +858,14 @@ func TestHandler_DecodeATX(t *testing.T) {
atxHdlr := newTestHandler(t, types.RandomATXID())
_, err := atxHdlr.decodeATX(nil)
require.ErrorIs(t, err, errMalformedData)
require.ErrorIs(t, err, pubsub.ErrValidationReject)
})
t.Run("malformed atx", func(t *testing.T) {
t.Parallel()
atxHdlr := newTestHandler(t, types.RandomATXID())
_, err := atxHdlr.decodeATX([]byte("malformed"))
require.ErrorIs(t, err, errMalformedData)
require.ErrorIs(t, err, pubsub.ErrValidationReject)
})
t.Run("v1", func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -893,5 +896,6 @@ func TestHandler_DecodeATX(t *testing.T) {
atx.PublishEpoch = 9
_, err := atxHdlr.decodeATX(atx.Blob().Blob)
require.ErrorIs(t, err, errMalformedData)
require.ErrorIs(t, err, pubsub.ErrValidationReject)
})
}
Loading

0 comments on commit 627de2d

Please sign in to comment.