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

Modify ICS Params in v20 Migration #1157

Merged
merged 8 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 38 additions & 1 deletion app/upgrades/v20/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package v20

import (
"time"

errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -83,8 +85,43 @@ func MigrateICSOutstandingDowntime(ctx sdk.Context, ck ccvconsumerkeeper.Keeper)
}

// Migrates ICS Params to add the new RetryDelayParam
sampocs marked this conversation as resolved.
Show resolved Hide resolved
// Because RetryDelayPeriod isn't in the store yet, we can't call
// ck.GetConsumerParams(ctx) and modify the RetryDelayPeriod,
// as calling ck.GetConsumerParams(ctx) will panic if the param isn't in the store.
// Instead, we get the DefaultParams and modify each value to
// their value directly before the v20 upgrade
func MigrateICSParams(ctx sdk.Context, ck ccvconsumerkeeper.Keeper) {
params := ck.GetConsumerParams(ctx)
// Get default consumer params and set the new RetryDelayPeriod
params := ccvtypes.DefaultParams()
params.RetryDelayPeriod = ccvtypes.DefaultRetryDelayPeriod
// Modify to the correct params values
params.Enabled = true
params.BlocksPerDistributionTransmission = 1000
params.DistributionTransmissionChannel = "channel-0"
params.ProviderFeePoolAddrStr = "cosmos1ap0mh6xzfn8943urr84q6ae7zfnar48am2erhd"
params.CcvTimeoutPeriod = time.Second * 2419200
params.TransferTimeoutPeriod = time.Second * 3600
params.ConsumerRedistributionFraction = "0.85"
params.HistoricalEntries = 10000
params.UnbondingPeriod = time.Second * 1209600
params.SoftOptOutThreshold = "0.05"
params.RewardDenoms = []string{
"stucmdx",
"stuatom",
"staevmos",
"stinj",
"stujuno",
"stuosmo",
"stuluna",
"stusomm",
"stustars",
"stuumee",
"ustrd",
"stadydx",
"stutia",
"stadym",
}
params.ProviderRewardDenoms = []string{}
// Set the new params
ck.SetParams(ctx, params)
}
2 changes: 1 addition & 1 deletion dockernet/src/register_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
echo "$CHAIN - Registering host zone..."
$STRIDE_MAIN_CMD tx stakeibc register-host-zone \
$CONNECTION $HOST_DENOM $ADDRESS_PREFIX $IBC_DENOM $CHANNEL 1 $LSM_ENABLED $COMMUNITY_POOL_TREASURY_ADDRESS \
--gas 1000000 --from $STRIDE_ADMIN_ACCT --home $DOCKERNET_HOME/state/stride1 -y | TRIM_TX
--gas 2000000 --from $STRIDE_ADMIN_ACCT --home $DOCKERNET_HOME/state/stride1 -y | TRIM_TX
sleep 10

# Build array of validators of the form:
Expand Down
2 changes: 0 additions & 2 deletions dockernet/start_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ done


# Start each chain, create the transfer channels and start the relayers
# For dydx, sleep before and after the relayers are setup to get it some time to startup
# since it's a computationally expensive chain
bash $SRC/start_chain.sh
bash $SRC/start_relayers.sh

Expand Down
6 changes: 0 additions & 6 deletions x/stakeibc/keeper/reward_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ type ForwardMetadata struct {
Retries int64 `json:"retries"`
}

type FeeInfo struct {
RebateAmount sdkmath.Int
StrideFeeAmount sdkmath.Int
ReinvestAmount sdkmath.Int
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The goal of this code is to allow certain reward token types to be automatically traded into other types
// This happens before the rest of the staking, allocation, distribution etc. would continue as normal
Expand Down
Loading