diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index 8ed19f6c..9a66e029 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -22,7 +22,7 @@ runs: echo "version=$GO_VERSION" >> $GITHUB_OUTPUT - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v6 with: go-version: ${{ steps.get-go-version.outputs.version }} cache: true diff --git a/Makefile b/Makefile index 2a171245..dcb37dc6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,16 @@ +################################################### +### Supernode Makefile +################################################### + .PHONY: build build-sncli build-sn-manager .PHONY: install-lumera setup-supernodes system-test-setup install-deps .PHONY: gen-cascade gen-supernode .PHONY: test-e2e test-unit test-integration test-system .PHONY: release +# tools/paths +GO ?= go + # Build variables VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev") GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") @@ -23,10 +30,14 @@ SN_MANAGER_LDFLAGS = -X main.Version=$(VERSION) \ -X main.GitCommit=$(GIT_COMMIT) \ -X main.BuildTime=$(BUILD_TIME) -build: +go.sum: go.mod + ${GO} mod tidy + ${GO} mod verify + +build: go.sum @mkdir -p release @echo "Building supernode..." - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \ + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 ${GO} build \ -trimpath \ -ldflags="-s -w $(LDFLAGS)" \ -o release/supernode-linux-amd64 \ @@ -39,7 +50,11 @@ build-sncli: release/sncli SNCLI_SRC := $(wildcard cmd/sncli/*.go) \ $(wildcard cmd/sncli/**/*.go) -release/sncli: $(SNCLI_SRC) cmd/sncli/go.mod cmd/sncli/go.sum +cmd/sncli/go.sum: cmd/sncli/go.mod + cd cmd/sncli && ${GO} mod tidy + cd cmd/sncli && ${GO} mod verify + +release/sncli: $(SNCLI_SRC) cmd/sncli/go.sum @mkdir -p release @echo "Building sncli..." @RELEASE_DIR=$(CURDIR)/release && \ @@ -47,7 +62,7 @@ release/sncli: $(SNCLI_SRC) cmd/sncli/go.mod cmd/sncli/go.sum CGO_ENABLED=1 \ GOOS=linux \ GOARCH=amd64 \ - go build \ + ${GO} build \ -trimpath \ -ldflags="-s -w $(LDFLAGS)" \ -o $$RELEASE_DIR/sncli && \ @@ -61,7 +76,7 @@ build-sn-manager: CGO_ENABLED=0 \ GOOS=linux \ GOARCH=amd64 \ - go build \ + ${GO} build \ -trimpath \ -ldflags="-s -w $(SN_MANAGER_LDFLAGS)" \ -o ../release/sn-manager \ @@ -70,13 +85,13 @@ build-sn-manager: @echo "sn-manager built successfully at release/sn-manager" test-unit: - go test -v ./... + ${GO} test -v ./... test-integration: - go test -v -p 1 -count=1 -tags=integration ./... + ${GO} test -v -p 1 -count=1 -tags=integration ./... test-system: - cd tests/system && go test -tags=system_test -v . + cd tests/system && ${GO} test -tags=system_test -v . gen-cascade: protoc \ @@ -90,7 +105,7 @@ gen-cascade: gen-supernode: protoc \ --proto_path=proto \ - --proto_path=$$(go list -m -f '{{.Dir}}' github.com/grpc-ecosystem/grpc-gateway)/third_party/googleapis \ + --proto_path=$$(${GO} list -m -f '{{.Dir}}' github.com/grpc-ecosystem/grpc-gateway)/third_party/googleapis \ --go_out=gen \ --go_opt=paths=source_relative \ --go-grpc_out=gen \ @@ -140,17 +155,17 @@ system-test-setup: install-lumera setup-supernodes # Run system tests with complete setup test-e2e: @echo "Running system tests..." - @cd tests/system && go test -tags=system_test -v . + @cd tests/system && ${GO} test -tags=system_test -v . # Run cascade e2e tests only test-cascade: @echo "Running cascade e2e tests..." - @cd tests/system && go mod tidy && go test -tags=system_test -v -run TestCascadeE2E . + @cd tests/system && ${GO} mod tidy && ${GO} test -tags=system_test -v -run TestCascadeE2E . # Run sn-manager e2e tests only test-sn-manager: @echo "Running sn-manager e2e tests..." - @cd tests/system && go test -tags=system_test -v -run '^TestSNManager' . + @cd tests/system && ${GO} test -tags=system_test -v -run '^TestSNManager' . diff --git a/cmd/sncli/go.mod b/cmd/sncli/go.mod index a2f77a98..f16f55a5 100644 --- a/cmd/sncli/go.mod +++ b/cmd/sncli/go.mod @@ -4,14 +4,13 @@ go 1.25.1 replace ( github.com/LumeraProtocol/supernode/v2 => ../.. - github.com/LumeraProtocol/supernode/v2/supernode => ../../supernode github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.50.14 ) require ( github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c - github.com/LumeraProtocol/lumera v1.8.4 - github.com/LumeraProtocol/supernode/v2 v2.3.88 + github.com/LumeraProtocol/lumera v1.8.5 + github.com/LumeraProtocol/supernode/v2 v2.0.0-00010101000000-000000000000 github.com/cosmos/cosmos-sdk v0.53.0 github.com/spf13/cobra v1.10.1 google.golang.org/grpc v1.76.0 diff --git a/cmd/sncli/go.sum b/cmd/sncli/go.sum index 90812d2e..e03c2450 100644 --- a/cmd/sncli/go.sum +++ b/cmd/sncli/go.sum @@ -76,8 +76,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 h1:ig/FpDD2JofP/NExKQUbn7uOSZzJAQqogfqluZK4ed4= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0/go.mod h1:otE2jQekW/PqXk1Awf5lmfokJx4uwuqcj1ab5SpGeW0= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/LumeraProtocol/lumera v1.8.4 h1:6XzLS9gd0m3lOnppNS05WuZx4VCBEGvUN/KpVkSjqro= -github.com/LumeraProtocol/lumera v1.8.4/go.mod h1:twrSLfuXcHvmfQoN5e02Bg7rfeevUjF34SVqEJIvH1E= +github.com/LumeraProtocol/lumera v1.8.5 h1:VfRm9bEWYehd7Ek6YJFdQBFXH47SCuDO6IFdzq3y5+g= +github.com/LumeraProtocol/lumera v1.8.5/go.mod h1:DcG+PermGhl5uA51VaSA0EC+FXpDVm2XgifmYL9jJvE= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= diff --git a/go.mod b/go.mod index ff0b4585..6c842cca 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/math v1.5.3 github.com/AlecAivazis/survey/v2 v2.3.7 github.com/DataDog/zstd v1.5.7 - github.com/LumeraProtocol/lumera v1.8.4 + github.com/LumeraProtocol/lumera v1.8.5 github.com/LumeraProtocol/rq-go v0.2.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cenkalti/backoff/v4 v4.3.0 diff --git a/go.sum b/go.sum index 2ce74b3b..1dfe6235 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 h1:ig/FpDD2JofP/NExKQUbn7uOSZzJAQqogfqluZK4ed4= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0/go.mod h1:otE2jQekW/PqXk1Awf5lmfokJx4uwuqcj1ab5SpGeW0= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/LumeraProtocol/lumera v1.8.4 h1:6XzLS9gd0m3lOnppNS05WuZx4VCBEGvUN/KpVkSjqro= -github.com/LumeraProtocol/lumera v1.8.4/go.mod h1:twrSLfuXcHvmfQoN5e02Bg7rfeevUjF34SVqEJIvH1E= +github.com/LumeraProtocol/lumera v1.8.5 h1:VfRm9bEWYehd7Ek6YJFdQBFXH47SCuDO6IFdzq3y5+g= +github.com/LumeraProtocol/lumera v1.8.5/go.mod h1:DcG+PermGhl5uA51VaSA0EC+FXpDVm2XgifmYL9jJvE= github.com/LumeraProtocol/rq-go v0.2.1 h1:8B3UzRChLsGMmvZ+UVbJsJj6JZzL9P9iYxbdUwGsQI4= github.com/LumeraProtocol/rq-go v0.2.1/go.mod h1:APnKCZRh1Es2Vtrd2w4kCLgAyaL5Bqrkz/BURoRJ+O8= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= diff --git a/pkg/lumera/modules/action/impl.go b/pkg/lumera/modules/action/impl.go index 4b3cd8f7..ccf4dfea 100644 --- a/pkg/lumera/modules/action/impl.go +++ b/pkg/lumera/modules/action/impl.go @@ -30,7 +30,7 @@ func (m *module) GetAction(ctx context.Context, actionID string) (*types.QueryGe ActionID: actionID, }) if err != nil { - return nil, fmt.Errorf("failed to get action: %w", err) + return nil, err } return resp, nil diff --git a/supernode/cmd/start.go b/supernode/cmd/start.go index e7405f47..994d3d47 100644 --- a/supernode/cmd/start.go +++ b/supernode/cmd/start.go @@ -86,8 +86,16 @@ The supernode will connect to the Lumera network and begin participating in the if err != nil { logFields["error"] = err.Error() } - if verificationResult != nil && !verificationResult.IsValid() { - logFields["summary"] = verificationResult.Summary() + if verificationResult != nil { + if len(verificationResult.Errors) > 0 { + logFields["errors"] = verificationResult.Errors + } + if len(verificationResult.Warnings) > 0 { + logFields["warnings"] = verificationResult.Warnings + } + if !verificationResult.IsValid() { + logFields["summary"] = verificationResult.Summary() + } } logtrace.Fatal(ctx, "Config verification failed", logFields) }