Skip to content

Commit 1162655

Browse files
committed
add consumer chain unbonding period tweak
1 parent 0aae6f1 commit 1162655

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

x/ccv/consumer/types/keys.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package types
22

33
import (
44
"encoding/binary"
5+
"time"
56

67
sdk "github.com/cosmos/cosmos-sdk/types"
78
"github.com/cosmos/cosmos-sdk/types/address"
@@ -28,6 +29,9 @@ const (
2829

2930
// ConsumerToSendToProviderName is a "buffer" address for outgoing fees to be transferred to the provider chain
3031
ConsumerToSendToProviderName = "cons_to_send_to_provider"
32+
33+
// UnbondingPeriod is the time duration to mature the VSC packets
34+
UnbondingPeriod time.Duration = 48 * time.Hour
3135
)
3236

3337
// Iota generated keys/key prefixes (as a byte), supports 256 possible values

x/ccv/utils/utils.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
1010
channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"
1111
host "github.com/cosmos/ibc-go/v3/modules/core/24-host"
12+
consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types"
1213
ccv "github.com/cosmos/interchain-security/x/ccv/types"
1314
abci "github.com/tendermint/tendermint/abci/types"
1415
)
@@ -91,15 +92,19 @@ func ComputeConsumerUnbondingPeriod(providerUnbondingPeriod time.Duration) time.
9192
// In general, the unbonding period on the consumer
9293
// is one day less than the unbonding period on the provider
9394
return providerUnbondingPeriod - 24*time.Hour // one day less
94-
} else if providerUnbondingPeriod >= 24*time.Hour {
95-
// If the unbonding period on the provider is
96-
// between one day and one week, then the unbonding period
97-
// on the consumer is one hour less
98-
return providerUnbondingPeriod - time.Hour // one hour less
95+
// } else if providerUnbondingPeriod >= 24*time.Hour {
96+
// // If the unbonding period on the provider is
97+
// // between one day and one week, then the unbonding period
98+
// // on the consumer is one hour less
99+
// return providerUnbondingPeriod - time.Hour // one hour less
99100
} else {
100101
// If the unbonding period on the provider is
101102
// less than one day, then the unbonding period
102103
// on the consumer is the same as on the provider
103-
return providerUnbondingPeriod
104+
//return providerUnbondingPeriod
105+
106+
// Use a hardcoded consumer unbonding period of 10mins in order
107+
// to be bigger duration than on the provider
108+
return consumertypes.UnbondingPeriod
104109
}
105110
}

0 commit comments

Comments
 (0)