Skip to content

Commit

Permalink
Merge branch 'main' of github.com:classic-terra/core
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Mar 7, 2024
2 parents ccbbdb4 + ec9105c commit 40dc88a
Show file tree
Hide file tree
Showing 78 changed files with 8,007 additions and 225 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: "go"
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run End-To-End Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- frag/foundation
permissions:
contents: read
packages: write

jobs:
e2e:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20.4'
-
name: Check out repository code
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build e2e image
uses: docker/build-push-action@v3
with:
file: ./tests/e2e/e2e.Dockerfile
context: .
platforms: linux/amd64
tags: terra:debug
build-args: |
BASE_IMG_TAG=debug
-
name: Testing
run: make test-e2e
108 changes: 108 additions & 0 deletions .github/workflows/interchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Interchain Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- frag/foundation
permissions:
contents: read
packages: write

jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build interchain image
id: build_image
uses: docker/build-push-action@v3
with:
file: ./ictest.Dockerfile
context: .
platforms: linux/amd64
tags: |
core:local
test-terra-start:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-start

test-ibc-transfer:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-ibc

test-ibc-hooks:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-ibc-hooks

test-ibc-pfm:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-ibc-pfm

test-validator:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-validator
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: install runsim
run: |
export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/[email protected]
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand All @@ -40,7 +40,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -38,15 +38,15 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
- name: Display go version
run: go version
- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand All @@ -56,7 +56,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -68,7 +68,7 @@ jobs:
**/**.go
go.mod
go.sum
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand All @@ -83,7 +83,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -97,7 +97,7 @@ jobs:
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand All @@ -112,7 +112,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -126,7 +126,7 @@ jobs:
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand All @@ -141,7 +141,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -155,7 +155,7 @@ jobs:
go.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
check-latest: true
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ARG source=./
ARG GO_VERSION="1.20"
ARG BUILDPLATFORM=linux/amd64
ARG BASE_IMAGE="golang:${GO_VERSION}-alpine"
ARG BASE_IMAGE="golang:${GO_VERSION}-alpine3.18"
FROM --platform=${BUILDPLATFORM} ${BASE_IMAGE} as base

###############################################################################
Expand Down Expand Up @@ -104,7 +104,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \

FROM alpine as terra-core

RUN apk update && apk add wget lz4 aria2 curl jq gawk coreutils "zlib>1.2.12-r2" "libssl1.1>1.1.1q-r0"
RUN apk update && apk add wget lz4 aria2 curl jq gawk coreutils "zlib>1.2.12-r2" libssl3

COPY --from=builder-stage-2 /go/bin/terrad /usr/local/bin/terrad

Expand Down
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/make -f

include tests/e2e/e2e.mk

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
Expand Down Expand Up @@ -248,6 +250,31 @@ benchmark:

.PHONY: test test-all test-cover test-unit test-race

###############################################################################
### Interchain test ###
###############################################################################
# Executes basic chain tests via interchaintest
ictest-start: ictest-build
@cd tests/interchaintest && go test -race -v -run TestTerraStart .

ictest-validator: ictest-build
@cd tests/interchaintest && go test -timeout=25m -race -v -run TestValidator .

ictest-ibc: ictest-build
@cd tests/interchaintest && go test -race -v -run TestTerraGaiaIBCTranfer .

ictest-ibc-hooks: ictest-build
@cd tests/interchaintest && go test -race -v -run TestTerraIBCHooks .

ictest-ibc-pfm: ictest-build
@cd tests/interchaintest && go test -race -v -run TestTerraGaiaOsmoPFM .

ictest-ibc-pfm-terra: ictest-build
@cd tests/interchaintest && go test -race -v -run TestTerraPFM .

ictest-build:
@DOCKER_BUILDKIT=1 docker build -t core:local -f ictest.Dockerfile .

###############################################################################
### Linting ###
###############################################################################
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

**Classic** is the reference implementation of the Terra protocol, written in Golang. Terra Core is built atop [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and uses [Tendermint](https://github.com/tendermint/tendermint) BFT consensus. If you intend to work on Terra Core source, it is recommended that you familiarize yourself with the concepts in those projects.

Upon the implosion of Terra, a group of rebels seized control of the blockchain. Terra's future is uncertain, but the rebels are now firmly in control.

## Installation

### Binaries
Expand Down
Loading

0 comments on commit 40dc88a

Please sign in to comment.