Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ FROM --platform=${BUILDPLATFORM} ${BASE_IMAGE} AS base
###############################################################################

FROM base AS builder-stage-1
ARG GO_VERSION="1.22.10"
ARG GO_VERSION="1.23.6"
ARG GIT_COMMIT
ARG GIT_VERSION
ARG BUILDPLATFORM
ARG GOOS=linux \
GOARCH=amd64

ENV GOOS=$GOOS \
GOARCH=$GOARCH

Expand All @@ -35,7 +34,8 @@ RUN set -eux &&\
linux-headers \
build-base \
cmake \
git
git \
patchelf

# install mimalloc for musl
WORKDIR ${GOPATH}/src/mimalloc
Expand All @@ -53,6 +53,8 @@ RUN set -eux &&\
WORKDIR ${GOPATH}/src/app
COPY ledger-go ./ledger-go
COPY go.mod go.sum ./


RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download -x
Expand All @@ -68,10 +70,10 @@ RUN set -eux &&\
elif [ ${BUILDPLATFORM} = "linux/arm64" ]; then \
WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm_muslc.aarch64.a"; \
WASMVM_FILE="libwasmvm_muslc.aarch64.a"; \
# elif [ ${BUILDPLATFORM} = "darwin/amd64" ]; then \
# WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm.dylib"; \
# elif [ ${BUILDPLATFORM} = "darwin/arm64" ]; then \
# WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm.dylib"; \
elif [ ${BUILDPLATFORM} = "darwin/amd64" ]; then \
WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm.dylib"; \
elif [ ${BUILDPLATFORM} = "darwin/arm64" ]; then \
WASMVM_URL="${WASMVM_DOWNLOADS}/libwasmvm.dylib"; \
else \
echo "Unsupported Build Platfrom ${BUILDPLATFORM}"; \
exit 1; \
Expand All @@ -91,6 +93,8 @@ ARG GOOS=linux \
ENV GOOS=$GOOS \
GOARCH=$GOARCH

ENV GOPROXY=file:///modcache,https://proxy.golang.org,direct

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be required anymore?


# Copy the remaining files
COPY . .

Expand All @@ -102,16 +106,21 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
-tags "netgo,muslc" \
-ldflags " \
-w -s -linkmode=external -extldflags \
'-L/go/src/mimalloc/build -lmimalloc -Wl,-z,muldefs -static' \
'-L/go/src/mimalloc/build -lmimalloc -Wl,-z,muldefs -static-pie -z noexecstack' \
-X github.com/cosmos/cosmos-sdk/version.Name='terrad' \
-X github.com/cosmos/cosmos-sdk/version.AppName='terrad' \
-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,muslc' \
" \
-buildmode=pie \
-trimpath \
./...

# Strip the RPATH/RUNPATH baked in by the external linker so the released
# binary does not try to load libraries from build-time paths
RUN patchelf --remove-rpath /go/bin/terrad

################################################################################

FROM alpine:${ALPINE_VERSION} as terra-core
Expand All @@ -123,4 +132,4 @@ RUN addgroup -g 1000 terra && \

WORKDIR /app

CMD ["terrad", "--home", "/app", "start"]
CMD ["terrad", "--home", "/app", "start"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BINDIR ?= $(GOPATH)/bin
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)
SHA256_CMD = sha256sum
GO_VERSION ?= "1.22.10"
GO_VERSION ?= "1.23.6"
# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --tags)
Expand Down Expand Up @@ -323,4 +323,4 @@ localnet-stop:

localnet-start: localnet-stop localnet-build-env localnet-build-nodes

.PHONY: localnet-stop localnet-start localnet-build-env localnet-build-nodes localnet-rmi
.PHONY: localnet-stop localnet-start localnet-build-env localnet-build-nodes localnet-rmi
1 change: 1 addition & 0 deletions app/config/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,5 @@ const (
Upgrade2_18 = "v2.18"
Upgrade2_19 = "v2.19"
Upgrade2_20 = "v2.20"
Upgrade2_21 = "v2.21"
)
9 changes: 9 additions & 0 deletions app/upgrade_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
v2_19 "github.com/terra-money/core/v2/app/upgrades/v2.19"
v2_2_0 "github.com/terra-money/core/v2/app/upgrades/v2.2.0"
v2_20 "github.com/terra-money/core/v2/app/upgrades/v2.20"
v2_21 "github.com/terra-money/core/v2/app/upgrades/v2.21"
v2_3_0 "github.com/terra-money/core/v2/app/upgrades/v2.3.0"
v2_4 "github.com/terra-money/core/v2/app/upgrades/v2.4"
v2_5 "github.com/terra-money/core/v2/app/upgrades/v2.5"
Expand Down Expand Up @@ -192,6 +193,14 @@ func (app *TerraApp) RegisterUpgradeHandlers() {
app.Keepers,
),
)
app.Keepers.UpgradeKeeper.SetUpgradeHandler(
terraappconfig.Upgrade2_21,
v2_21.CreateUpgradeHandler(
app.GetModuleManager(),
app.GetConfigurator(),
app.Keepers,
),
)
}

func (app *TerraApp) RegisterUpgradeStores() {
Expand Down
20 changes: 20 additions & 0 deletions app/upgrades/v2.21/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v2_21

import (
"context"

upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"

"github.com/terra-money/core/v2/app/keepers"
)

func CreateUpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
k keepers.TerraAppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return mm.RunMigrations(ctx, cfg, vm)
}
}
12 changes: 5 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ require (
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/tx v0.13.8
cosmossdk.io/x/upgrade v0.1.4
github.com/CosmWasm/wasmd v0.54.9
github.com/CosmWasm/wasmvm/v2 v2.2.8
github.com/CosmWasm/wasmd v0.54.10
github.com/CosmWasm/wasmvm/v2 v2.2.9
github.com/cometbft/cometbft v0.38.21
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/cosmos/btcutil v1.0.5
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.15
Expand Down Expand Up @@ -53,10 +53,7 @@ require (
google.golang.org/grpc v1.70.0
)

require (
github.com/hashicorp/go-metrics v0.5.3
golang.org/x/crypto v0.33.0
)
require github.com/hashicorp/go-metrics v0.5.3

require (
cloud.google.com/go v0.115.0 // indirect
Expand Down Expand Up @@ -205,6 +202,7 @@ require (
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.17.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmd v0.54.9 h1:rca0ee3o6rLaoTt07Z4bKq6toYl/5nWHWEdO1tUmSqo=
github.com/CosmWasm/wasmd v0.54.9/go.mod h1:4uTpkoUHtKJtNyjqKCiASR1eslzjpNJqlgIzFuuPdmU=
github.com/CosmWasm/wasmvm/v2 v2.2.8 h1:7RqbEOTntOba8WjaWpQY5zU9xyyCVDKq0i4RSRa+M6M=
github.com/CosmWasm/wasmvm/v2 v2.2.8/go.mod h1:Aj/rB2KMRM8nAdbWxkO23rnQYb5KsoPuH9ZizSi0sVg=
github.com/CosmWasm/wasmd v0.54.10 h1:oBimGq6b0huSdJJdjSBeKxBaNV/vi3ynUboSAOaD0c8=
github.com/CosmWasm/wasmd v0.54.10/go.mod h1:vj2tGXyqjKSk9jm04VCi5VVwdsJ5DacijspfaMGWyRM=
github.com/CosmWasm/wasmvm/v2 v2.2.9 h1:SdMuA2RAGE0IBkKvHn4GoBqnaWmdanCAGl7oadZdxNw=
github.com/CosmWasm/wasmvm/v2 v2.2.9/go.mod h1:Aj/rB2KMRM8nAdbWxkO23rnQYb5KsoPuH9ZizSi0sVg=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q=
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"test:chain:upgrade:v18": "bash src/setup/chain-upgrade/upgrade-simulation-18.sh",
"test:chain:upgrade:v19": "bash src/setup/chain-upgrade/upgrade-simulation-19.sh",
"test:chain:upgrade:v20": "bash src/setup/chain-upgrade/upgrade-simulation-20.sh",
"test:chain:upgrade:v21": "bash src/setup/chain-upgrade/upgrade-simulation-21.sh",
"test:start": "jest --runInBand --detectOpenHandles",
"start": "npm run test:init && npm run test:relayer && npm run test:start",
"test:clean": "rm -rf src/test-data chain-upgrade-data && pkill terrad && pkill terrad && pkill relayer"
Expand Down Expand Up @@ -49,4 +50,4 @@
"long": "^5.3.1"
},
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
}
}
Loading
Loading