Skip to content

Commit

Permalink
Merge branch 'develop' into feature/schema-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan4th committed Aug 13, 2024
2 parents ce9647b + f8354c5 commit 1220037
Show file tree
Hide file tree
Showing 253 changed files with 11,922 additions and 3,498 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/api-swagger-ui.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Build and Push Swagger-UI to R2 testnet-api-docs.spacemesh.network
name: Build and Push Swagger-UI

env:
go-version: "1.22"

on:
release:
types: [published]
# Allow manually triggering this workflow
workflow_dispatch:
push:
tags:
- '*'

jobs:
check-version:
Expand Down Expand Up @@ -42,31 +45,32 @@ jobs:
- name: upload to testnet
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.CLOUDFLARE_TESTNET_API_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
SOURCE_DIR: api/release/openapi/swagger/src
DEST_DIR: '/${{ github.event.release.tag_name }}'
DEST_DIR: '${{ github.ref_name }}'
AWS_S3_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com

- name: update url json file for testnet
working-directory: api/release/openapi/swagger/src
run: |
mkdir spec && cd spec
curl -o spec_urls.json https://testnet-api-docs.spacemesh.network/spec_urls.json
new_url="{\"url\":\"https://testnet-api-docs.spacemesh.network/${{ github.event.release.tag_name }}/api.swagger.json\",\"name\":\"${{ github.event.release.tag_name }}\"}"
new_url="{\"url\":\"https://testnet-api-docs.spacemesh.network/${{ github.ref_name }}/api.swagger.json\",\"name\":\"${{ github.ref_name }}\"}"
jq ". += [$new_url]" spec_urls.json > tmp.json && mv tmp.json spec_urls.json
- name: upload new testnet json file
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.CLOUDFLARE_TESTNET_API_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
SOURCE_DIR: api/release/openapi/swagger/src/spec_urls.json
SOURCE_DIR: api/release/openapi/swagger/src/spec
DEST_DIR: ''
AWS_S3_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com

55 changes: 4 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ jobs:
go-version: ${{ env.go-version }}
- name: setup env
run: make install
- name: staticcheck
run: make staticcheck
- name: lint
run: make lint-github-action

build-tools:
build:
runs-on: ${{ matrix.os }}
needs: filter-changes
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
Expand Down Expand Up @@ -160,6 +158,7 @@ jobs:
with:
check-latest: true
go-version: ${{ env.go-version }}
cache: ${{ runner.arch != 'arm64' }}
- name: setup env
run: make install
- name: build merge-nodes
Expand All @@ -168,52 +167,6 @@ jobs:
run: make gen-p2p-identity
- name: build bootstrapper
run: make bootstrapper

build:
runs-on: ${{ matrix.os }}
needs: filter-changes
if: ${{ needs.filter-changes.outputs.nondocchanges == 'true' }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-22.04
- ubuntu-latest-arm-8-cores
- macos-13
- [self-hosted, macOS, ARM64, go-spacemesh]
- windows-2022
steps:
- name: Add OpenCL support - Ubuntu
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-latest-arm-8-cores' }}
run: sudo apt-get update -q && sudo apt-get install -qy ocl-icd-opencl-dev libpocl2
- name: disable Windows Defender - Windows
if: ${{ matrix.os == 'windows-2022' }}
run: |
Set-MpPreference -DisableRealtimeMonitoring $true
- name: Set new git config - Windows
if: ${{ matrix.os == 'windows-2022' }}
run: |
git config --global pack.window 1
git config --global core.compression 0
git config --global http.postBuffer 524288000
- name: checkout
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}
- uses: extractions/netrc@v2
with:
machine: github.com
username: ${{ secrets.GH_ACTION_TOKEN_USER }}
password: ${{ secrets.GH_ACTION_TOKEN }}
if: vars.GOPRIVATE
- name: set up go
uses: actions/setup-go@v5
with:
check-latest: true
go-version: ${{ env.go-version }}
cache: ${{ runner.arch != 'arm64' }}
- name: setup env
run: make install
- name: build
timeout-minutes: 5
run: make build
Expand All @@ -228,7 +181,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 Expand Up @@ -306,7 +260,6 @@ jobs:
- filter-changes
- quicktests
- lint
- build-tools
- build
- unittests
runs-on: ubuntu-22.04
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/systest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
id: install
uses: azure/setup-kubectl@v4
with:
version: "v1.23.15"
version: "v1.27.16"

- name: Setup gcloud authentication
uses: google-github-actions/auth@v2
Expand Down Expand Up @@ -130,10 +130,8 @@ jobs:
go-version-file: "go.mod"

- name: Run tests
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
71 changes: 70 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,74 @@

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

## UNRELEASED

### Upgrade information

The command line flag `--scan-malfeasant-atxs` has been removed. All malfeasant ATXs before 1.6.0 have been marked as
such and the node will continue to scan new ATXs for their validity.

### Highlights

### Features

### Improvements

## Release v1.6.6

### Improvements

* [#6198](https://github.com/spacemeshos/go-spacemesh/pull/6198) Configure default TTL for caching poet's /v1/info

* [#6199](https://github.com/spacemeshos/go-spacemesh/pull/6199) Cache poet's /v1/pow_params

## Release v1.6.5

### Improvements

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

* [#6187](https://github.com/spacemeshos/go-spacemesh/pull/6187) The merge tool now ignores files that are not `.key`
files in the `identities` directory when merging two nodes.

* [#6128](https://github.com/spacemeshos/go-spacemesh/pull/6128) Reduce logs spam

## 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 Expand Up @@ -637,6 +705,7 @@ and permanent ineligibility for rewards.

* [#5494](https://github.com/spacemeshos/go-spacemesh/pull/5494)
Make routing discovery more configurable and less spammy by default.

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

Expand All @@ -646,7 +715,7 @@ and permanent ineligibility for rewards.

* [#5470](https://github.com/spacemeshos/go-spacemesh/pull/5470)
Fixed a bug in event reporting where the node reports a disconnection from the PoST service as a "PoST failed" event.
Disconnections cannot be avoided completely and do not interrupt the PoST proofing process. As long as the PoST
Disconnections cannot be avoided completely and do not interrupt the PoST proving process. As long as the PoST
service reconnects within a reasonable time, the node will continue to operate normally without reporting any errors
via the event API.

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
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ COMMIT = $(shell git rev-parse HEAD)
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

GOLANGCI_LINT_VERSION := v1.59.0
STATICCHECK_VERSION := v0.4.7
GOTESTSUM_VERSION := v1.12.0
GOSCALE_VERSION := v1.2.0
MOCKGEN_VERSION := v0.4.0
Expand Down Expand Up @@ -61,7 +60,6 @@ install:
go install github.com/spacemeshos/go-scale/scalegen@$(GOSCALE_VERSION)
go install go.uber.org/mock/mockgen@$(MOCKGEN_VERSION)
go install gotest.tools/gotestsum@$(GOTESTSUM_VERSION)
go install honnef.co/go/tools/cmd/staticcheck@$(STATICCHECK_VERSION)
.PHONY: install

build: go-spacemesh get-profiler get-postrs-service
Expand Down Expand Up @@ -97,7 +95,7 @@ clear-test-cache:
.PHONY: clear-test-cache

test: get-libs
@$(ULIMIT) CGO_LDFLAGS="$(CGO_TEST_LDFLAGS)" gotestsum -- -race -timeout 8m -p 1 $(UNIT_TESTS)
@$(ULIMIT) CGO_LDFLAGS="$(CGO_TEST_LDFLAGS)" gotestsum -- -race -timeout 8m $(UNIT_TESTS)
.PHONY: test

generate: get-libs
Expand All @@ -112,10 +110,6 @@ test-generate:
@git diff --name-only --diff-filter=AM --exit-code . || { echo "\nPlease rerun 'make generate' and commit changes.\n"; exit 1; }
.PHONY: test-generate

staticcheck: get-libs
@$(ULIMIT) CGO_LDFLAGS="$(CGO_TEST_LDFLAGS)" staticcheck ./...
.PHONY: staticcheck

test-tidy:
# Working directory must be clean, or this test would be destructive
git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && git --no-pager diff && exit 1)
Expand Down Expand Up @@ -145,7 +139,7 @@ lint-github-action: get-libs
.PHONY: lint-github-action

cover: get-libs
@$(ULIMIT) CGO_LDFLAGS="$(CGO_TEST_LDFLAGS)" go test -coverprofile=cover.out -timeout 0 -p 1 -coverpkg=./... $(UNIT_TESTS)
@$(ULIMIT) CGO_LDFLAGS="$(CGO_TEST_LDFLAGS)" go test -coverprofile=cover.out -timeout 30m -coverpkg=./... $(UNIT_TESTS)
.PHONY: cover

list-versions:
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 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
Loading

0 comments on commit 1220037

Please sign in to comment.