fix: typos (#25000)
This commit is contained in:
parent
64bd1a134e
commit
dca3b88cd0
@ -271,7 +271,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() {
|
||||
expErrMsg: "total funds percentage exceeds 100",
|
||||
},
|
||||
{
|
||||
name: "address is bocked",
|
||||
name: "address is blocked",
|
||||
msg: &types.MsgCreateContinuousFund{
|
||||
Authority: validAuthority,
|
||||
Recipient: validRecipient.String(),
|
||||
|
||||
@ -62,7 +62,7 @@ In order to mitigate the impact of initially likely categories of non-malicious
|
||||
protocol faults, the Cosmos Hub implements for each validator
|
||||
a _tombstone_ cap, which only allows a validator to be slashed once for a double
|
||||
sign fault. For example, if you misconfigure your HSM and double-sign a bunch of
|
||||
old blocks, you'll only be punished for the first double-sign (and then immediately tombstombed). This will still be quite expensive and desirable to avoid, but tombstone caps
|
||||
old blocks, you'll only be punished for the first double-sign (and then immediately tombstoned). This will still be quite expensive and desirable to avoid, but tombstone caps
|
||||
somewhat blunt the economic impact of unintentional misconfiguration.
|
||||
|
||||
Liveness faults do not have caps, as they can't stack upon each other. Liveness bugs are "detected" as soon as the infraction occurs, and the validators are immediately put in jail, so it is not possible for them to commit multiple liveness faults without unjailing in between.
|
||||
@ -226,7 +226,7 @@ greater than `minHeight` and the validator's `MissedBlocksCounter` is greater th
|
||||
for `DowntimeJailDuration`, and have the following values reset:
|
||||
`MissedBlocksBitArray`, `MissedBlocksCounter`, and `IndexOffset`.
|
||||
|
||||
**Note**: Liveness slashes do **NOT** lead to a tombstombing.
|
||||
**Note**: Liveness slashes do **NOT** lead to a tombstoning.
|
||||
|
||||
```go
|
||||
height := block.Height
|
||||
@ -234,7 +234,7 @@ height := block.Height
|
||||
for vote in block.LastCommitInfo.Votes {
|
||||
signInfo := GetValidatorSigningInfo(vote.Validator.Address)
|
||||
|
||||
// This is a relative index, so we counts blocks the validator SHOULD have
|
||||
// This is a relative index, so we count blocks the validator SHOULD have
|
||||
// signed. We use the 0-value default signing info if not present, except for
|
||||
// start height.
|
||||
index := signInfo.IndexOffset % SignedBlocksWindow()
|
||||
@ -331,7 +331,7 @@ onValidatorBonded(address sdk.ValAddress)
|
||||
IndexOffset : 0,
|
||||
JailedUntil : time.Unix(0, 0),
|
||||
Tombstone : false,
|
||||
MissedBloskCounter : 0
|
||||
MissedBlockCounter : 0
|
||||
} else {
|
||||
signingInfo.StartHeight = CurrentHeight
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ func (k Keeper) AddPubkey(ctx context.Context, pubkey cryptotypes.PubKey) error
|
||||
return store.Set(key, bz)
|
||||
}
|
||||
|
||||
// GetPubkey returns the pubkey from the adddress-pubkey relation
|
||||
// GetPubkey returns the pubkey from the address-pubkey relation
|
||||
func (k Keeper) GetPubkey(ctx context.Context, a cryptotypes.Address) (cryptotypes.PubKey, error) {
|
||||
store := k.storeService.OpenKVStore(ctx)
|
||||
bz, err := store.Get(types.AddrPubkeyRelationKey(a))
|
||||
@ -75,13 +75,13 @@ func (k Keeper) GetPubkey(ctx context.Context, a cryptotypes.Address) (cryptotyp
|
||||
}
|
||||
|
||||
// Slash attempts to slash a validator. The slash is delegated to the staking
|
||||
// module to make the necessary validator changes. It specifies no intraction reason.
|
||||
// module to make the necessary validator changes. It specifies no infraction reason.
|
||||
func (k Keeper) Slash(ctx context.Context, consAddr sdk.ConsAddress, fraction sdkmath.LegacyDec, power, distributionHeight int64) error {
|
||||
return k.SlashWithInfractionReason(ctx, consAddr, fraction, power, distributionHeight, stakingtypes.Infraction_INFRACTION_UNSPECIFIED)
|
||||
}
|
||||
|
||||
// SlashWithInfractionReason attempts to slash a validator. The slash is delegated to the staking
|
||||
// module to make the necessary validator changes. It specifies an intraction reason.
|
||||
// module to make the necessary validator changes. It specifies an infraction reason.
|
||||
func (k Keeper) SlashWithInfractionReason(ctx context.Context, consAddr sdk.ConsAddress, fraction sdkmath.LegacyDec, power, distributionHeight int64, infraction stakingtypes.Infraction) error {
|
||||
coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, fraction, infraction)
|
||||
if err != nil {
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/types"
|
||||
)
|
||||
|
||||
// GetValidatorSigningInfo retruns the ValidatorSigningInfo for a specific validator
|
||||
// GetValidatorSigningInfo returns the ValidatorSigningInfo for a specific validator
|
||||
// ConsAddress. If not found it returns ErrNoSigningInfoFound, but other errors
|
||||
// may be returned if there is an error reading from the store.
|
||||
func (k Keeper) GetValidatorSigningInfo(ctx context.Context, address sdk.ConsAddress) (types.ValidatorSigningInfo, error) {
|
||||
|
||||
@ -77,7 +77,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod
|
||||
return types.ValidateGenesis(data)
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashig module.
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashing module.
|
||||
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
|
||||
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
|
||||
panic(err)
|
||||
|
||||
@ -25,7 +25,7 @@ type BankKeeper interface {
|
||||
SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
|
||||
}
|
||||
|
||||
// ParamSubspace defines the expected Subspace interfacace
|
||||
// ParamSubspace defines the expected Subspace interface
|
||||
type ParamSubspace interface {
|
||||
HasKeyTable() bool
|
||||
WithKeyTable(table paramtypes.KeyTable) paramtypes.Subspace
|
||||
|
||||
@ -569,8 +569,8 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c
|
||||
|
||||
// BuildCreateValidatorMsg makes a new MsgCreateValidator.
|
||||
func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorConfig, txBldr tx.Factory, generateOnly bool, valCodec address.Codec) (tx.Factory, sdk.Msg, error) {
|
||||
amounstStr := config.Amount
|
||||
amount, err := sdk.ParseCoinNormalized(amounstStr)
|
||||
amountStr := config.Amount
|
||||
amount, err := sdk.ParseCoinNormalized(amountStr)
|
||||
if err != nil {
|
||||
return txBldr, nil, err
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ func (s *KeeperTestSuite) TestMsgEditValidator() {
|
||||
expErrMsg: "validator does not exist",
|
||||
},
|
||||
{
|
||||
name: "change commmission rate in <24hrs",
|
||||
name: "change commission rate in <24hrs",
|
||||
ctx: ctx,
|
||||
input: &stakingtypes.MsgEditValidator{
|
||||
Description: stakingtypes.Description{
|
||||
|
||||
@ -78,7 +78,7 @@ func (k Keeper) SetValidator(ctx context.Context, validator types.Validator) err
|
||||
return store.Set(types.GetValidatorKey(str), bz)
|
||||
}
|
||||
|
||||
// SetValidatorByConsAddr sets a validator by conesensus address
|
||||
// SetValidatorByConsAddr sets a validator by consensus address
|
||||
func (k Keeper) SetValidatorByConsAddr(ctx context.Context, validator types.Validator) error {
|
||||
consPk, err := validator.GetConsAddr()
|
||||
if err != nil {
|
||||
@ -543,7 +543,7 @@ func (k Keeper) UnbondAllMatureValidators(ctx context.Context) error {
|
||||
blockTime := sdkCtx.BlockTime()
|
||||
blockHeight := sdkCtx.BlockHeight()
|
||||
|
||||
// unbondingValIterator will contains all validator addresses indexed under
|
||||
// unbondingValIterator will contain all validator addresses indexed under
|
||||
// the ValidatorQueueKey prefix. Note, the entire index key is composed as
|
||||
// ValidatorQueueKey | timeBzLen (8-byte big endian) | timeBz | heightBz (8-byte big endian),
|
||||
// so it may be possible that certain validator addresses that are iterated
|
||||
|
||||
@ -31,7 +31,7 @@ func (s *KeeperTestSuite) TestValidator() {
|
||||
valAddr := sdk.ValAddress(valPubKey.Address().Bytes())
|
||||
valTokens := keeper.TokensFromConsensusPower(ctx, 10)
|
||||
|
||||
// test how the validator is set from a purely unbonbed pool
|
||||
// test how the validator is set from a purely unbonded pool
|
||||
validator := testutil.NewValidator(s.T(), valAddr, valPubKey)
|
||||
validator, _ = validator.AddTokensFromDel(valTokens)
|
||||
require.Equal(stakingtypes.Unbonded, validator.Status)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user