Skip to content

Commit 7c7f93c

Browse files
author
valdok
committed
Merge branch 'master' into testnet
2 parents 9f68742 + 956b1d7 commit 7c7f93c

32 files changed

+1022
-284
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- uses: actions/checkout@v4
104104
with:
105105
submodules: recursive
106-
- uses: actions/setup-go@v4
106+
- uses: actions/setup-go@v5
107107
with:
108108
go-version: 1.21 # The Go version to download (if necessary) and use.
109109
- name: Install Intel's SGX SDK
@@ -234,7 +234,7 @@ jobs:
234234
- uses: actions/checkout@v4
235235
with:
236236
submodules: recursive
237-
- uses: actions/setup-go@v4
237+
- uses: actions/setup-go@v5
238238
with:
239239
go-version: 1.21 # The Go version to download (if necessary) and use.
240240
- name: Install xgo

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
steps:
3333
- name: Checkout repository
3434
uses: actions/checkout@v4
35-
- uses: actions/setup-go@v4
35+
- uses: actions/setup-go@v5
3636
with:
3737
go-version: 1.18
3838
# Initializes the CodeQL tools for scanning.
3939
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v2
40+
uses: github/codeql-action/init@v3
4141
with:
4242
languages: "go"
4343
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality
@@ -49,7 +49,7 @@ jobs:
4949
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5050
# If this step fails, then you should remove it and run the build manually (see below)
5151
- name: Autobuild
52-
uses: github/codeql-action/autobuild@v2
52+
uses: github/codeql-action/autobuild@v3
5353

5454
# ℹ️ Command-line programs to run using the OS shell.
5555
# 📚 https://git.io/JvXDl
@@ -63,4 +63,4 @@ jobs:
6363
# make release
6464

6565
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@v2
66+
uses: github/codeql-action/analyze@v3

.github/workflows/go-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: lint
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/setup-go@v4
17+
- uses: actions/setup-go@v5
1818
with:
1919
go-version: 1.21
2020
- uses: actions/checkout@v4

.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
os: [ubuntu-20.04, windows-latest, macos-latest]
151151
steps:
152152
- uses: actions/checkout@v4
153-
- uses: actions/setup-go@v4
153+
- uses: actions/setup-go@v5
154154
with:
155155
go-version: 1.21 # The Go version to download (if necessary) and use.
156156
- name: Build CLI
@@ -167,7 +167,7 @@ jobs:
167167
runs-on: ubuntu-20.04
168168
steps:
169169
- uses: actions/checkout@v4
170-
- uses: actions/setup-go@v4
170+
- uses: actions/setup-go@v5
171171
with:
172172
go-version: 1.21 # The Go version to download (if necessary) and use.
173173
- name: Install xgo

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
# 1.12.0 (WIP)
3+
# 1.12.0
44

55
- Fix the hardcoded admins feature
66
- Add hardcoded admins according to proposals [269](https://dev.mintscan.io/secret/proposals/269) (Shillables) & [270](https://dev.mintscan.io/secret/proposals/270) (Sienna).

Makefile

+26-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
PACKAGES=$(shell go list ./... | grep -v '/simulation')
21
VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//')
32
COMMIT := $(shell git log -1 --format='%H')
43
DOCKER := $(shell which docker)
54
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
65

6+
# SPID and API_KEY are used for Intel SGX attestation
77
SPID ?= 00000000000000000000000000000000
88
API_KEY ?= FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
99

10+
# Environment variables and build tags setup
1011
LEDGER_ENABLED ?= true
1112
BINDIR ?= $(GOPATH)/bin
1213
BUILD_PROFILE ?= release
@@ -22,24 +23,23 @@ DOCKER_TAG ?= latest
2223

2324
TM_SGX ?= true
2425

26+
# Paths for contracts and modules
2527
CW_CONTRACTS_V010_PATH = ./cosmwasm/contracts/v010/
2628
CW_CONTRACTS_V1_PATH = ./cosmwasm/contracts/v1/
27-
2829
TEST_CONTRACT_V010_PATH = ./cosmwasm/contracts/v010/compute-tests
2930
TEST_CONTRACT_V1_PATH = ./cosmwasm/contracts/v1/compute-tests
30-
3131
TEST_COMPUTE_MODULE_PATH = ./x/compute/internal/keeper/testdata/
32-
3332
ENCLAVE_PATH = cosmwasm/enclaves/
3433
EXECUTE_ENCLAVE_PATH = $(ENCLAVE_PATH)/execute/
35-
DOCKER_BUILD_ARGS ?=
3634

35+
# Determine if Docker Buildx is available for multi-platform builds
36+
DOCKER_BUILD_ARGS ?=
3737
DOCKER_BUILDX_CHECK = $(@shell docker build --load test)
38-
3938
ifeq (Building,$(findstring Building,$(DOCKER_BUILDX_CHECK)))
4039
DOCKER_BUILD_ARGS += "--load"
4140
endif
4241

42+
# Check and set the SGX_MODE to either HW or SW, error if not set
4343
ifeq ($(SGX_MODE), HW)
4444
ext := hw
4545
else ifeq ($(SGX_MODE), SW)
@@ -48,6 +48,7 @@ else
4848
$(error SGX_MODE must be either HW or SW)
4949
endif
5050

51+
# Set CGO flags based on the selected database backend (unused - currently only cleveldb is supported)
5152
ifeq ($(DB_BACKEND), rocksdb)
5253
DB_BACKEND = rocksdb
5354
DOCKER_CGO_LDFLAGS = "-L/usr/lib/x86_64-linux-gnu/ -lrocksdb -lstdc++ -llz4 -lm -lz -lbz2 -lsnappy"
@@ -63,6 +64,7 @@ endif
6364

6465
CUR_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
6566

67+
# Build tags setup for various configurations like ledger, database, etc.
6668
build_tags = netgo
6769
ifeq ($(LEDGER_ENABLED),true)
6870
ifeq ($(OS),Windows_NT)
@@ -120,6 +122,7 @@ whitespace += $(whitespace)
120122
comma := ,
121123
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
122124

125+
# Linker flags to embed version information and other metadata into the binaries
123126
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=SecretNetwork \
124127
-X github.com/cosmos/cosmos-sdk/version.AppName=secretd \
125128
-X github.com/scrtlabs/SecretNetwork/cmd/secretcli/version.ClientName=secretcli \
@@ -151,6 +154,7 @@ go.sum: go.mod
151154
@echo "--> Ensure dependencies have not been modified"
152155
GO111MODULE=on go mod verify
153156

157+
# Build the CLI tool
154158
build_cli:
155159
go build -o secretcli -mod=readonly -tags "$(filter-out sgx, $(GO_TAGS)) secretcli" -ldflags '$(LD_FLAGS)' ./cmd/secretd
156160

@@ -173,6 +177,7 @@ build-tm-secret-enclave:
173177
rustup component add rust-src
174178
SGX_MODE=$(SGX_MODE) $(MAKE) -C /tmp/tm-secret-enclave build
175179

180+
# Targets for building the cli on various platforms like Windows, macOS, Linux
176181
build_windows_cli:
177182
$(MAKE) xgo_build_secretcli XGO_TARGET=windows/amd64
178183
sudo mv github.com/scrtlabs/SecretNetwork-windows-* secretcli-windows-amd64.exe
@@ -195,6 +200,7 @@ build_linux_arm64_cli:
195200

196201
build_all: build-linux build_windows_cli build_macos_cli build_linux_arm64_cli
197202

203+
# Build Debian package
198204
deb: build-linux deb-no-compile
199205

200206
deb-no-compile:
@@ -226,6 +232,7 @@ deb-no-compile:
226232
dpkg-deb --build /tmp/SecretNetwork/deb/ .
227233
-rm -rf /tmp/SecretNetwork
228234

235+
# Clean up generated files and reset the environment
229236
clean:
230237
-rm -rf /tmp/SecretNetwork
231238
-rm -f ./secretcli*
@@ -247,6 +254,11 @@ clean:
247254
$(MAKE) -C $(TEST_CONTRACT_V1_PATH)/test-compute-contract clean
248255
$(MAKE) -C $(TEST_CONTRACT_V1_PATH)/test-compute-contract-v2 clean
249256

257+
###############################################################################
258+
### Dockerized Build Targets ###
259+
###############################################################################
260+
261+
# Build localsecret - dockerized local chain for development and testing. In this version SGX is ran in software/simulation mode
250262
localsecret:
251263
DOCKER_BUILDKIT=1 docker build \
252264
--build-arg FEATURES="${FEATURES},debug-print,random,light-client-validation" \
@@ -309,6 +321,7 @@ build-testnet:
309321
--target build-deb .
310322
docker run -e VERSION=${VERSION} -v $(CUR_DIR)/build:/build deb_build
311323

324+
# special targets for building a deb package that compiles a new secretd but takes the enclaves from the latest package - used for upgrades when we don't want to replace the enclave
312325
build-mainnet-upgrade:
313326
@mkdir build 2>&3 || true
314327
DOCKER_BUILDKIT=1 docker build --build-arg FEATURES="verify-validator-whitelist,light-client-validation,production, ${FEATURES}" \
@@ -336,6 +349,8 @@ build-mainnet-upgrade:
336349
-t deb_build \
337350
--target build-deb-mainnet .
338351
docker run -e VERSION=${VERSION} -v $(CUR_DIR)/build:/build deb_build
352+
353+
# full mainnet build - will end up with a .deb package in the ./build folder
339354
build-mainnet:
340355
@mkdir build 2>&3 || true
341356
DOCKER_BUILDKIT=1 docker build --build-arg FEATURES="verify-validator-whitelist,light-client-validation,production,random, ${FEATURES}" \
@@ -367,6 +382,7 @@ build-mainnet:
367382
--target build-deb .
368383
docker run -e VERSION=${VERSION} -v $(CUR_DIR)/build:/build deb_build
369384

385+
# Build the hardware compatability checker - this is a binary that just runs attestation and provides details on the result
370386
build-check-hw-tool:
371387
@mkdir build 2>&3 || true
372388
DOCKER_BUILDKIT=1 docker build --build-arg FEATURES="${FEATURES}" \
@@ -383,23 +399,22 @@ build-check-hw-tool:
383399
-t compile-check-hw-tool \
384400
--target compile-check-hw-tool .
385401

386-
# while developing:
402+
###############################################################################
403+
### Local Build Targets ###
404+
###############################################################################
405+
387406
build-enclave:
388407
$(MAKE) -C $(EXECUTE_ENCLAVE_PATH) enclave
389408

390-
# while developing:
391409
check-enclave:
392410
$(MAKE) -C $(EXECUTE_ENCLAVE_PATH) check
393411

394-
# while developing:
395412
clippy-enclave:
396413
$(MAKE) -C $(EXECUTE_ENCLAVE_PATH) clippy
397414

398-
# while developing:
399415
clean-enclave:
400416
$(MAKE) -C $(EXECUTE_ENCLAVE_PATH) clean
401417

402-
# while developing:
403418
clippy: clippy-enclave
404419
$(MAKE) -C check-hw clippy
405420

README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<div align="center">
44

5-
[![version](https://img.shields.io/badge/version-1.3.1-blue)](https://github.com/scrtlabs/SecretNetwork/releases/tag/v1.3.1)
6-
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
5+
[![version](https://img.shields.io/badge/version-1.12.1-blue)](https://github.com/scrtlabs/SecretNetwork/releases/tag/v1.12.1)
6+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
77
<a href="https://twitter.com/intent/follow?screen_name=SecretNetwork">
88
<img src="https://img.shields.io/twitter/follow/SecretNetwork?style=social&logo=twitter"
99
alt="Follow"></a>
@@ -42,7 +42,16 @@ Click the button below to start a new development environment:
4242
### Install prerequisite packages
4343

4444
```
45-
apt-get install -y --no-install-recommends g++ libtool autoconf clang
45+
apt-get install -y --no-install-recommends g++ libtool automake autoconf clang
46+
```
47+
48+
#### Ubuntu 22+
49+
50+
The build depends on libssl1.1. Install using:
51+
52+
```bash
53+
wget https://debian.mirror.ac.za/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0%2Bdeb11u1_amd64.deb
54+
dpkg -i libssl1.1_1.1.1w-0%2Bdeb11u1_amd64.deb
4655
```
4756

4857
### Clone Repo
@@ -111,15 +120,11 @@ Use `make build-linux` to build the entire codebase. This will build both the Ru
111120

112121
To build just the rust code, you can use `make build-linux`, while to build just the Go code, there is the aptly named `make build_local_no_rust`.
113122

114-
115123
Tip:
116-
```text
117124
For a production build the enclave must be copied from the most recent release.
118-
119125
This is due to non-reproducible builds, and the fact that enclaves must be signed with a specific key to be accepted on mainnet.
120-
121126
Still, the non-enclave code can be modified and ran on mainnet as long as there are no consensus-breaking changes
122-
```
127+
123128

124129
# Running Something
125130

@@ -145,7 +150,3 @@ For the latest documentation, check out [https://docs.scrt.network](https://docs
145150
- Twitter: [https://twitter.com/SecretNetwork](https://twitter.com/SecretNetwork)
146151
- Community Telegram Channel: [https://t.me/SCRTnetwork](https://t.me/SCRTnetwork)
147152
- Community Secret Nodes Telegram: [https://t.me/secretnodes](https://t.me/secretnodes)
148-
149-
# License
150-
151-
SecretNetwork is free software: you can redistribute it and/or modify it under the terms of the [GNU Affero General Public License](LICENSE) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The GNU Affero General Public License is based on the GNU GPL, but has an additional term to allow users who interact with the licensed software over a network to receive the source for that program.

0 commit comments

Comments
 (0)