Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.20.0 - CI Tests, Improved Scripts, Register ModuleBasic GRPC #239

Merged
merged 49 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2cd0d6f
remove versioning
Dec 3, 2024
bc7d4c8
refresh scripts, makefile, dockerfile,add basic e2e & pfm-e2e
Dec 3, 2024
74e41ce
bump config comments
Dec 3, 2024
069928d
add polytone e2e test
Dec 3, 2024
fb6a998
Merge pull request #5 from permissionlessweb/v0.18.2-patch
hard-nett Dec 4, 2024
f366d5a
improve genesis codec customization format, remove RandomGenesisAccou…
Dec 4, 2024
eb713e8
Merge pull request #6 from permissionlessweb/v0.18.2-patch
hard-nett Dec 4, 2024
f58a643
Merge pull request #240 from permissionlessweb/main
hard-nett Dec 4, 2024
1b53da4
slashing cli
Dec 4, 2024
8421f5a
replace cosmos-sdk with bitsong specific distirbution patch fork
Dec 4, 2024
d9de3f7
slashsing codec registry
Dec 5, 2024
75d7f84
docker bump, add v018 cosmos-sdk patch
Dec 5, 2024
f6ef09b
print results to new file
Dec 5, 2024
de600a5
Merge pull request #242 from permissionlessweb/slashed-delegators
hard-nett Dec 5, 2024
b1dc8ec
bump correct patch release
Dec 6, 2024
8d062b2
correct sdk patch
Dec 6, 2024
8d074ce
patch v18 slashing logic error
Dec 7, 2024
1ed4eff
bump sdk patch
Dec 7, 2024
f83725a
format cw-orchestrator into e2e test repo, add polytone msgs command
Dec 7, 2024
d9fcec9
Merge branch 'hard-nett/v0182' into slashed-delegators
hard-nett Dec 7, 2024
d2e6d82
Merge pull request #243 from permissionlessweb/slashed-delegators
hard-nett Dec 7, 2024
b844104
ci bump
Dec 9, 2024
d4a8654
ci bump
Dec 9, 2024
9a28744
revert token types to v114 in ictest
Dec 9, 2024
22d7694
coderabbit bumps
Dec 10, 2024
f145b2b
v19 upgrade handler
Dec 11, 2024
2a95e1a
delete replace cosmos-sdk, add v019 upgrade handler & logic
Dec 11, 2024
f018ac4
prep v019 cli helper
Dec 12, 2024
626a8c3
change to v20 upgrade
Dec 14, 2024
d1bfdc1
format to v020 upgrade
Dec 14, 2024
33e2bc6
Merge branch 'hard-nett/v0182' into hard-nett/v020-rc
hard-nett Dec 14, 2024
29db9ee
Merge pull request #245 from bitsongofficial/hard-nett/v020-rc
hard-nett Dec 14, 2024
fc33b65
register governance msg service router
Dec 14, 2024
a82d175
add legacy proposal context to gov proposal route
Dec 15, 2024
94c2c43
add gov legacy router
Dec 15, 2024
a29c91f
v020 upgrade
Dec 15, 2024
708b9a9
remove v020 from v019
Dec 15, 2024
38c1c89
TokensFromSharesTruncated
Dec 15, 2024
004e76f
bump comments
Dec 16, 2024
b0fb7b2
Merge pull request #246 from permissionlessweb/v019
hard-nett Dec 16, 2024
496fe23
Revert "V019"
hard-nett Dec 16, 2024
28141e5
Merge pull request #247 from bitsongofficial/revert-246-v019
hard-nett Dec 16, 2024
5391eed
Merge pull request #249 from permissionlessweb/v020
hard-nett Dec 16, 2024
d7cf1b5
Merge branch 'main' into hard-nett/v0182
Dec 16, 2024
763fa81
remove bin
Dec 16, 2024
b59b98b
remove v019 cli
Dec 16, 2024
6362e9f
bump cosmos-sdk v0.47.15 - ASA-2024-0012 patch
Dec 17, 2024
a12ce60
take into account multiple slashes
Dec 18, 2024
63db9c8
add changelog
Dec 18, 2024
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
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
Loading