-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1604 from lavanet/CNS-1003-reputation-proto-defin…
…itions feat: Reputation: CNS-1003: reputation proto definitions
- Loading branch information
Showing
50 changed files
with
6,544 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
syntax = "proto3"; | ||
package lavanet.lava.pairing; | ||
|
||
option go_package = "github.com/lavanet/lava/v4/x/pairing/types"; | ||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
// Frac is a fracture struct that helps calculating and updating weighted average on the go | ||
message Frac { | ||
string num = 1 [(gogoproto.moretags) = "yaml:\"num\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false]; // weighted average numerator (w1*s1+w2*s2+...) | ||
string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false]; // weighted denominator (w1+w2+...) | ||
} | ||
|
||
// QosScore holds the QoS score from a QoS excellence report. The score and its variance are updated over time using a weighted average. | ||
// Currently, the weight is the amount of relays that are associated with the QoS report. | ||
message QosScore { | ||
Frac score = 1 [(gogoproto.nullable) = false]; | ||
Frac variance = 2 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// Reputation keeps the QosScore of a provider for a specific cluster for in the provider's geolocation. | ||
// The store key is provider+chain+cluster. | ||
// The epoch_score is a QosScore object that is aggregated over an epoch. When an epoch ends, the "score" field is updated | ||
// with the epoch_score and the epoch_score is reset. | ||
// The time_last_updated is used to calculate the appropriate time decay upon update. | ||
// The creation_time is used to determine if the variance stabilization period has passed and score can be truncated. | ||
// The stake is used when converting the reputation QoS scores to repuatation pairing score. | ||
message Reputation { | ||
QosScore score = 1 [(gogoproto.nullable) = false]; | ||
QosScore epoch_score = 2 [(gogoproto.nullable) = false]; | ||
int64 time_last_updated = 3; | ||
int64 creation_time = 4; | ||
cosmos.base.v1beta1.Coin stake = 5 [(gogoproto.nullable) = false]; | ||
} | ||
|
||
// ReputationPairingScore holds the reputation pairing score used by the reputation pairing requirement. | ||
// The score is ranged between [0.5-2]. It's kept in the reputations fixation store with a provider+chain+cluster key. | ||
message ReputationPairingScore { | ||
string score = 1 [(gogoproto.moretags) = "yaml:\"score\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.