Skip to content

Commit

Permalink
fix some typos (#247)
Browse files Browse the repository at this point in the history
* typos

* Apply suggestions from code review

Co-authored-by: Max <[email protected]>

---------

Co-authored-by: X <[email protected]>
Co-authored-by: Max <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2024
1 parent 1d03aa3 commit 619328e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions proto/exocore/oracle/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ message Params {
int32 threshold_b = 8;
// for v1, mode=1, get final price as soon as voting power reach threshold_a/threshold_b
ConsensusMode mode = 9;
// for each round, a validator only allowed to provide at most max_det_id continuous rounds of prices for DS
// for each round, a validator only allowed to provide at most max_det_id consecutive rounds of prices for DS
int32 max_det_id = 10;
// for each token, only keep max_size_prices round of prices
int32 max_size_prices = 11;
Expand Down Expand Up @@ -70,7 +70,7 @@ message SlashingParams {
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
// slash_fraction_miss defines the fraction one validator should be punished for malicious behavior
// slash_fraction_malicious defines the fraction one validator should be punished for malicious behavior
bytes slash_fraction_malicious = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand Down
10 changes: 5 additions & 5 deletions x/oracle/keeper/slashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (k Keeper) InitValidatorReportInfo(ctx sdk.Context, validator string, heigh
store := ctx.KVStore(k.storeKey)
key := types.SlashingValidatorReportInfoKey(validator)
if !store.Has(key) {
// set the record for validator to tracking performance of oracle service
// set the record for the validator to track performance of the oracle service
reportInfo := &types.ValidatorReportInfo{
Address: validator,
StartHeight: height,
Expand All @@ -26,7 +26,7 @@ func (k Keeper) InitValidatorReportInfo(ctx sdk.Context, validator string, heigh
}
}

// SetValidatorReportInfo sets the reporting info for a validator
// SetValidatorReportInfo sets the validator reporting info for a validator
func (k Keeper) SetValidatorReportInfo(ctx sdk.Context, validator string, info types.ValidatorReportInfo) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshal(&info)
Expand All @@ -53,7 +53,7 @@ func (k Keeper) SetValidatorMissedRoundBitArray(ctx sdk.Context, validator strin
store.Set(types.SlashingMissedBitArrayKey(validator, index), bz)
}

// GetValidatorMissedBlocks returns array of missed rounds for given validator
// GetValidatorMissedRoundBitArray returns whether a validator missed a specific reporting round
func (k Keeper) GetValidatorMissedRoundBitArray(ctx sdk.Context, validator string, index uint64) bool {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.SlashingMissedBitArrayKey(validator, index))
Expand All @@ -80,10 +80,10 @@ func (k Keeper) GetSlashFractionMalicious(ctx sdk.Context) (res sdk.Dec) {
return k.GetParams(ctx).Slashing.SlashFractionMalicious
}

// GetMinReportedPerWindow minimum blocks repored prices per window
// GetMinReportedPerWindow returns the minimum number of blocks for which a validator must report prices during each window
func (k Keeper) GetMinReportedPerWindow(ctx sdk.Context) int64 {
params := k.GetParams(ctx)
reportedRoundsWindow := k.GetReportedRoundsWindow(ctx)
reportedRoundsWindow := params.Slashing.ReportedRoundsWindow

// NOTE: RoundInt64 will never panic as minReportedPerWindow is
// less than 1.
Expand Down

0 comments on commit 619328e

Please sign in to comment.