@@ -4,6 +4,10 @@ import (
44 "context"
55 "fmt"
66
7+ bundlestypes "github.com/KYVENetwork/chain/x/bundles/types"
8+ funderskeeper "github.com/KYVENetwork/chain/x/funders/keeper"
9+ funderstypes "github.com/KYVENetwork/chain/x/funders/types"
10+
711 poolTypes "github.com/KYVENetwork/chain/x/pool/types"
812
913 poolkeeper "github.com/KYVENetwork/chain/x/pool/keeper"
@@ -57,6 +61,7 @@ func CreateUpgradeHandler(
5761 multiCoinRewardsKeeper multicoinrewardskeeper.Keeper ,
5862 poolKeeper * poolkeeper.Keeper ,
5963 distrKeeper * distrkeeper.Keeper ,
64+ fundersKeeper funderskeeper.Keeper ,
6065) upgradetypes.UpgradeHandler {
6166 return func (ctx context.Context , plan upgradetypes.Plan , fromVM module.VersionMap ) (module.VersionMap , error ) {
6267 sdkCtx := sdk .UnwrapSDKContext (ctx )
@@ -84,7 +89,7 @@ func CreateUpgradeHandler(
8489 UpgradeRuntimes (sdkCtx , poolKeeper )
8590 UpdateUploadIntervals (sdkCtx , poolKeeper )
8691
87- // TODO: update coin weights and storage cost for mainnet
92+ UpdateCoinWeights ( sdkCtx , bundlesKeeper , fundersKeeper )
8893
8994 // Set MultiCoinRewards and Withdraw address for the KYVE Foundation
9095 if sdkCtx .ChainID () == "kyve-1" {
@@ -99,6 +104,79 @@ func CreateUpgradeHandler(
99104 }
100105}
101106
107+ func UpdateCoinWeights (ctx sdk.Context , bundlesKeeper bundleskeeper.Keeper , fundersKeeper funderskeeper.Keeper ) {
108+ bundlesParams , err := bundlesKeeper .BundlesParams .Get (ctx )
109+ if err != nil {
110+ panic (err )
111+ }
112+
113+ bundlesParams .StorageCosts = []bundlestypes.StorageCost {
114+ {StorageProviderId : 1 , Cost : math .LegacyMustNewDecFromStr ("0.00000001633" )},
115+ {StorageProviderId : 2 , Cost : math .LegacyMustNewDecFromStr ("0.00000003071" )},
116+ {StorageProviderId : 3 , Cost : math .LegacyMustNewDecFromStr ("0" )},
117+ {StorageProviderId : 4 , Cost : math .LegacyMustNewDecFromStr ("0.00000001898" )},
118+ }
119+
120+ err = bundlesKeeper .BundlesParams .Set (ctx , bundlesParams )
121+ if err != nil {
122+ panic (err )
123+ }
124+
125+ fundersParams := fundersKeeper .GetParams (ctx )
126+ fundersParams .CoinWhitelist = []* funderstypes.WhitelistCoinEntry {
127+ {
128+ // KYVE
129+ CoinDenom : "ukyve" ,
130+ CoinDecimals : 6 ,
131+ MinFundingAmount : math .NewInt (100_000_000 ),
132+ MinFundingAmountPerBundle : math .NewInt (100_000 ),
133+ CoinWeight : math .LegacyMustNewDecFromStr ("0.016" ),
134+ },
135+ {
136+ // Source
137+ CoinDenom : "ibc/F4E5517A3BA2E77906A0847014EBD39E010E28BEB4181378278144D22442DB91" ,
138+ CoinDecimals : 6 ,
139+ MinFundingAmount : math .NewInt (100_000_000 ),
140+ MinFundingAmountPerBundle : math .NewInt (100_000 ),
141+ CoinWeight : math .LegacyMustNewDecFromStr ("0.001" ),
142+ },
143+ {
144+ // Andromeda
145+ CoinDenom : "ibc/A59C9E368C043E72968615DE82D4AD4BC88E34E6F353262B6769781C07390E8A" ,
146+ CoinDecimals : 6 ,
147+ MinFundingAmount : math .NewInt (100_000_000 ),
148+ MinFundingAmountPerBundle : math .NewInt (100_000 ),
149+ CoinWeight : math .LegacyMustNewDecFromStr ("0.009" ),
150+ },
151+ {
152+ // dYdX
153+ CoinDenom : "ibc/D0C5DCA29836D2FD5937714B21206DD8243E5E76B1D0F180741CCB43DCAC1584" ,
154+ CoinDecimals : 18 ,
155+ MinFundingAmount : math .NewInt (10_000_000_000 ).MulRaw (1_000_000_000 ),
156+ MinFundingAmountPerBundle : math .NewInt (10_000_000_000_000_000 ),
157+ CoinWeight : math .LegacyMustNewDecFromStr ("0.69" ),
158+ },
159+ {
160+ // XION
161+ CoinDenom : "ibc/506478E08FB0A2D3B12D493E3B182572A3B0D7BD5DCBE71610D2F393DEDDF4CA" ,
162+ CoinDecimals : 6 ,
163+ MinFundingAmount : math .NewInt (1_000_000 ),
164+ MinFundingAmountPerBundle : math .NewInt (1_000 ),
165+ CoinWeight : math .LegacyMustNewDecFromStr ("1.5" ),
166+ },
167+ {
168+ // Lava
169+ CoinDenom : "ibc/7D5A9AE91948931279BA58A04FBEB9BF4F7CA059F7D4BDFAC6C3C43705973E1E" ,
170+ CoinDecimals : 6 ,
171+ MinFundingAmount : math .NewInt (100_000_000 ),
172+ MinFundingAmountPerBundle : math .NewInt (10_000 ),
173+ CoinWeight : math .LegacyMustNewDecFromStr ("0.066" ),
174+ },
175+ }
176+
177+ fundersKeeper .SetParams (ctx , fundersParams )
178+ }
179+
102180// SetWithdrawAddressAndMultiCoinRewards sets a withdraw-address and enables multi-coin rewards for
103181// a given delegator
104182func SetWithdrawAddressAndMultiCoinRewards (
@@ -133,8 +211,8 @@ func SetMultiCoinRewardsParams(ctx sdk.Context, multiCoinRewardsKeeper multicoin
133211
134212 if ctx .ChainID () == "kyve-1" {
135213 params .MultiCoinDistributionPendingTime = 60 * 60 * 24 * 14
136- // KYVE Public Good Funding address
137- params .MultiCoinDistributionPolicyAdminAddress = "kyve1t0uez3nn28ljnzlwndzxffyjuhean3edhtjee8 "
214+ // KYVE Foundation Funding Wallet
215+ params .MultiCoinDistributionPolicyAdminAddress = "kyve17vydsvqjpz7vswh488fjn7kt8h8ag3f2y8lzgx "
138216 } else if ctx .ChainID () == "kaon-1" {
139217 params .MultiCoinDistributionPendingTime = 60 * 60 * 24
140218 // Kaon Ecosystem
@@ -336,12 +414,11 @@ func migrateProtocolStakers(ctx sdk.Context, delegationKeeper delegationkeeper.K
336414 stakersKeeper .Migration_ResetOldState (ctx )
337415
338416 // Migrate Params
339- delegationParams := delegationKeeper .GetParams (ctx )
340417 stakersParams := stakersKeeper .GetParams (ctx )
341418
342- stakersParams .TimeoutSlash = delegationParams . TimeoutSlash
343- stakersParams .UploadSlash = delegationParams . UploadSlash
344- stakersParams .VoteSlash = delegationParams . VoteSlash
419+ stakersParams .TimeoutSlash = math . LegacyMustNewDecFromStr ( "0.002" )
420+ stakersParams .UploadSlash = math . LegacyMustNewDecFromStr ( "0.005" )
421+ stakersParams .VoteSlash = math . LegacyMustNewDecFromStr ( "0.005" )
345422
346423 stakersKeeper .SetParams (ctx , stakersParams )
347424}
@@ -351,24 +428,24 @@ func UpgradeRuntimes(sdkCtx sdk.Context, poolKeeper *poolkeeper.Keeper) {
351428 upgrades := []poolTypes.MsgScheduleRuntimeUpgrade {
352429 {
353430 Runtime : "@kyvejs/tendermint" ,
354- Version : "1.3.0 " ,
431+ Version : "1.3.6 " ,
355432 ScheduledAt : uint64 (sdkCtx .BlockTime ().Unix ()),
356433 Duration : 600 ,
357- Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.0 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.0 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.0 /kyve-macos-x64.zip\" }" ,
434+ Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.6 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.6 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.3.6 /kyve-macos-x64.zip\" }" ,
358435 },
359436 {
360437 Runtime : "@kyvejs/tendermint-bsync" ,
361- Version : "1.2.9 " ,
438+ Version : "1.2.11 " ,
362439 ScheduledAt : uint64 (sdkCtx .BlockTime ().Unix ()),
363440 Duration : 600 ,
364- Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.9 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.9 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.9 /kyve-macos-x64.zip\" }" ,
441+ Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.11 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.11 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-bsync%401.2.11 /kyve-macos-x64.zip\" }" ,
365442 },
366443 {
367444 Runtime : "@kyvejs/tendermint-ssync" ,
368- Version : "1.3.0 " ,
445+ Version : "1.3.6 " ,
369446 ScheduledAt : uint64 (sdkCtx .BlockTime ().Unix ()),
370447 Duration : 600 ,
371- Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.0 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.0 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.0 /kyve-macos-x64.zip\" }" ,
448+ Binaries : "{\" kyve-linux-arm64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.6 /kyve-linux-arm64.zip\" ,\" kyve-linux-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.6 /kyve-linux-x64.zip\" ,\" kyve-macos-x64\" :\" https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint-ssync%401.3.6 /kyve-macos-x64.zip\" }" ,
372449 },
373450 }
374451
0 commit comments