Skip to content

Commit

Permalink
V0.19.0 patch (#244)
Browse files Browse the repository at this point in the history
* remove versioning

* refresh scripts, makefile, dockerfile,add basic e2e & pfm-e2e

* bump config comments

* add polytone e2e test

* improve genesis codec customization format, remove RandomGenesisAccount from auth.NewAppModule, add wasm tests to e2e-basic,

* slashing cli

* replace cosmos-sdk with bitsong specific distirbution patch fork

* slashsing codec registry

* docker bump, add v018 cosmos-sdk patch

* print results to new file

* bump correct patch release

* correct sdk patch

* patch v18 slashing logic error

* bump sdk patch

* format cw-orchestrator into e2e test repo, add polytone msgs command

* ci bump

* ci bump

* revert token types to v114 in ictest

* coderabbit bumps

* v19 upgrade handler

* delete replace cosmos-sdk, add v019 upgrade handler & logic

* prep v019 cli helper

* patch gov msg service route & reformat repo module versioning

* add make & e2e asserting gov props are created

* ci bumps

* coderabbit bump

* keep cdc unregistered for slashing until manual upgrade

* change to v20 upgrade

* format to v020 upgrade

* register governance msg service router

* add legacy proposal context to gov proposal route

* statik

* e2e bump

* wait to add cdc to slashing until v020

---------

Co-authored-by: hard-nett <[email protected]>
  • Loading branch information
hard-nett and hard-nett authored Dec 16, 2024
1 parent 0793601 commit 5960e1c
Show file tree
Hide file tree
Showing 102 changed files with 10,436 additions and 791 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/build_docker.yml

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/interchaintest-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
packages: write

env:
GO_VERSION: 1.22.0
GO_VERSION: 1.22.4
TAR_PATH: /tmp/bitsong-docker-image.tar
IMAGE_NAME: bitsong-docker-image

Expand Down Expand Up @@ -55,16 +55,18 @@ jobs:
needs: build-docker
runs-on: ubuntu-latest
strategy:
matrix: 899
matrix:
# names of `make` commands to run tests
test:
# - "e2e-basic"
- "e2e-basic"
- "e2e-pfm"
- "e2e-polytone"
# - "e2e-upgrade"
fail-fast: false

steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

name: Push Docker Images

env:
DOCKER_REPOSITORY: bitsongofficial/go-bitsong
RUNNER_BASE_IMAGE_DISTROLESS: gcr.io/distroless/static-debian11
RUNNER_BASE_IMAGE_NONROOT: gcr.io/distroless/static-debian11:nonroot
RUNNER_BASE_IMAGE_ALPINE: alpine:3.17

on:
release:
types: [published, created, edited]
Expand All @@ -26,7 +32,7 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc

jobs:
terp-images:
bitsong-images:
runs-on: ubuntu-latest
steps:
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Create release 📜
uses: goreleaser/[email protected]
with:
args: release --rm-dist
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ coverage.txt
profile.out

# heighliner
heighliner
heighliner/

# Vagrant
.vagrant/
Expand All @@ -51,4 +51,5 @@ data
state_export.json

github.com*
gogoproto*
gogoproto*
target/
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docker build . -t cosmoscontracts/juno:latest
# docker run --rm -it cosmoscontracts/juno:latest /bin/sh
# docker build . -t bitsongofficial/go-bitsong:latest
# docker run --rm -it bitsongofficial/go-bitsong:latest /bin/sh
FROM golang:1.22-alpine AS go-builder

# this comes from standard alpine nightly file
Expand Down Expand Up @@ -29,17 +29,17 @@ RUN set -eux; \
COPY . /code/

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/junod
# then log output of file /code/build/bitsongd
# then ensure static linking
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
&& file /code/bin/bitsongd \
&& file /code/build/bitsongd \
&& echo "Ensuring binary is statically linked ..." \
&& (file /code/bin/bitsongd | grep "statically linked")
&& (file /code/build/bitsongd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.16

COPY --from=go-builder /code/bin/bitsongd /usr/bin/bitsongd
COPY --from=go-builder /code/build/bitsongd /usr/bin/bitsongd

ENV HOME=/bitsongd
WORKDIR $HOME
Expand Down
127 changes: 9 additions & 118 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/make -f

include scripts/makefiles/build.mk
include scripts/makefiles/docker.mk
include scripts/makefiles/e2e.mk
include scripts/makefiles/hl.mk
include scripts/makefiles/proto.mk
include scripts/makefiles/localnet.mk
include contrib/devtools/Makefile

.DEFAULT_GOAL := help
Expand All @@ -13,9 +16,11 @@ help:
@echo " make [command]"
@echo ""
@echo " make build Build Bitsong node binary"
@echo " make install Install Bitsong node binary"
@echo " make hl Show available docker commands (via Strangelove's Heighliner Tooling)"
@echo " make docker Show available docker related commands"
@echo " make e2e Show available e2e commands"
@echo " make hl Show available docker commands (via Strangelove's Heighliner Tooling)"
@echo " make install Install Bitsong node binary"
@echo " make localnet Show available localnet commands"
@echo ""
@echo "Run 'make [subcommand]' to see the available commands for each subcommand."

Expand All @@ -38,8 +43,6 @@ TENDERMINT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

E2E_UPGRADE_VERSION := "v0.18.0"

GO_MODULE := $(shell cat go.mod | grep "module " | cut -d ' ' -f 2)
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
Expand Down Expand Up @@ -97,7 +100,6 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=go-bitsong \
-X github.com/cosmos/cosmos-sdk/version.AppName=bitsongd \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
Expand All @@ -115,59 +117,18 @@ endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' -trimpath

all: install tools lint
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

build: go.sum
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/bitsongd.exe ./cmd/bitsongd
else
go build $(BUILD_FLAGS) -o bin/bitsongd ./cmd/bitsongd
go build $(BUILD_FLAGS) -o build/bitsongd ./cmd/bitsongd
endif

build-linux: go.sum
go build $(BUILD_FLAGS)

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/bitsongd

#update-swagger-docs: statik
# $(BINDIR)/statik -src=swagger/swagger-ui -dest=swagger -f -m
# @if [ -n "$(git status --porcelain)" ]; then \
# echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
# exit 1;\
# else \
# echo "\033[92mSwagger docs are in sync\033[0m";\
# fi

###############################################################################
### Localnet ###
###############################################################################

build-docker-go-bitsong:
$(MAKE) -C contrib/localnet

# Run a 4-node testnet locally
localnet-start: build-linux build-docker-bitsongdnode
@if ! [ -f build/node0/bitsongd/config/genesis.json ]; \
then docker run --rm -v $(CURDIR)/build:/bitsongd:Z bitsongofficial/bitsongdnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; \
fi
docker-compose up -d

# Stop testnet
localnet-stop:
docker-compose down

test-docker:
@docker build -f contrib/Dockerfile.test -t ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) .
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:latest

test-docker-push: test-docker
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD)
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker push ${TEST_DOCKER_REPO}:latest


########################################
Expand All @@ -192,76 +153,6 @@ clean:
distclean: clean
rm -rf vendor/

###############################################################################
### Protobuf ###
###############################################################################

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)

proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm --name $(containerProtoGen) \
-v $(CURDIR):/workspace \
--workdir /workspace \
$(containerProtoImage) sh ./scripts/protocgen.sh

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh

#proto-swagger-gen:
# @echo "Generating Protobuf Swagger"
# $(DOCKER) run --rm --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protoc-swagger-gen.sh

proto-format:
@echo "Formatting Protobuf files"
$(DOCKER) run --rm --name $(containerProtoFmt) \
--user $(shell id -u):$(shell id -g) \
-v $(CURDIR):/workspace \
--workdir /workspace \
tendermintdev/docker-build-proto find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;

proto-lint:
@$(DOCKER_BUF) lint --error-format=json

proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=master

GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
GOOGLE_PROTO_URL = https://raw.githubusercontent.com/googleapis/googleapis/master
REGEN_COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
COSMOS_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.4/proto/cosmos

GOGO_PROTO_TYPES = third_party/proto/gogoproto
GOOGLE_PROTO_TYPES = third_party/proto/google
REGEN_COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
COSMOS_PROTO_TYPES = third_party/proto/cosmos

proto-update-deps:
@mkdir -p $(GOGO_PROTO_TYPES)
@curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto

@mkdir -p $(GOOGLE_PROTO_TYPES)/api/
@curl -sSL $(GOOGLE_PROTO_URL)/google/api/annotations.proto > $(GOOGLE_PROTO_TYPES)/api/annotations.proto
@curl -sSL $(GOOGLE_PROTO_URL)/google/api/http.proto > $(GOOGLE_PROTO_TYPES)/api/http.proto

@mkdir -p $(REGEN_COSMOS_PROTO_TYPES)
@curl -sSL $(REGEN_COSMOS_PROTO_URL)/cosmos.proto > $(REGEN_COSMOS_PROTO_TYPES)/cosmos.proto

@mkdir -p $(COSMOS_PROTO_TYPES)/base/v1beta1/
@curl -sSL $(COSMOS_PROTO_URL)/base/v1beta1/coin.proto > $(COSMOS_PROTO_TYPES)/base/v1beta1/coin.proto

@mkdir -p $(COSMOS_PROTO_TYPES)/base/query/v1beta1/
@curl -sSL $(COSMOS_PROTO_URL)/base/query/v1beta1/pagination.proto > $(COSMOS_PROTO_TYPES)/base/query/v1beta1/pagination.proto

.PHONY: proto-all proto-gen proto-lint proto-check-breaking proto-update-deps

########################################
### Testing
Expand Down
Loading

0 comments on commit 5960e1c

Please sign in to comment.