Skip to content

Commit

Permalink
added support do double spend defence, and max CU usage, work in prog…
Browse files Browse the repository at this point in the history
…ress
  • Loading branch information
omerlavanet committed Mar 27, 2022
1 parent 07a4953 commit 734c1b4
Show file tree
Hide file tree
Showing 70 changed files with 14,208 additions and 2,871 deletions.
837 changes: 822 additions & 15 deletions docs/static/openapi.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions proto/servicer/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import "servicer/current_session_start.proto";
import "servicer/previous_session_blocks.proto";
import "servicer/session_storage_for_spec.proto";
import "servicer/earliest_session_start.proto";
import "servicer/unique_payment_storage_user_servicer.proto";
import "servicer/user_payment_storage.proto";
import "servicer/session_payments.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/lavanet/lava/x/servicer/types";
Expand All @@ -27,5 +30,8 @@ message GenesisState {
PreviousSessionBlocks previousSessionBlocks = 8;
repeated SessionStorageForSpec sessionStorageForSpecList = 9 [(gogoproto.nullable) = false];
EarliestSessionStart earliestSessionStart = 10;
repeated UniquePaymentStorageUserServicer uniquePaymentStorageUserServicerList = 11 [(gogoproto.nullable) = false];
repeated UserPaymentStorage userPaymentStorageList = 12 [(gogoproto.nullable) = false];
repeated SessionPayments sessionPaymentsList = 13 [(gogoproto.nullable) = false];
// this line is used by starport scaffolding # genesis/proto/state
}
87 changes: 87 additions & 0 deletions proto/servicer/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import "servicer/current_session_start.proto";
import "servicer/previous_session_blocks.proto";
import "servicer/session_storage_for_spec.proto";
import "servicer/earliest_session_start.proto";
import "servicer/session_payments.proto";
// this line is used by starport scaffolding # 1
import "servicer/user_payment_storage.proto";
import "servicer/unique_payment_storage_user_servicer.proto";
import "servicer/stake_storage.proto";
import "servicer/block_num.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down Expand Up @@ -107,6 +110,36 @@ service Query {
option (google.api.http).get = "/lavanet/lava/servicer/verify_pairing/{spec}/{userAddr}/{servicerAddr}/{blockNum}";
}

// Queries a UniquePaymentStorageUserServicer by index.
rpc UniquePaymentStorageUserServicer(QueryGetUniquePaymentStorageUserServicerRequest) returns (QueryGetUniquePaymentStorageUserServicerResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/unique_payment_storage_user_servicer/{index}";
}

// Queries a list of UniquePaymentStorageUserServicer items.
rpc UniquePaymentStorageUserServicerAll(QueryAllUniquePaymentStorageUserServicerRequest) returns (QueryAllUniquePaymentStorageUserServicerResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/unique_payment_storage_user_servicer";
}

// Queries a UserPaymentStorage by index.
rpc UserPaymentStorage(QueryGetUserPaymentStorageRequest) returns (QueryGetUserPaymentStorageResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/user_payment_storage/{index}";
}

// Queries a list of UserPaymentStorage items.
rpc UserPaymentStorageAll(QueryAllUserPaymentStorageRequest) returns (QueryAllUserPaymentStorageResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/user_payment_storage";
}

// Queries a SessionPayments by index.
rpc SessionPayments(QueryGetSessionPaymentsRequest) returns (QueryGetSessionPaymentsResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/session_payments/{index}";
}

// Queries a list of SessionPayments items.
rpc SessionPaymentsAll(QueryAllSessionPaymentsRequest) returns (QueryAllSessionPaymentsResponse) {
option (google.api.http).get = "/lavanet/lava/servicer/session_payments";
}

// this line is used by starport scaffolding # 2
}

Expand Down Expand Up @@ -256,4 +289,58 @@ message QueryVerifyPairingResponse {
bool overlap = 5;
}

message QueryGetUniquePaymentStorageUserServicerRequest {
string index = 1;

}

message QueryGetUniquePaymentStorageUserServicerResponse {
UniquePaymentStorageUserServicer uniquePaymentStorageUserServicer = 1 [(gogoproto.nullable) = false];
}

message QueryAllUniquePaymentStorageUserServicerRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllUniquePaymentStorageUserServicerResponse {
repeated UniquePaymentStorageUserServicer uniquePaymentStorageUserServicer = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetUserPaymentStorageRequest {
string index = 1;

}

message QueryGetUserPaymentStorageResponse {
UserPaymentStorage userPaymentStorage = 1 [(gogoproto.nullable) = false];
}

message QueryAllUserPaymentStorageRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllUserPaymentStorageResponse {
repeated UserPaymentStorage userPaymentStorage = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetSessionPaymentsRequest {
string index = 1;

}

message QueryGetSessionPaymentsResponse {
SessionPayments sessionPayments = 1 [(gogoproto.nullable) = false];
}

message QueryAllSessionPaymentsRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllSessionPaymentsResponse {
repeated SessionPayments sessionPayments = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// this line is used by starport scaffolding # 3
11 changes: 11 additions & 0 deletions proto/servicer/session_payments.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";
package lavanet.lava.servicer;

option go_package = "github.com/lavanet/lava/x/servicer/types";
import "servicer/user_payment_storage.proto";

message SessionPayments {
string index = 1;
repeated UserPaymentStorage usersPayments = 2;
}

11 changes: 11 additions & 0 deletions proto/servicer/unique_payment_storage_user_servicer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";
package lavanet.lava.servicer;

option go_package = "github.com/lavanet/lava/x/servicer/types";

message UniquePaymentStorageUserServicer {
string index = 1;
uint64 block = 2;

}

14 changes: 14 additions & 0 deletions proto/servicer/user_payment_storage.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
package lavanet.lava.servicer;

option go_package = "github.com/lavanet/lava/x/servicer/types";
import "servicer/unique_payment_storage_user_servicer.proto";

message UserPaymentStorage {
string index = 1;
repeated UniquePaymentStorageUserServicer uniquePaymentStorageUserServicer = 2;
uint64 totalCU = 3;
uint64 session = 4;

}

Loading

0 comments on commit 734c1b4

Please sign in to comment.