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

feat: add upgrade tests #35

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7d5ce83
feat: initial transition to cSDK Twilight
johnletey Apr 27, 2023
b8f8ab1
chore: work on upgrade logic
johnletey Apr 27, 2023
cfd5ee2
chore: small nits
johnletey Apr 27, 2023
9479c98
chore: small fixes
johnletey Apr 28, 2023
800d5f6
chore: add `interchaintest` dep
johnletey Apr 28, 2023
2efd2db
feat: add upgrade tests
johnletey Apr 30, 2023
cfffed1
chore: add workflow
johnletey Apr 30, 2023
b5c1a0d
chore: small fix
johnletey Apr 30, 2023
ef87996
chore: retrigger workflow
johnletey Apr 30, 2023
e3ad492
chore: small fix
johnletey Apr 30, 2023
61eb968
chore: speedup
johnletey Apr 30, 2023
f607e93
chore: migrate `MinInitialDepositRatio` param
johnletey May 6, 2023
fb59b73
chore: sync
johnletey May 6, 2023
db41bb8
chore: improve
johnletey May 6, 2023
ef22dae
chore: sync main
johnletey May 8, 2023
22f57c3
chore: switch to Heighliner images
johnletey May 9, 2023
1f1b7b5
chore: sync main
johnletey May 9, 2023
2fb6ed2
chore: sync
johnletey May 9, 2023
61d146a
chore: sync main
johnletey May 22, 2023
5126450
chore: sync
johnletey May 22, 2023
ed85bb9
chore: rename workflow
johnletey May 22, 2023
8475500
chore: sync main
johnletey Jun 9, 2023
1fdcb61
chore: include barberry resolution
johnletey Jun 9, 2023
fb55ea2
chore: sync
johnletey Jun 9, 2023
65a9079
chore: miscellaneous improvements
johnletey Jun 9, 2023
db0ec50
chore: merge main
shifty11 Sep 4, 2023
1052da2
chore: merge main
shifty11 Sep 6, 2023
f6a5eeb
chore: add protocol_inflation_share and pool_inflation_payout_rate
shifty11 Sep 7, 2023
b449d0b
chore: remove pfm store upgrade
shifty11 Sep 11, 2023
143bebe
Merge branch 'john/csdk-twilight' into john/interchaintest
shifty11 Sep 11, 2023
2d0210e
chore: update test settings
shifty11 Sep 11, 2023
1a8bf75
chore: update release version
shifty11 Sep 11, 2023
1fec835
Merge branch 'john/csdk-twilight' into john/interchaintest
shifty11 Sep 11, 2023
c6d7674
chore: update to cosmos-sdk v0.47.5
shifty11 Sep 12, 2023
d142366
chore: update to ibc-go to v7.3.0
shifty11 Sep 12, 2023
fb1c053
chore: add ibc-go upgrade
shifty11 Sep 12, 2023
b2ce356
chore: merge john/csdk-twilight
shifty11 Sep 12, 2023
b28e024
chore: change upgrade order
shifty11 Sep 12, 2023
8d6ba3d
chore: merge branch 'john/csdk-twilight' into john/interchaintest
shifty11 Sep 12, 2023
0970062
chore: update CHANGELOG.md
shifty11 Sep 12, 2023
5032f87
chore: tidy + changelog
mbreithecker Sep 25, 2023
50ace69
chore: change default team-constants to mainnet ones.
mbreithecker Sep 26, 2023
b6be235
fix: param upgrade migration
mbreithecker Sep 26, 2023
c3f0fde
chore: merge csdk-twilight
shifty11 Sep 26, 2023
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
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The KYVE Network

###### v1.3.1
###### v1.4.0

The KYVE consensus layer is the backbone of the KYVE ecosystem. This layer is a
sovereign Delegated Proof of Stake network built using the
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test Upgrades

on: pull_request

jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4

- name: Install Heighliner
run: make heighliner-setup
- name: Build Images
run: make heighliner

- name: Run Upgrade Tests
run: make test-upgrade
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

An '!' indicates a state machine breaking change.

## [Unreleased]

### Improvements

- (deps) [#33](https://github.com/KYVENetwork/chain/pull/33) Upgrade Cosmos SDK to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5) ([`v0.47.5-kyve`](https://github.com/KYVENetwork/cosmos-sdk/releases/tag/v0.47.5-kyve-rc0)).

## [v1.3.1](https://github.com/KYVENetwork/chain/releases/tag/v1.3.1) - 2023-08-02

### Bug Fixes
Expand Down
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
COMMIT := $(shell git log -1 --format='%H')
GO_VERSION := $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1,2)
VERSION := v1.3.1 # $(shell echo $(shell git describe --tags) | sed 's/^v//')
VERSION := v1.4.0 # $(shell echo $(shell git describe --tags) | sed 's/^v//')

TEAM_ALLOCATION := 165000000000000
ifeq ($(ENV),kaon)
Expand Down Expand Up @@ -32,7 +32,7 @@ ldflags := $(strip $(ldflags))
BUILD_FLAGS := -ldflags '$(ldflags)' -tags 'ledger' -trimpath

.PHONY: proto-setup proto-format proto-lint proto-gen \
format lint vet test build release dev
format lint vet test test-upgrade build release dev
all: ensure_environment ensure_version proto-all format lint test build

###############################################################################
Expand All @@ -44,7 +44,8 @@ build: ensure_environment ensure_version
@go build $(BUILD_FLAGS) -o "$(PWD)/build/" ./cmd/kyved
@echo "✅ Completed build!"

install: ensure_environment ensure_version
# TODO(@john): Figure out why the version check fails.
install: ensure_environment
@echo "🤖 Installing kyved..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/kyved
@echo "✅ Completed installation!"
Expand Down Expand Up @@ -155,11 +156,11 @@ proto-setup:

heighliner:
@echo "🤖 Building Kaon image..."
@heighliner build --chain kaon --local 1> /dev/null
@heighliner build --chain kaon --local
@echo "✅ Completed build!"

@echo "🤖 Building KYVE image..."
@heighliner build --chain kyve --local 1> /dev/null
@heighliner build --chain kyve --local
@echo "✅ Completed build!"

heighliner-setup:
Expand All @@ -173,3 +174,8 @@ test:
@echo "🤖 Running tests..."
@go test -cover -mod=readonly ./x/...
@echo "✅ Completed tests!"

test-upgrade:
@echo "🤖 Running upgrade tests..."
@go test -cover -mod=readonly ./app/upgrades/...
@echo "✅ Completed upgrade tests!"
20 changes: 7 additions & 13 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ import (
// Global
"github.com/KYVENetwork/chain/x/global"
globalKeeper "github.com/KYVENetwork/chain/x/global/keeper"
// Gov
govKeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
// IBC
ibcAnte "github.com/cosmos/ibc-go/v6/modules/core/ante"
ibcKeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
// IBC Core
ibcAnte "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibcKeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
// Staking
stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
)

// https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/x/auth/ante/ante.go#L25
// https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/auth/ante/ante.go#L25

func NewAnteHandler(
accountKeeper authKeeper.AccountKeeper,
bankKeeper bankKeeper.Keeper,
feeGrantKeeper feeGrantKeeper.Keeper,
globalKeeper globalKeeper.Keeper,
govKeeper govKeeper.Keeper,
ibcKeeper *ibcKeeper.Keeper,
stakingKeeper stakingKeeper.Keeper,
sigGasConsumer ante.SignatureVerificationGasConsumer,
Expand All @@ -40,8 +37,6 @@ func NewAnteHandler(

gasAdjustmentDecorator := global.NewGasAdjustmentDecorator(globalKeeper)

initialDepositDecorator := global.NewInitialDepositDecorator(globalKeeper, govKeeper)

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
gasAdjustmentDecorator,
Expand All @@ -57,7 +52,6 @@ func NewAnteHandler(
ante.NewSigVerificationDecorator(accountKeeper, signModeHandler),
ante.NewIncrementSequenceDecorator(accountKeeper),
ibcAnte.NewRedundantRelayDecorator(ibcKeeper),
initialDepositDecorator,
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand All @@ -69,12 +63,12 @@ func NewPostHandler(
bankKeeper bankKeeper.Keeper,
feeGrantKeeper feeGrantKeeper.Keeper,
globalKeeper globalKeeper.Keeper,
) (sdk.AnteHandler, error) {
) (sdk.PostHandler, error) {
refundFeeDecorator := global.NewRefundFeeDecorator(bankKeeper, feeGrantKeeper, globalKeeper)

postDecorators := []sdk.AnteDecorator{
postDecorators := []sdk.PostDecorator{
refundFeeDecorator,
}

return sdk.ChainAnteDecorators(postDecorators...), nil
return sdk.ChainPostDecorators(postDecorators...), nil
}
Loading
Loading