From 3f7df3506d1a0beaeaa6f1b62bb04b6ffbda100d Mon Sep 17 00:00:00 2001 From: stana-ethernal Date: Thu, 28 Nov 2024 10:34:43 +0100 Subject: [PATCH] updrade.md update --- UPGRADING.md | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index d487f8e26f..1f19d05878 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,7 +1,43 @@ -# Upgrading Replicated Security +# Upgrading Interchain Security ## Unreleased +### Provider + +```golang +func SetConsumerInfractionParams(ctx sdk.Context, store storetypes.KVStore, pk providerkeeper.Keeper) error { + infractionParameters := defaultInfractionParams() + + activeConsumerIds := pk.GetAllActiveConsumerIds(ctx) + for _, consumerId := range activeConsumerIds { + if err := pk.SetInfractionParameters(ctx, consumerId, infractionParameters); err != nil { + return err + } + } + + return nil +} + +func defaultInfractionParams() providertypes.InfractionParameters { + return providertypes.InfractionParameters{ + DoubleSign: &providertypes.SlashJailParameters{ + JailDuration: time.Duration(1<<63 - 1), // the largest value a time.Duration can hold 9223372036854775807 (approximately 292 years) + SlashFraction: math.LegacyNewDecWithPrec(5, 2), // 0.05 + }, + Downtime: &providertypes.SlashJailParameters{ + JailDuration: 600 * time.Second, + SlashFraction: math.LegacyNewDec(0), // no slashing for downtime on the consumer + }, + } +} +``` + +## v6.3.x + +Upgrading from `v6.2.0` will not require state migration. To upgrade from lower versions, please check the sections below. + +## v6.2.x + ### Consumer Upgrading a consumer from v4.4.x to v4.5.x and from v5.x or v6.1.x to v6.2.x requires state migrations. The following migrators should be added to the upgrade handler of the consumer chain: @@ -22,6 +58,13 @@ func InitializeConsumerId(ctx sdk.Context, consumerKeeper consumerkeeper.Keeper) } ``` +## [v6.1.x](https://github.com/cosmos/interchain-security/releases/tag/v6.1.0) + +Upgrading from `v6.0.0` will not require state migration. + + +## [v6.0.x](https://github.com/cosmos/interchain-security/releases/tag/v6.0.0) + ### Provider Upgrading a provider from v5.1.x requires state migrations. The following migrators should be added to the upgrade handler of the provider chain: @@ -378,4 +421,4 @@ Upgrading a provider from `v1.1.0-multiden` to `v2.0.0` will require state migra ### Consumer -Upgrading a consumer from `v1.2.0-multiden` to `v2.0.0` will NOT require state migrations. +Upgrading a consumer from `v1.2.0-multiden` to `v2.0.0` will NOT require state migrations. \ No newline at end of file