Skip to content

Commit

Permalink
Merge branch 'development' into dependabot/go_modules/github.com/spf1…
Browse files Browse the repository at this point in the history
…3/cobra-1.8.0
  • Loading branch information
bsrinivas8687 authored Nov 14, 2023
2 parents 7b70970 + 70a3370 commit 64f6309
Show file tree
Hide file tree
Showing 21 changed files with 309 additions and 272 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion app/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ var (
// Cosmos IBC module basics
ibc.AppModuleBasic{},
ibcsolomachine.AppModuleBasic{},
ibctm.AppModuleBasic{},
ibcfee.AppModuleBasic{},
ibcica.AppModuleBasic{},
ibctm.AppModuleBasic{},
Expand Down
26 changes: 26 additions & 0 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,32 @@ func UpgradeHandler(
return nil, err
}

validators := keepers.StakingKeeper.GetAllValidators(ctx)
for _, validator := range validators {
if validator.Commission.Rate.GTE(stakingParams.MinCommissionRate) {
continue
}

validator.Commission.Rate = stakingParams.MinCommissionRate
validator.Commission.UpdateTime = ctx.BlockTime()
if validator.Commission.MaxRate.LT(validator.Commission.Rate) {
validator.Commission.MaxRate = validator.Commission.Rate
}

if err := keepers.StakingKeeper.Hooks().BeforeValidatorModified(ctx, validator.GetOperator()); err != nil {
return nil, err
}

keepers.StakingKeeper.SetValidator(ctx, validator)
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
stakingtypes.EventTypeEditValidator,
sdk.NewAttribute(stakingtypes.AttributeKeyCommissionRate, validator.Commission.String()),
sdk.NewAttribute(stakingtypes.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()),
),
})
}

ibcClientParams := keepers.IBCKeeper.ClientKeeper.GetParams(ctx)
ibcClientParams.AllowedClients = append(ibcClientParams.AllowedClients, exported.Localhost)
keepers.IBCKeeper.ClientKeeper.SetParams(ctx, ibcClientParams)
Expand Down
12 changes: 6 additions & 6 deletions proto/sentinel/mint/v1/inflation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ option (gogoproto.goproto_getters_all) = false;
// Inflation represents a message for handling inflation parameters.
message Inflation {
// Field 1: Maximum inflation rate.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"max\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string max = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"max\"",
(gogoproto.nullable) = false
];

// Field 2: Minimum inflation rate.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"min\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string min = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"min\"",
(gogoproto.nullable) = false
];

// Field 3: Rate of change of inflation.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.moretags) = "yaml:\"rate_change\"": YAML tag for better representation.
// - (gogoproto.nullable) = false: Field is not nullable.
string rate_change = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"rate_change\"",
(gogoproto.nullable) = false
];
Expand Down
4 changes: 2 additions & 2 deletions proto/sentinel/node/v2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ message Params {
int64 min_subscription_hours = 10;

// Field 11: Staking share required for a node.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.nullable) = false: Field is not nullable.
string staking_share = 11 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/provider/v2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ message Params {
cosmos.base.v1beta1.Coin deposit = 1 [(gogoproto.nullable) = false];

// Field 2: Staking share associated with the providers.
// - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec":
// - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec":
// Custom type definition for the field.
// - (gogoproto.nullable) = false: Field is not nullable.
string staking_share = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/subscription/v2/allocation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ message Allocation {

// Field 3: Granted bytes.
string granted_bytes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 4: Utilized bytes.
string utilised_bytes = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
4 changes: 2 additions & 2 deletions proto/sentinel/subscription/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ message EventAllocate {

// Field 2: Granted bytes in the allocation.
string granted_bytes = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 3: Utilized bytes in the allocation.
string utilised_bytes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

Expand Down
2 changes: 1 addition & 1 deletion proto/sentinel/subscription/v2/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message MsgAllocateRequest {

// Field 4: Number of bytes to allocate.
string bytes = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
Expand Down
2 changes: 1 addition & 1 deletion proto/sentinel/swap/v1/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message MsgSwapRequest {
bytes tx_hash = 2;
string receiver = 3;
string amount = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
Expand Down
14 changes: 8 additions & 6 deletions proto/sentinel/types/v1/bandwidth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ option (gogoproto.goproto_getters_all) = false;

// Bandwidth represents information about upload and download bandwidth.
message Bandwidth {
// Field 1: Upload bandwidth, represented as a Cosmos SDK Int type.
// This field is not nullable.
// Upload bandwidth value represented as a string.
// It uses a custom type "cosmossdk.io/math.Int".
// The value is not nullable, as indicated by "(gogoproto.nullable) = false".
string upload = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// Field 2: Download bandwidth, represented as a Cosmos SDK Int type.
// This field is not nullable.
// Download bandwidth value represented as a string.
// It uses a custom type "cosmossdk.io/math.Int".
// The value is not nullable, as indicated by "(gogoproto.nullable) = false".
string download = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
38 changes: 20 additions & 18 deletions types/bandwidth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions x/mint/types/inflation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 64f6309

Please sign in to comment.