Skip to content

Commit

Permalink
Merge branch 'master' into store-merkle-proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
toml01 authored Oct 30, 2023
2 parents 534c94a + f9a8b99 commit 71d4e2e
Show file tree
Hide file tree
Showing 518 changed files with 71,125 additions and 13,508 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
RUN bash /tmp/library-scripts/rust-debian.sh "${CARGO_HOME}" "${RUSTUP_HOME}" "${USERNAME}" "true" "true"

# Install Go
#ADD https://go.dev/dl/go1.18.4.linux-amd64.tar.gz go1.18.4.linux-amd64.tar.gz
#RUN tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
#ADD https://go.dev/dl/go1.21.1.linux-amd64.tar.gz go.linux-amd64.tar.gz
#RUN tar -C /usr/local -xzf go.linux-amd64.tar.gz
#
#RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" "$GOPATH/pkg" && chmod -R 777 "$GOPATH"
#RUN chown ${USERNAME}:${USERNAME} /go -R

RUN bash /tmp/library-scripts/go-debian.sh "1.18.4" "${GOROOT}" "${GOPATH}" "${USERNAME}" "true" "true" && \
RUN bash /tmp/library-scripts/go-debian.sh "1.21.1" "${GOROOT}" "${GOPATH}" "${USERNAME}" "true" "true" && \
go install github.com/jteeuwen/go-bindata/go-bindata@latest && go-bindata -version

RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
Expand Down
88 changes: 40 additions & 48 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ jobs:
Enclave-Unit-Tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
name: Pull git submodules
- name: Install Intel's SGX SDK
run: |
mkdir -p "$HOME/.sgxsdk"
cd "$HOME/.sgxsdk"
SDK_BIN=sgx_linux_x64_sdk_2.17.101.1.bin
wget https://download.01.org/intel-sgx/sgx-linux/2.17.1/distro/ubuntu20.04-server/"$SDK_BIN"
SDK_BIN=sgx_linux_x64_sdk_2.20.100.4.bin
wget https://download.01.org/intel-sgx/sgx-linux/2.20/distro/ubuntu20.04-server/"$SDK_BIN"
chmod +x "$SDK_BIN"
echo yes | ./"$SDK_BIN"
- name: Cache cargo registry
Expand Down Expand Up @@ -43,35 +43,25 @@ jobs:
rustc --version
cargo +stable install xargo --version 0.3.25
xargo --version
- name: Download sccache
run: |
wget https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
tar xf ./sccache-*.tar.gz
mv ./sccache*/sccache "$HOME/sccache"
- name: Test enclave
run: |
source "$HOME/.sgxsdk/sgxsdk/environment"
export SGX_MODE=SW
RUSTC_WRAPPER="$HOME/sccache" make enclave-tests
make enclave-tests
make clean-enclave
Build-Contracts:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Download sccache
run: |
wget https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
tar xf ./sccache-*.tar.gz
mv ./sccache*/sccache "$HOME/sccache"
- uses: actions/checkout@v4
- name: Install Requirements
run: |
rustup target add wasm32-unknown-unknown
chmod +x ./scripts/install-wasm-tools.sh
./scripts/install-wasm-tools.sh
- name: Build Contracts
run: |
make build-test-contract
make build-test-contracts
cp x/compute/internal/keeper/testdata/erc20.wasm .
- uses: actions/upload-artifact@v3
with:
Expand All @@ -81,6 +71,10 @@ jobs:
with:
name: contract.wasm
path: cosmwasm/contracts/v010/compute-tests/test-compute-contract/contract.wasm
- uses: actions/upload-artifact@v3
with:
name: contract-v2.wasm
path: cosmwasm/contracts/v010/compute-tests/test-compute-contract-v2/contract-v2.wasm
- uses: actions/upload-artifact@v3
with:
name: v1-contract.wasm
Expand All @@ -106,18 +100,18 @@ jobs:
runs-on: ubuntu-20.04
needs: [Build-Contracts, Build-LocalSecret]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: 1.19 # The Go version to download (if necessary) and use.
go-version: 1.21 # The Go version to download (if necessary) and use.
- name: Install Intel's SGX SDK
run: |
mkdir -p "$HOME/.sgxsdk"
cd "$HOME/.sgxsdk"
SDK_BIN=sgx_linux_x64_sdk_2.17.101.1.bin
wget https://download.01.org/intel-sgx/sgx-linux/2.17.1/distro/ubuntu20.04-server/"$SDK_BIN"
SDK_BIN=sgx_linux_x64_sdk_2.20.100.4.bin
wget https://download.01.org/intel-sgx/sgx-linux/2.20/distro/ubuntu20.04-server/"$SDK_BIN"
chmod +x "$SDK_BIN"
echo yes | ./"$SDK_BIN"
- name: Download LocalSecret
Expand All @@ -133,10 +127,14 @@ jobs:
docker run -v $PWD:/opt/mount --rm --entrypoint cp ghcr.io/scrtlabs/localsecret:v0.0.0 /usr/lib/librust_cosmwasm_enclave.signed.so /opt/mount/librust_cosmwasm_enclave.signed.so
docker run -v $PWD:/opt/mount --rm --entrypoint cp ghcr.io/scrtlabs/localsecret:v0.0.0 /usr/lib/librandom_api.so /opt/mount/librandom_api.so
docker run -v $PWD:/opt/mount --rm --entrypoint cp ghcr.io/scrtlabs/localsecret:v0.0.0 /usr/lib/tendermint_enclave.signed.so /opt/mount/tendermint_enclave.signed.so
- uses: actions/download-artifact@v3
with:
name: contract.wasm
path: ./x/compute/internal/keeper/testdata/
- uses: actions/download-artifact@v3
with:
name: contract-v2.wasm
path: ./x/compute/internal/keeper/testdata/
- uses: actions/download-artifact@v3
with:
name: v1-contract.wasm
Expand All @@ -148,23 +146,20 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: contract_with_floats.wasm
path: ./x/compute/internal/keeper/testdata/
- uses: actions/download-artifact@v3
with:
name: too-high-initial-memory.wasm
path: ./x/compute/internal/keeper/testdata/
- uses: actions/download-artifact@v3
with:
name: static-too-high-initial-memory.wasm
path: ./x/compute/internal/keeper/testdata/
- name: Setup Files
run: |
find "$(pwd)" -name \*.wasm
cp libgo_cosmwasm.so ./go-cosmwasm/api/libgo_cosmwasm.so
cp librust_cosmwasm_enclave.signed.so ./go-cosmwasm/librust_cosmwasm_enclave.signed.so
# cp /opt/mount/librandom_api.so /usr/lib/librandom_api.so
# cp /opt/mount/tendermint_enclave.signed.so /usr/lib/tendermint_enclave.signed.so
cp contract.wasm ./x/compute/internal/keeper/testdata/contract.wasm
cp too-high-initial-memory.wasm ./x/compute/internal/keeper/testdata/too-high-initial-memory.wasm
cp contract_with_floats.wasm ./x/compute/internal/keeper/testdata/contract_with_floats.wasm
cp static-too-high-initial-memory.wasm ./x/compute/internal/keeper/testdata/static-too-high-initial-memory.wasm
find "$(pwd)" -name \*.wasm
- name: Test x/registration
run: |
Expand All @@ -175,17 +170,18 @@ jobs:
source "$HOME/.sgxsdk/sgxsdk/environment"
export SGX_MODE=SW
cp librust_cosmwasm_enclave.signed.so ./x/compute/internal/keeper
# cp tendermint_enclave.signed.so ./x/compute/internal/keeper
mkdir -p ias_keys/develop
mkdir -p /opt/secret/.sgx_secrets/
echo "not_a_key" > ias_keys/develop/spid.txt
echo "not_a_key" > ias_keys/develop/api_key.txt
LOG_LEVEL=ERROR go test -v -tags "test" ./x/compute/client/...
LOG_LEVEL=ERROR go test -p 1 -timeout 90m -v -tags "test" ./x/compute/internal/...
LOG_LEVEL=ERROR SKIP_LIGHT_CLIENT_VALIDATION=TRUE go test -p 1 -timeout 90m -v -tags "test" ./x/compute/internal/...
Clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Intel's SGX SDK
Expand Down Expand Up @@ -224,28 +220,23 @@ jobs:
rustc --version
cargo +stable install xargo --version 0.3.25
xargo --version
- name: Download sccache
run: |
wget https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
tar xf ./sccache-*.tar.gz
mv ./sccache*/sccache "$HOME/sccache"
- name: Clippy
run: |
source "$HOME/.sgxsdk/sgxsdk/environment"
mkdir -p ias_keys/production
echo "not_a_key" > ias_keys/production/api_key.txt
cp ias_keys/develop/api_key.txt ias_keys/production/api_key.txt
SGX_MODE=SW make clippy
SGX_MODE=HW make clippy
MacOS-ARM64-CLI:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: 1.19 # The Go version to download (if necessary) and use.
go-version: 1.21 # The Go version to download (if necessary) and use.
- name: Install xgo
run: |
go install github.com/crazy-max/[email protected]
Expand All @@ -260,7 +251,7 @@ jobs:
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build LocalSecret
Expand All @@ -276,11 +267,11 @@ jobs:
build-args: |
SECRET_NODE_TYPE=BOOTSTRAP
CHAIN_ID=secretdev-1
FEATURES=debug-print
FEATURES_U=debug-print,random,light-client-validation,go-tests
SGX_MODE=SW
target: build-localsecret
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/localsecret.tar
- name: Upload Image
uses: actions/upload-artifact@v3
Expand All @@ -293,7 +284,7 @@ jobs:
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build Hermes Image
uses: docker/build-push-action@v4
with:
Expand All @@ -315,7 +306,7 @@ jobs:
runs-on: ubuntu-20.04
needs: [Build-LocalSecret, Build-Hermes]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download Hermes
Expand All @@ -336,8 +327,9 @@ jobs:
run: |
cd integration-tests
yarn
docker compose -f ../deployment/dockerfiles/ibc/docker-compose.yml up -d
yarn test
perl -i -pe 's/localsecret:.+?"/localsecret:v0.0.0"/' ../deployment/dockerfiles/ibc/docker-compose.yml
docker compose -f ../deployment/dockerfiles/ibc/docker-compose.yml up -d > docker-compose.log 2>&1
yarn test || { cat docker-compose.log; exit 1; }
make kill-localsecret # next step needs the localsecret ports
- name: Run secret.js tests
run: |
Expand All @@ -346,6 +338,6 @@ jobs:
# Use the docker images that we built just a few steps above
perl -i -pe 's/localsecret:.+?"/localsecret:v0.0.0"/' ./test/docker-compose.yml
yarn
docker compose -f ./test/docker-compose.yml up -d
yarn test-ci
docker compose -f ./test/docker-compose.yml up -d > docker-compose.log 2>&1
yarn test-ci || { cat docker-compose.log; exit 1; }
make kill-localsecret
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.18
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: golangci-lint
on:
push:
tags:
- v*
- "*"
branches:
- master
- main
pull_request:
- "*"
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
Expand All @@ -18,10 +16,14 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
go-version: 1.21
- uses: actions/checkout@v4
- name: make bin-data-sw
run: |
go install github.com/jteeuwen/go-bindata/go-bindata@latest
make bin-data-sw
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.51.2
version: v1.54.2
skip-cache: true
Loading

0 comments on commit 71d4e2e

Please sign in to comment.