Skip to content

Commit

Permalink
Merge branch 'main' into troy/fix-bundle-response
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Jun 7, 2024
2 parents 68eeeed + 9e581bb commit f62e56c
Show file tree
Hide file tree
Showing 157 changed files with 63,891 additions and 3,696 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,31 @@ An '!' indicates a state machine breaking change.

## [Unreleased]

### Features

- ! (`x/stakers`) [#185](https://github.com/KYVENetwork/chain/pull/185) Support multiple coins in stakers module.
- ! (`x/bundles`) [#184](https://github.com/KYVENetwork/chain/pull/184) Support multiple coins in bundles module.
- ! (`x/funders`) [#179](https://github.com/KYVENetwork/chain/pull/179) Support multiple coins for funding.
- ! (`x/bundles`) [#177](https://github.com/KYVENetwork/chain/pull/177) Add end-key to pool.
- ! (`x/bundles`) [#178](https://github.com/KYVENetwork/chain/pull/178) Tally bundle proposal on timeout.
- ! (`x/delegation`) [#176](https://github.com/KYVENetwork/chain/pull/176) Support multiple denoms for delegation rewards.
- ! (`x/bundles`) [#172](https://github.com/KYVENetwork/chain/pull/172) Storage-cost per storage-provider.
- ! (`x/bundles`) [#175](https://github.com/KYVENetwork/chain/pull/175) Tally bundle proposal on skip-uploader-role.

### Improvements

- (deps) [#197](https://github.com/KYVENetwork/chain/pull/197) Bump to CosmosSDK v0.50.7
- ! (`x/pool`) [#190](https://github.com/KYVENetwork/chain/pull/190) Make inflation-share-weight a decimal.
- [#182](https://github.com/KYVENetwork/chain/pull/182) Make release builds reproducible.
- ! [#183](https://github.com/KYVENetwork/chain/pull/183) Only charge coins which are whitelisted.
- ! (deps) [#174](https://github.com/KYVENetwork/chain/pull/174) Add mainnet KYVE image to interchain tests.
- ! (deps) [#171](https://github.com/KYVENetwork/chain/pull/171) Bump ibc version to v8.2.0 and remove unnecessary dev-dependency.
- ! (deps) [#169](https://github.com/KYVENetwork/chain/pull/169) Migrate to Cosmos-SDK v0.50
- (deps) [#161](https://github.com/KYVENetwork/chain/pull/161) Bump ibc packet forward middleware.

### Bug Fixes

- [#192](https://github.com/KYVENetwork/chain/pull/192) fix: Cosmos-SDK & IBC swagger-code generation.
- (`x/query`) [#159](https://github.com/KYVENetwork/chain/pull/159) Add pool params back to kyve params query.
- (`x/query`) [#160](https://github.com/KYVENetwork/chain/pull/160) Add funders back to pool query.
- [#163](https://github.com/KYVENetwork/chain/pull/163) Add back swagger UI for KYVE and Cosmos REST queries.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG IMG_TAG=latest

# Compile the kyved binary
FROM golang:1.22-alpine AS kyved-builder
FROM golang:1.22.3-alpine AS kyved-builder

# Install make
RUN apk add --no-cache make
Expand Down
47 changes: 26 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ GO_VERSION := $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1,2)
# VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
VERSION := v1.5.0

BUILD_TIME := 202405060800.00 # format [[CC]YY]MMDDhhmm[.ss]

TEAM_ALLOCATION := 165000000000000
ifeq ($(ENV),kaon)
$(info 📑 Using Kaon environment...)
Expand Down Expand Up @@ -31,7 +33,7 @@ ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=kyve \
-X github.com/KYVENetwork/chain/x/team/types.TGE_STRING=$(TEAM_TGE)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -ldflags '$(ldflags)' -tags 'ledger' -trimpath
BUILD_FLAGS := -ldflags '$(ldflags)' -tags 'ledger' -trimpath -buildvcs=false

.PHONY: proto-setup proto-format proto-lint proto-gen \
format lint vet test build release dev interchaintest
Expand All @@ -52,28 +54,24 @@ install: ensure_environment ensure_version
@echo "✅ Completed installation!"

release: ensure_environment ensure_version
@echo "🤖 Creating kyved releases..."
@echo "🤖 Creating kyved releases (using timestamp $(BUILD_TIME))..."
@rm -rf release
@mkdir -p release

@GOOS=darwin GOARCH=amd64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_darwin_amd64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_darwin_amd64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=darwin GOARCH=arm64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_darwin_arm64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_darwin_arm64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=linux GOARCH=amd64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_linux_amd64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_linux_amd64.tar.gz >> release/release_$(ENV)_checksum

@GOOS=linux GOARCH=arm64 go build $(BUILD_FLAGS) ./cmd/kyved
@tar -czf release/kyved_$(ENV)_linux_arm64.tar.gz kyved
@sha256sum release/kyved_$(ENV)_linux_arm64.tar.gz >> release/release_$(ENV)_checksum

@rm kyved
@echo "✅ Completed release creation!"
@for b in darwin:amd64 darwin:arm64 linux:amd64 linux:arm64; do \
os=$$(echo $$b | cut -d':' -f1); \
arch=$$(echo $$b | cut -d':' -f2); \
echo "➡️ "$$os" "$$arch""; \
CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch go build $(BUILD_FLAGS) -o release/kyved_$(ENV)_"$$os"_"$$arch" ./cmd/kyved; \
touch -a -m -t $(BUILD_TIME) release/kyved_$(ENV)_"$$os"_"$$arch"; \
sha256sum release/kyved_$(ENV)_"$$os"_"$$arch" >> release/release_$(ENV)_checksum; \
tar -C release -cf release/kyved_$(ENV)_"$$os"_"$$arch".tar kyved_$(ENV)_"$$os"_"$$arch"; \
touch -a -m -t $(BUILD_TIME) release/kyved_$(ENV)_"$$os"_"$$arch".tar; \
gzip release/kyved_$(ENV)_"$$os"_"$$arch".tar; \
sha256sum release/kyved_$(ENV)_"$$os"_"$$arch".tar.gz >> release/release_$(ENV)_checksum; \
done

@echo "✅ Completed release creation!"

###############################################################################
### Docker Build ###
Expand Down Expand Up @@ -126,6 +124,9 @@ endif
dev:
@ignite chain serve --reset-once --skip-proto --verbose

dev-continue:
@ignite chain serve --skip-proto --verbose

###############################################################################
### Formatting & Linting ###
###############################################################################
Expand Down Expand Up @@ -159,7 +160,11 @@ proto-format:

proto-gen:
@echo "🤖 Generating code from protobuf..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
@docker run --rm \
--volume "$(PWD)":/workspace `# Mount this repo as workspace` \
--volume "$$(go list -m -f '{{.Dir}}' github.com/cosmos/cosmos-sdk)":/cosmos-sdk:ro `# Mount cosmos-sdk from installed go modules` \
--volume "$$(go list -m -f '{{.Dir}}' github.com/cosmos/ibc-go/v8)":/ibc:ro `# Mount ibc-go from installed go modules` \
--workdir /workspace \
kyve-proto sh ./proto/generate.sh
@echo "✅ Completed code generation!"

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# The KYVE Network

###### v1.4.0
###### v1.5.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
[Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and
[CometBFT (BFT Consensus)](https://github.com/cometbft/cometbft).

The main branch always contains the latest commits during development.
Check out the `/release/v1.x.x` branches for stable releases.

## Building from source

```shell
Expand Down
23 changes: 9 additions & 14 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ import (
_ "github.com/cosmos/ibc-go/modules/capability" // import for side-effects
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
_ "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" // import for side-effects
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
_ "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" // import for side-effects
ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
_ "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" // import for side-effects
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

Expand Down Expand Up @@ -137,18 +134,13 @@ type App struct {
GroupKeeper groupkeeper.Keeper

// IBC
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
CapabilityKeeper *capabilitykeeper.Keeper
IBCFeeKeeper ibcfeekeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
IBCTransferKeeper ibctransferkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
CapabilityKeeper *capabilitykeeper.Keeper
IBCTransferKeeper ibctransferkeeper.Keeper

// Scoped IBC
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper

// KYVE
BundlesKeeper bundleskeeper.Keeper
Expand Down Expand Up @@ -416,6 +408,9 @@ func New(
app.appCodec,
app.GetStoreKeys(),
app.BundlesKeeper,
app.DelegationKeeper,
app.FundersKeeper,
app.StakersKeeper,
app.PoolKeeper,
),
)
Expand Down
12 changes: 0 additions & 12 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
"google.golang.org/protobuf/types/known/durationpb"
Expand Down Expand Up @@ -91,8 +89,6 @@ var (
evidencetypes.ModuleName,
authz.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
Expand Down Expand Up @@ -135,8 +131,6 @@ var (
capabilitytypes.ModuleName,
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,

// KYVE modules
delegationtypes.ModuleName,
Expand All @@ -156,8 +150,6 @@ var (
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
capabilitytypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,

// KYVE modules
pooltypes.ModuleName,
Expand All @@ -184,8 +176,6 @@ var (

// IBC
{Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
{Account: ibcfeetypes.ModuleName},
{Account: icatypes.ModuleName},

// KYVE
{Account: bundlestypes.ModuleName},
Expand All @@ -207,8 +197,6 @@ var (

// IBC
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
icatypes.ModuleName,

// KYVE
bundlestypes.ModuleName,
Expand Down
72 changes: 3 additions & 69 deletions app/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ import (
"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
icamodule "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee"
ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
Expand All @@ -44,9 +33,6 @@ func (app *App) registerIBCModules() {
storetypes.NewKVStoreKey(capabilitytypes.StoreKey),
storetypes.NewKVStoreKey(ibcexported.StoreKey),
storetypes.NewKVStoreKey(ibctransfertypes.StoreKey),
storetypes.NewKVStoreKey(ibcfeetypes.StoreKey),
storetypes.NewKVStoreKey(icahosttypes.StoreKey),
storetypes.NewKVStoreKey(icacontrollertypes.StoreKey),
storetypes.NewMemoryStoreKey(capabilitytypes.MemStoreKey),
storetypes.NewTransientStoreKey(paramstypes.TStoreKey),
); err != nil {
Expand All @@ -58,8 +44,6 @@ func (app *App) registerIBCModules() {
keyTable.RegisterParamSet(&ibcconnectiontypes.Params{})
app.ParamsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
app.ParamsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
app.ParamsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())
app.ParamsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable())

// add capability keeper and ScopeToModule for ibc module
app.CapabilityKeeper = capabilitykeeper.NewKeeper(
Expand All @@ -71,8 +55,6 @@ func (app *App) registerIBCModules() {
// add capability keeper and ScopeToModule for ibc module
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedIBCTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)

// Create IBC keeper
app.IBCKeeper = ibckeeper.NewKeeper(
Expand All @@ -92,19 +74,12 @@ func (app *App) registerIBCModules() {
govRouter := govv1beta1.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler)

app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
app.appCodec, app.GetKey(ibcfeetypes.StoreKey),
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
)

// Create IBC transfer keeper
app.IBCTransferKeeper = ibctransferkeeper.NewKeeper(
app.appCodec,
app.GetKey(ibctransfertypes.StoreKey),
app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCFeeKeeper,
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
app.AccountKeeper,
Expand All @@ -113,65 +88,26 @@ func (app *App) registerIBCModules() {
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// Create interchain account keepers
app.ICAHostKeeper = icahostkeeper.NewKeeper(
app.appCodec,
app.GetKey(icahosttypes.StoreKey),
app.GetSubspace(icahosttypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
app.AccountKeeper,
scopedICAHostKeeper,
app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
app.appCodec,
app.GetKey(icacontrollertypes.StoreKey),
app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
scopedICAControllerKeeper,
app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.GovKeeper.SetLegacyRouter(govRouter)

// Create IBC modules with ibcfee middleware
transferIBCModule := ibcfee.NewIBCMiddleware(ibctransfer.NewIBCModule(app.IBCTransferKeeper), app.IBCFeeKeeper)

// integration point for custom authentication modules
var noAuthzModule porttypes.IBCModule
icaControllerIBCModule := ibcfee.NewIBCMiddleware(
icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper),
app.IBCFeeKeeper,
)

icaHostIBCModule := ibcfee.NewIBCMiddleware(icahost.NewIBCModule(app.ICAHostKeeper), app.IBCFeeKeeper)
transferIBCModule := ibctransfer.NewIBCModule(app.IBCTransferKeeper)

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)
AddRoute(ibctransfertypes.ModuleName, transferIBCModule)

// this line is used by starport scaffolding # ibc/app/module

app.IBCKeeper.SetRouter(ibcRouter)

app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedIBCTransferKeeper = scopedIBCTransferKeeper
app.ScopedICAHostKeeper = scopedICAHostKeeper
app.ScopedICAControllerKeeper = scopedICAControllerKeeper

// register IBC modules
if err := app.RegisterModules(
ibc.NewAppModule(app.IBCKeeper),
ibctransfer.NewAppModule(app.IBCTransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
icamodule.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
capability.NewAppModule(app.appCodec, *app.CapabilityKeeper, false),
ibctm.AppModule{},
solomachine.AppModule{},
Expand All @@ -187,8 +123,6 @@ func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppMo
modules := map[string]appmodule.AppModule{
ibcexported.ModuleName: ibc.AppModule{},
ibctransfertypes.ModuleName: ibctransfer.AppModule{},
ibcfeetypes.ModuleName: ibcfee.AppModule{},
icatypes.ModuleName: icamodule.AppModule{},
capabilitytypes.ModuleName: capability.AppModule{},
ibctm.ModuleName: ibctm.AppModule{},
solomachine.ModuleName: solomachine.AppModule{},
Expand Down
Loading

0 comments on commit f62e56c

Please sign in to comment.