diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index a66dfd9135..89970c4b70 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -378,7 +378,7 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon // initialization parameters are optional and hence could be nil; // in that case, set the default - initializationParameters := types.ConsumerInitializationParameters{} // default params + initializationParameters := types.DefaultConsumerInitializationParameters() // default params if msg.InitializationParameters != nil { initializationParameters = *msg.InitializationParameters } diff --git a/x/ccv/provider/types/provider.go b/x/ccv/provider/types/provider.go new file mode 100644 index 0000000000..6c6fc05563 --- /dev/null +++ b/x/ccv/provider/types/provider.go @@ -0,0 +1,28 @@ +package types + +import ( + "time" + + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + + ccv "github.com/cosmos/interchain-security/v6/x/ccv/types" +) + +func DefaultConsumerInitializationParameters() ConsumerInitializationParameters { + return ConsumerInitializationParameters{ + InitialHeight: clienttypes.Height{ + RevisionNumber: 1, + RevisionHeight: 0, + }, + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: time.Time{}, + UnbondingPeriod: ccv.DefaultConsumerUnbondingPeriod, + CcvTimeoutPeriod: ccv.DefaultCCVTimeoutPeriod, + TransferTimeoutPeriod: ccv.DefaultTransferTimeoutPeriod, + ConsumerRedistributionFraction: ccv.DefaultConsumerRedistributeFrac, + BlocksPerDistributionTransmission: ccv.DefaultBlocksPerDistributionTransmission, + HistoricalEntries: ccv.DefaultHistoricalEntries, + DistributionTransmissionChannel: "", + } +} diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 2a29eeb086..03b9d3f979 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -34,10 +34,10 @@ const ( // (and for consistency with other protobuf schemas defined for ccv). DefaultHistoricalEntries = int64(stakingtypes.DefaultHistoricalEntries) - // In general, the default unbonding period on the consumer is one week less + // In general, the default unbonding period on the consumer is one day less // than the default unbonding period on the provider, where the provider uses // the staking module default. - DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 7*24*time.Hour + DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 24*time.Hour // Default retry delay period is 1 hour. DefaultRetryDelayPeriod = time.Hour