Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into mbreithecker/cosmos-sdk-v0.50.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreithecker committed Jun 7, 2024
2 parents 5a64892 + 1d0f1a6 commit 7659c7c
Show file tree
Hide file tree
Showing 26 changed files with 744 additions and 328 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,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
4 changes: 2 additions & 2 deletions app/upgrades/v1_5/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func MigrateFundersModule(sdkCtx sdk.Context, cdc codec.Codec, fundersStoreKey s
CoinWhitelist: []*fundersTypes.WhitelistCoinEntry{
{
CoinDenom: globalTypes.Denom,
MinFundingAmount: oldParams.MinFundingAmount,
MinFundingAmountPerBundle: oldParams.MinFundingAmountPerBundle,
MinFundingAmount: math.NewIntFromUint64(oldParams.MinFundingAmount),
MinFundingAmountPerBundle: math.NewIntFromUint64(oldParams.MinFundingAmountPerBundle),
CoinWeight: math.LegacyMustNewDecFromStr("0.06"),
},
},
Expand Down
171 changes: 70 additions & 101 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,49 @@ build:
- third_party/proto
- proto_vendor
accounts:
- name: dummy
- name: dummy # kyve137v27tfyegc083w5kj9zhhrfk34n8vhjma73gq
coins:
- 1000000tkyve # 1 tkyve -> 6 decimals
mnemonic: expect crisp umbrella hospital firm exhibit future size slot update blood
deliver fat happy ghost visa recall usual path purity junior ring ordinary stove
- name: alice
- name: alice # kyve1jq304cthpx0lwhpqzrdjrcza559ukyy3zsl2vd
coins:
- 2000000000000000tkyve
- 1000000000acoin # 1000 acoins -> 6 decimals
- 1000000000000bcoin # 1000 bcoins -> 9 decimals
- 1000000000ccoin # 1000 ccoins -> 6 decimals
- 2000000000000tkyve # 2M tkyve -> 6 decimals
mnemonic: worry grief loyal smoke pencil arrow trap focus high pioneer tomato hedgehog
essence purchase dove pond knee custom phone gentle sunset addict mother fabric
- name: bob
- name: bob # kyve1hvg7zsnrj6h29q9ss577mhrxa04rn94h7zjugq
coins:
- 1000000000000000tkyve
- 1000000000acoin # 1000 acoins -> 6 decimals
- 1000000000000bcoin # 1000 bcoins -> 9 decimals
- 1000000000ccoin # 1000 ccoins -> 6 decimals
- 1000000000000tkyve # 1M tkyve -> 6 decimals
mnemonic: crash sick toilet stumble join cash erode glory door weird diagram away
lizard solid segment apple urge joy annual able tank define candy demise
- name: charlie
- name: charlie #kyve1ay22rr3kz659fupu0tcswlagq4ql6rwm4nuv0s
coins:
- 1000000000000000tkyve
- 1000000000acoin # 1000 acoins -> 6 decimals
- 1000000000000bcoin # 1000 bcoins -> 9 decimals
- 1000000000ccoin # 1000 ccoins -> 6 decimals
- 1000000000000tkyve # 1M tkyve -> 6 decimals
mnemonic: shoot inject fragile width trend satisfy army enact volcano crowd message
strike true divorce search rich office shoulder sport relax rhythm symbol gadget
size
- name: faucet
- name: faucet # kyve1kahmjds2rxj2qzamdvy5m8ljnkqrf5xhetes7q
coins:
- 1000000000000000tkyve
- 1000000000000tkyve # 1M tkyve -> 6 decimals
mnemonic: open home share route party lake room solution quantum pact model avocado
humor dilemma review desert turtle total humor produce rate keen eagle fee
- name: foundation
- name: foundation # kyve1fd4qu868n7arav8vteghcppxxa0p2vna5f5ep8
coins:
# for fees
- 1000000tkyve
# address: kyve1fd4qu868n7arav8vteghcppxxa0p2vna5f5ep8
- 1000000tkyve # 1 tkyve -> 6 decimals
mnemonic: evidence taxi material cabin annual phrase practice unhappy safe jealous
section drink illness panther bread aim mouse dolphin deliver ready doll finger search cheap
- name: foundation_inflation
- name: foundation_inflation # kyve1tuxsc7ez79aydyee86qxm05zyx0l7d78c2zzsn
coins:
# for fees
- 1000000tkyve
# address: kyve1tuxsc7ez79aydyee86qxm05zyx0l7d78c2zzsn
- 1000000tkyve # 1 tkyve -> 6 decimals
mnemonic: hold urge sustain chef furnace foam oven fall harsh core anchor during crew secret
craft rhythm choose gold soft aisle sort phrase enter orphan
faucet:
Expand All @@ -61,20 +68,16 @@ genesis:
coins:
- denom: "tkyve"
amount: "165000000000000000"
- address: "kyve1vg5325u5mat0y44g73n8t8z2le26fsa4n947f5" # funders module
coins:
- denom: "tkyve"
amount: "5300000000000000"
supply:
- denom: "tkyve"
amount: "170300000000000000" # all balances together
amount: "165000000000000000"
delegation:
params:
unbonding_delegation_time: 10
global:
params:
burn_ratio: "0.5"
min_gas_price: "1"
min_gas_price: "0.02"
gov:
params:
voting_period: 120s
Expand Down Expand Up @@ -134,55 +137,30 @@ genesis:
commencement: "1647212400"
pool:
params:
protocol_inflation_share: "0.04"
pool_count: "2"
protocol_inflation_share: "0.1"
max_voting_power_per_pool: "1"
pool_count: "1"
pool_list:
- config: "{\"network\":\"kyve-1\",\"rpc\":\"https://rpc-eu-1.kyve.network\"}"
- config: "{\"network\":\"kyve-1\",\"rpc\":\"https://rpc.kyve.network\"}"
current_compression_id: "1"
current_index: "0"
current_key: ""
current_storage_provider_id: "1"
current_storage_provider_id: "3"
current_summary: ""
id: "0"
logo: ""
logo: "ar://WOiYR7qF7G_dp6eO0bFC7AorS7601qgek3X_IeAZook"
max_bundle_size: "100"
min_delegation: "100000000000"
name: "KYVE // Mainnet"
inflation_share_weight: "2500000000"
min_delegation: "100000000"
name: "KYVE"
inflation_share_weight: "1"
disabled: false
runtime: '@kyvejs/tendermint-bsync'
runtime: '@kyvejs/tendermint'
start_key: "1"
total_bundles: "0"
upload_interval: "60"
protocol:
version: "1.0.0"
binaries: "{\"kyve-linux-arm64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-linux-arm64.zip\",\"kyve-linux-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-linux-x64.zip\",\"kyve-macos-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-macos-x64.zip\"}"
last_upgrade: "0"
upgrade_plan:
version: ""
binaries: ""
scheduled_at: "0"
duration: "0"
- config: "{\"network\":\"kyve-1\",\"rpc\":\"https://rpc-eu-1.kyve.network\"}"
current_compression_id: "1"
current_index: "0"
current_key: ""
current_storage_provider_id: "1"
current_summary: ""
id: "1"
logo: ""
max_bundle_size: "100"
min_delegation: "100000000000"
name: "KYVE // Blub"
inflation_share_weight: "2500000000"
disabled: false
runtime: '@kyvejs/tendermint-bsync'
start_key: "1"
total_bundles: "0"
upload_interval: "60"
protocol:
version: "1.0.0"
binaries: "{\"kyve-linux-arm64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-linux-arm64.zip\",\"kyve-linux-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-linux-x64.zip\",\"kyve-macos-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.0.0/kyve-macos-x64.zip\"}"
version: "1.1.6"
binaries: "{\"kyve-linux-arm64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-linux-arm64.zip\",\"kyve-linux-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-linux-x64.zip\",\"kyve-macos-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-macos-x64.zip\"}"
last_upgrade: "0"
upgrade_plan:
version: ""
Expand All @@ -195,63 +173,54 @@ genesis:
staking:
params:
bond_denom: tkyve
bundles:
params:
storage_costs:
- storage_provider_id: "3"
cost: "0.000000006288"
funders:
params:
min_funding_multiple: 10
coin_whitelist:
- coin_denom: "tkyve"
min_funding_amount: "10000000"
min_funding_amount_per_bundle: "1000000"
coin_weight: "0.055"
- coin_denom: "acoin"
min_funding_amount: "10000000"
min_funding_amount_per_bundle: "1000000"
coin_weight: "10.3"
- coin_denom: "bcoin"
min_funding_amount: "10000000000"
min_funding_amount_per_bundle: "1000000000"
coin_weight: "0.095"
- coin_denom: "ccoin"
min_funding_amount: "10000000"
min_funding_amount_per_bundle: "1000000"
coin_weight: "0.86"
funder_list:
- address: "kyve1jq304cthpx0lwhpqzrdjrcza559ukyy3zsl2vd"
contact: "https://twitter.com/kyvenetwork"
moniker: "Alice"
description: "Alice is the first funder of the KYVE network."
website: "https://kyve.network"
identity: "0657A086E5201562"
- address: "kyve1ze3ncmkvat3t2mcj9e3uy8uktat4fq2vltcnat"
- address: "kyve1hvg7zsnrj6h29q9ss577mhrxa04rn94h7zjugq"
contact: "https://twitter.com/kyvenetwork"
moniker: "Otto"
description: "Another funder of the KYVE network."
website: "https://ot.to"
moniker: "Bob"
description: "Bob is the second funder of the KYVE network."
website: "https://kyve.network"
identity: "0657A086E5201562"
funding_list:
- pool_id: 0
funder_address: "kyve1jq304cthpx0lwhpqzrdjrcza559ukyy3zsl2vd"
amounts:
- denom: tkyve
amount: "5000000000000"
amounts_per_bundle:
- denom: tkyve
amount: "230000000"
total_funded:
- denom: tkyve
amount: "2200400000000"
- pool_id: 0
funder_address: "kyve1ze3ncmkvat3t2mcj9e3uy8uktat4fq2vltcnat"
amounts:
- denom: tkyve
amount: "200000000000"
amounts_per_bundle:
- denom: tkyve
amount: "20000000"
total_funded:
- denom: tkyve
amount: "64500000000"
- pool_id: 1
funder_address: "kyve1ze3ncmkvat3t2mcj9e3uy8uktat4fq2vltcnat"
amounts:
- denom: tkyve
amount: "100000000000"
amounts_per_bundle:
- denom: tkyve
amount: "10000000"
total_funded:
- denom: tkyve
amount: "23000000000"
funding_list: []
funding_state_list:
- pool_id: 0
active_funder_addresses: [ "kyve1jq304cthpx0lwhpqzrdjrcza559ukyy3zsl2vd", "kyve1ze3ncmkvat3t2mcj9e3uy8uktat4fq2vltcnat" ]
- pool_id: 1
active_funder_addresses: [ "kyve1ze3ncmkvat3t2mcj9e3uy8uktat4fq2vltcnat" ]
active_funder_addresses: []
chain_id: kyve-local
validators:
- name: alice
bonded: 1000000000000tkyve
app:
minimum-gas-prices: "0.02tkyve"
config:
consensus:
timeout_commit: "2s"
Expand Down
16 changes: 12 additions & 4 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4747,22 +4747,30 @@ paths:
to be funded, this value

needs to be unique
coin_decimals:
type: integer
format: int64
title: coin_decimals are the decimals of the coin
min_funding_amount:
type: string
format: uint64
title: >-
min_funding_amount is the minimum required amount of
this denom that needs

to be funded
to be funded. It is of type math.Int since a uint64
is not sufficient for a

coin with 18 decimals
min_funding_amount_per_bundle:
type: string
format: uint64
title: >-
min_funding_amount_per_bundle is the minimum
required amount of this denom

that needs to be funded per bundle
that needs to be funded per bundle. It is of type
math.Int since a uint64

is not sufficient for a coin with 18 decimals
coin_weight:
type: string
description: >-
Expand Down
20 changes: 15 additions & 5 deletions proto/kyve/funders/v1beta1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ message WhitelistCoinEntry {
// coin_denom is the denom of a coin which is allowed to be funded, this value
// needs to be unique
string coin_denom = 1;
// coin_decimals are the decimals of the coin
uint32 coin_decimals = 2;
// min_funding_amount is the minimum required amount of this denom that needs
// to be funded
uint64 min_funding_amount = 2;
// to be funded. It is of type math.Int since a uint64 is not sufficient for a
// coin with 18 decimals
string min_funding_amount = 3 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
// min_funding_amount_per_bundle is the minimum required amount of this denom
// that needs to be funded per bundle
uint64 min_funding_amount_per_bundle = 3;
// that needs to be funded per bundle. It is of type math.Int since a uint64
// is not sufficient for a coin with 18 decimals
string min_funding_amount_per_bundle = 4 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
// coin_weight is a factor used to sort funders after their funding amounts.
// This should be the market price of the coin in USD/coin. This value should be kept up-to-date.
string coin_weight = 4 [
string coin_weight = 5 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
Expand Down
12 changes: 12 additions & 0 deletions testutil/integration/helpers.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
package integration

import (
"fmt"

"cosmossdk.io/math"

globalTypes "github.com/KYVENetwork/chain/x/global/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (suite *KeeperTestSuite) MustNewIntFromStr(amount string) math.Int {
result, ok := math.NewIntFromString(amount)
if !ok {
panic(fmt.Sprintf("error parsing \"%s\" to math.Int", amount))
}
return result
}

func (suite *KeeperTestSuite) GetCoinsFromCommunityPool() sdk.Coins {
pool, err := suite.App().DistributionKeeper.FeePool.Get(suite.Ctx())
if err != nil {
Expand Down
23 changes: 23 additions & 0 deletions testutil/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,29 @@ func (suite *KeeperTestSuite) MintCoins(address string, amount uint64) error {
return nil
}

func (suite *KeeperTestSuite) MintCoin(address string, coin sdk.Coin) error {
// mint coins ukyve, A, B, C
coins := sdk.NewCoins(coin)
err := suite.app.BankKeeper.MintCoins(suite.ctx, mintTypes.ModuleName, coins)
if err != nil {
return err
}

suite.Commit()

receiver, err := sdk.AccAddressFromBech32(address)
if err != nil {
return err
}

err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, mintTypes.ModuleName, receiver, coins)
if err != nil {
return err
}

return nil
}

func (suite *KeeperTestSuite) MintDenomToModule(moduleAddress string, amount uint64, denom string) error {
coins := sdk.NewCoins(sdk.NewInt64Coin(denom, int64(amount)))
err := suite.app.BankKeeper.MintCoins(suite.ctx, mintTypes.ModuleName, coins)
Expand Down
Loading

0 comments on commit 7659c7c

Please sign in to comment.