-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Session] Adding the Session type (#54)
## Summary Scaffolding & adding the `Session` type
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
syntax = "proto3"; | ||
package pocket.session; | ||
|
||
option go_package = "pocket/x/session/types"; | ||
|
||
import "cosmos_proto/cosmos.proto"; | ||
// TODO(@Olshansk): Uncomment the line below once the service.proto file is added | ||
// import "pocket/service/service.proto"; | ||
import "pocket/application/application.proto"; | ||
import "pocket/supplier/supplier.proto"; | ||
|
||
// NOTE: Using signed integers for consistency with the cosmos SDK | ||
|
||
// SessionHeader is a lightweight header for a session that can be passed around. | ||
// It is the minimal amount of data required to hydrate & retrieve all data relevant to the session. | ||
message SessionHeader { | ||
string application_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The address of the application this session is for | ||
// TODO(@Olshansk): Uncomment the line below once the `ServiceId` proto is defined | ||
// service.ServiceId service_id = 2; // The ID of the service this session is servicing | ||
int64 session_start_block_height = 3; // The height at which this session started | ||
// NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience | ||
string session_id = 4; // A unique pseudoranom ID for this session | ||
} | ||
|
||
// Session is a fully hydrated session object that contains all the information for the Session | ||
// and its parcipants. | ||
message Session { | ||
SessionHeader header = 1; // The header of the session containing lightweight data | ||
string session_id = 2; // A unique pseudoranom ID for this session | ||
int64 session_number = 3; // The session number since genesis | ||
int64 num_blocks_per_session = 4; // The number of blocks per session when this session started | ||
// TODO(@Olshansk): Uncomment the line below once the `Service` proto is defined | ||
// service.Service service = 5; // A fully hydrated service object this session is for | ||
application.Application application = 6; // A fully hydrated application object this session is for | ||
repeated supplier.Supplier suppliers = 7; // A fully hydrated set of servicers that are serving the application | ||
} |