Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed May 10, 2024
2 parents a2b4718 + df947d6 commit 1ae1bb4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Dockerfile-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ RUN cd node && make install

# Build new release from the current source
FROM base
ARG NEW_VERSION
ENV NEW_VERSION=${NEW_VERSION}
COPY go.mod /go/delivery/zeta-node/
COPY go.sum /go/delivery/zeta-node/
RUN cd /go/delivery/zeta-node/ && go mod download
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build

VERSION := $(shell git describe --tags)
VERSION := $(shell ./version.sh)
COMMIT := $(shell [ -z "${COMMIT_ID}" ] && git log -1 --format='%H' || echo ${COMMIT_ID} )
BUILDTIME := $(shell date -u +"%Y%m%d.%H%M%S" )
DOCKER ?= docker
Expand Down Expand Up @@ -221,7 +221,7 @@ start-stress-test: zetanode
#TODO: replace OLD_VERSION with v16 tag once its available
zetanode-upgrade:
@echo "Building zetanode-upgrade"
$(DOCKER) build -t zetanode -f ./Dockerfile-upgrade --build-arg OLD_VERSION='release/v16' --build-arg NEW_VERSION=v17 .
$(DOCKER) build -t zetanode -f ./Dockerfile-upgrade --build-arg OLD_VERSION='release/v16' .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile.fastbuild .
.PHONY: zetanode-upgrade

Expand Down
9 changes: 4 additions & 5 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/zeta-chain/zetacore/pkg/constant"
emissionstypes "github.com/zeta-chain/zetacore/x/emissions/types"
)

const releaseVersion = "v17"

func SetupHandlers(app *App) {
// Set param key table for params module migration
for _, subspace := range app.ParamsKeeper.GetSubspaces() {
Expand Down Expand Up @@ -50,8 +49,8 @@ func SetupHandlers(app *App) {
}
}
baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) {
app.Logger().Info("Running upgrade handler for " + releaseVersion)
app.UpgradeKeeper.SetUpgradeHandler(constant.Version, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) {
app.Logger().Info("Running upgrade handler for " + constant.Version)
// Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module.
baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper)
// Updated version map to the latest consensus versions from each module
Expand All @@ -78,7 +77,7 @@ func SetupHandlers(app *App) {
if err != nil {
panic(err)
}
if upgradeInfo.Name == releaseVersion && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
if upgradeInfo.Name == constant.Version && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{consensustypes.ModuleName, crisistypes.ModuleName},
}
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [2032](https://github.com/zeta-chain/node/pull/2032) - improve some general structure of the ZetaClient codebase
* [2100](https://github.com/zeta-chain/node/pull/2100) - cosmos v0.47 upgrade
* [2145](https://github.com/zeta-chain/node/pull/2145) - add `ibc` and `ibc-transfer` modules
* [2135](https://github.com/zeta-chain/node/pull/2135) - add develop build version logic

### Refactor

Expand Down
5 changes: 1 addition & 4 deletions contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ export DAEMON_DATA_BACKUP_DIR=$DAEMON_HOME
export CLIENT_SKIP_UPGRADE=true
export CLIENT_START_PROCESS=false
export UNSAFE_SKIP_BACKUP=true
export UpgradeName=${NEW_VERSION}

# upgrade name used for upgrade testing
export UpgradeName=${NEW_VERSION}
export UpgradeName=$(${GOPATH}/bin/new/zetacored version)

# generate node list
START=1
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.

20 changes: 20 additions & 0 deletions version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# --exact-match will ensure the tag is only returned if our commit is a tag
version=$(git describe --exact-match --tags 2>/dev/null)
if [[ $? -eq 0 ]]; then
echo $version
exit
fi

# use current timestamp for dirty builds
if ! git diff --no-ext-diff --quiet --exit-code ; then
current_timestamp=$(date +"%s")
echo "v0.0.${current_timestamp}-dirty"
exit
fi

# otherwise assume we are on a develop build and use commit timestamp for version
commit_timestamp=$(git show --no-patch --format=%at)

echo "v0.0.${commit_timestamp}-develop"

0 comments on commit 1ae1bb4

Please sign in to comment.