Skip to content

Commit

Permalink
V3.0.0 Chain upgrade (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamchordia authored Aug 30, 2024
1 parent 1cefcb7 commit 2c99fbf
Show file tree
Hide file tree
Showing 501 changed files with 11,058 additions and 55,571 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ v Please also ensure that this is not a duplicate issue :)

## Version

<!-- git commit hash, output of `quasarnoded version` -->
<!-- git commit hash, output of `quasard version` -->

## Steps to Reproduce

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
- name: Display go version
if: env.GIT_DIFF
run: go version
- name: Build quasarnoded
- name: Build quasard
if: env.GIT_DIFF
run: make build-reproducible-${{ matrix.arch }}
- uses: actions/upload-artifact@v3
if: env.GIT_DIFF
with:
name: quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }}
path: build/quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }}
name: quasard-${{ matrix.targetos }}-${{ matrix.arch }}
path: build/quasard-${{ matrix.targetos }}-${{ matrix.arch }}
6 changes: 4 additions & 2 deletions .github/workflows/lint_go.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Lint (Go)

# todo remove v3.x beafore merge to main
on:
pull_request:
branches:
- main
- v3.x
paths-ignore:
- 'smart-contracts/**'
- '**.md'
Expand Down Expand Up @@ -39,10 +41,10 @@ jobs:
if: env.GIT_DIFF
uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.22
- name: Display go version
if: env.GIT_DIFF
run: go version
- name: Go lint
if: env.GIT_DIFF
run: make lint
run: make lint
2 changes: 1 addition & 1 deletion .github/workflows/test_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.22
- name: Display go version
if: env.GIT_DIFF
run: go version
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ vue/
**/**/target
**/**/test-tube-build
local_testnet_run-*nodes/
*.out
coverage.txt
**/Cargo.lock

containers_homes/
Expand Down
83 changes: 26 additions & 57 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.20"
ARG GO_VERSION="1.22"
ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"
ARG BUILD_TAGS="netgo,ledger,muslc"

# --------------------------------------------------------
# Builder
# --------------------------------------------------------

FROM golang:${GO_VERSION}-alpine3.18 as builder
FROM golang:${GO_VERSION}-alpine3.20 as builder

ARG GIT_VERSION
ARG GIT_COMMIT
ARG BUILD_TAGS

RUN apk add --no-cache \
ca-certificates \
build-base \
linux-headers
linux-headers \
binutils-gold

# Download go dependencies
WORKDIR /quasar
Expand All @@ -25,44 +28,40 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
go mod download

# Cosmwasm - Download correct libwasmvm version
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.$(uname -m).a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$(uname -m).a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)

# Copy the remaining files
COPY . .

# Build quasarnoded binary
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /quasar/build/quasarnoded
# then ensure static linking
# Build quasard binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="quasar" \
-X github.com/cosmos/cosmos-sdk/version.AppName="quasarnoded" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags='netgo,ledger,muslc' \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o build/quasarnoded \
/quasar/cmd/quasarnoded/main.go

-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="quasar" \
-X github.com/cosmos/cosmos-sdk/version.AppName="quasard" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /quasar/build/quasard \
/quasar/cmd/quasard/main.go

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE} as runner
FROM ${RUNNER_IMAGE}

COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded
COPY --from=builder /quasar/build/quasard /bin/quasard

ENV HOME /quasar
WORKDIR $HOME
Expand All @@ -71,34 +70,4 @@ EXPOSE 26656
EXPOSE 26657
EXPOSE 1317

CMD ["quasarnoded"]

# --------------------------------------------------------
# Development
# --------------------------------------------------------

FROM ubuntu:22.04 as dev

ENV PACKAGES jq

RUN rm -f /etc/apt/apt.conf.d/docker-clean
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y $PACKAGES


COPY --from=builder /quasar/build/quasarnoded /bin/quasarnoded


ENV HOME /quasar
WORKDIR $HOME

COPY tests/docker/bootstrap-scripts/entrypoint.sh /quasar/entrypoint.sh
COPY tests/docker/bootstrap-scripts/quasar_localnet.sh /quasar/app_init.sh
RUN chmod +x entrypoint.sh && chmod +x app_init.sh && mkdir logs

EXPOSE 26656
EXPOSE 26657
EXPOSE 1317

CMD ["quasarnoded"]
ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["quasard"]
2 changes: 1 addition & 1 deletion LOCALNET.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Then make sure the upgrade is registered in the `app.go`:
```golang
// imports
// ...
dummy "github.com/quasarlabs/quasarnode/app/upgrades/dummy"
dummy "github.com/quasar-finance/quasar/app/upgrades/dummy"

// var block declaration
// ...
Expand Down
Loading

0 comments on commit 2c99fbf

Please sign in to comment.