Skip to content

Commit

Permalink
feat: upgrade to cosmos sdk v0.50 (#408)
Browse files Browse the repository at this point in the history
Co-authored-by: John Letey <[email protected]>
  • Loading branch information
boojamya and johnletey authored Oct 17, 2024
1 parent 56f08ad commit 61cd78c
Show file tree
Hide file tree
Showing 301 changed files with 7,320 additions and 190,267 deletions.
4 changes: 2 additions & 2 deletions .changelog/v4.1.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ It allows users to create a new account type, where the receipt of funds into
that account triggers an automatic IBC transfer over a specified channel to a
recipient address. This allows for one-click transfers to any IBC-enabled chain,
and can be used in tandem with, for example, the receipt of funds from a
[Circle Mint][mint] account or via [CCTP].
[Circle Mint][mint] account or via [CCTP][cctp-docs].

Other notable changes include are documented below.

[cctp]: https://www.circle.com/en/cross-chain-transfer-protocol
[cctp-docs]: https://www.circle.com/en/cross-chain-transfer-protocol
[mint]: https://www.circle.com/en/circle-mint
27 changes: 27 additions & 0 deletions .changelog/v8.0.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
*Oct 17, 2024*

This is the Helium major release of Noble. It upgrades the Noble's core
dependencies, namely CometBFT (f.k.a. Tendermint), Cosmos SDK, and IBC to their
latest stable release [Eden]. In addition to this upgrade, it also replaces the
legacy [ParamAuthority] module with an in-house build [Authority] module. This
module allows the Noble Maintenance Multisig to enact governance gated actions
like chain upgrades and IBC client substitutions.

The following modules have specifically been upgraded to Cosmos SDK `v0.50.x`

- [FiatTokenFactory] — Circle's USD Coin
- [CCTP] — Circle's Cross Chain Transfer Protocol
- [Aura] — Ondo's US Dollar Yield Token
- [Halo] — Hashnote's US Yield Coin
- [Florin] — Monerium's EUR emoney
- [Forwarding] — Noble's Intents System

[aura]: https://github.com/ondoprotocol/usdy-noble
[authority]: https://github.com/noble-assets/authority
[cctp]: https://github.com/circlefin/noble-cctp
[eden]: https://medium.com/the-interchain-foundation/elevating-the-cosmos-sdk-eden-v0-50-20a554e16e43
[florin]: https://github.com/monerium/module-noble
[forwarding]: https://github.com/noble-assets/forwarding
[halo]: https://github.com/noble-assets/halo
[fiattokenfactory]: https://github.com/circlefin/noble-fiattokenfactory
[paramauthority]: https://github.com/strangelove-ventures/paramauthority
16 changes: 0 additions & 16 deletions .github/mergify.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
id: set-matrix
run: |
# Run the command and convert its output to a JSON array
TESTS=$(cd interchaintest && go test -list . | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]')
TESTS=$(cd e2e && go test -list . | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT
test:
Expand Down Expand Up @@ -85,4 +85,4 @@ jobs:
run: docker image load -i ${{ env.TAR_PATH }}

- name: Run Tests
run: cd interchaintest && go test -race -v -timeout 30m -run ^${{ matrix.test }}$ .
run: cd e2e && go test -race -v -timeout 30m -run ^${{ matrix.test }}$ .
19 changes: 0 additions & 19 deletions .github/workflows/simulation-tests.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/unit-tests.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ release/
play_sh/
/heighliner*
bin/
build/
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# CHANGELOG

## v8.0.0

*Oct 17, 2024*

This is the Helium major release of Noble. It upgrades the Noble's core
dependencies, namely CometBFT (f.k.a. Tendermint), Cosmos SDK, and IBC to their
latest stable release [Eden]. In addition to this upgrade, it also replaces the
legacy [ParamAuthority] module with an in-house build [Authority] module. This
module allows the Noble Maintenance Multisig to enact governance gated actions
like chain upgrades and IBC client substitutions.

The following modules have specifically been upgraded to Cosmos SDK `v0.50.x`

- [FiatTokenFactory] — Circle's USD Coin
- [CCTP] — Circle's Cross Chain Transfer Protocol
- [Aura] — Ondo's US Dollar Yield Token
- [Halo] — Hashnote's US Yield Coin
- [Florin] — Monerium's EUR emoney
- [Forwarding] — Noble's Intents System

[aura]: https://github.com/ondoprotocol/usdy-noble
[authority]: https://github.com/noble-assets/authority
[cctp]: https://github.com/circlefin/noble-cctp
[eden]: https://medium.com/the-interchain-foundation/elevating-the-cosmos-sdk-eden-v0-50-20a554e16e43
[florin]: https://github.com/monerium/module-noble
[forwarding]: https://github.com/noble-assets/forwarding
[halo]: https://github.com/noble-assets/halo
[fiattokenfactory]: https://github.com/circlefin/noble-fiattokenfactory
[paramauthority]: https://github.com/strangelove-ventures/paramauthority

## v7.0.0

*Sep 13, 2024*
Expand Down Expand Up @@ -112,11 +142,11 @@ It allows users to create a new account type, where the receipt of funds into
that account triggers an automatic IBC transfer over a specified channel to a
recipient address. This allows for one-click transfers to any IBC-enabled chain,
and can be used in tandem with, for example, the receipt of funds from a
[Circle Mint][mint] account or via [CCTP].
[Circle Mint][mint] account or via [CCTP][cctp-docs].

Other notable changes include are documented below.

[cctp]: https://www.circle.com/en/cross-chain-transfer-protocol
[cctp-docs]: https://www.circle.com/en/cross-chain-transfer-protocol
[mint]: https://www.circle.com/en/circle-mint

### DEPENDENCIES
Expand Down
139 changes: 24 additions & 115 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,151 +1,60 @@
#!/usr/bin/make -f

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
# if VERSION is empty, then populate it with branch's name and raw commit hash
VERSION := $(shell git describe --exact-match 2>/dev/null)
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif

CHAIN_NAME = noble
DAEMON_NAME = nobled

LEDGER_ENABLED ?= true
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"
BUILDDIR ?= $(CURDIR)/build

export GO111MODULE = on

# process build tags

build_tags = netgo
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
ifeq ($(GCCEXE),)
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
else
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
ifeq ($(shell git status --porcelain),)
VERSION := $(BRANCH)
else
GCC = $(shell command -v gcc 2> /dev/null)
ifeq ($(GCC),)
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
VERSION := $(BRANCH)-dirty
endif
endif
endif

build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(CHAIN_NAME) \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(DAEMON_NAME) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)

ldflags += $(LDFLAGS)
ldflags := $(LDFLAGS)
ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=Noble \
-X github.com/cosmos/cosmos-sdk/version.AppName=nobled \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
ldflags := $(strip $(ldflags))

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


###############################################################################
### Building / Install ###
###############################################################################

all: install

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/nobled
@echo "🤖 Installing nobled..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/nobled
@echo "✅ Completed install!"

build:
go build $(BUILD_FLAGS) -o bin/nobled ./cmd/nobled

@echo "🤖 Building nobled..."
@go build -mod=readonly $(BUILD_FLAGS) -o "$(PWD)/build/" ./...
@echo "✅ Completed build!"

###############################################################################
### Linting ###
### Testing ###
###############################################################################

lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m



###############################################################################
### INTERCHAINTEST (ictest) ###
###############################################################################

test:
go test -v -race ./...

###############################################################################
### Build Image ###
###############################################################################
get-heighliner:
git clone https://github.com/strangelove-ventures/heighliner.git
cd heighliner && go install

local-image:
ifeq (,$(shell which heighliner))
echo 'heighliner' binary not found. Consider running `make get-heighliner`
echo 'heighliner' binary not found. Please install: https://github.com/strangelove-ventures/heighliner
else
heighliner build -c noble --local -f ./chains.yaml
heighliner build -c noble --local
endif

.PHONY: all build-linux install lint test \
go-mod-cache build interchaintest get-heighliner local-image \

###############################################################################
### Protobuf ###
### Linting ###
###############################################################################

BUF_VERSION=1.40

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

proto-format:
@echo "🤖 Running protobuf formatter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) format --diff --write
@echo "✅ Completed protobuf formatting!"

proto-gen:
@echo "🤖 Generating code from protobuf..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
noble-proto sh ./proto/generate.sh
@echo "✅ Completed code generation!"
lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m

proto-lint:
@echo "🤖 Running protobuf linter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) lint
@echo "✅ Completed protobuf linting!"

proto-setup:
@echo "🤖 Setting up protobuf environment..."
@docker build --rm --tag noble-proto:latest --file proto/Dockerfile .
@echo "✅ Setup protobuf environment!"
.PHONY: install build local-image lint
Loading

0 comments on commit 61cd78c

Please sign in to comment.