Skip to content

Commit

Permalink
[Session] Adding the Session type (#54)
Browse files Browse the repository at this point in the history
## Summary

Scaffolding & adding the `Session` type
  • Loading branch information
Olshansk authored Oct 11, 2023
1 parent da5ab73 commit 326e9c8
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions proto/pocket/session/session.proto
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
}

0 comments on commit 326e9c8

Please sign in to comment.