Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: changes to client side of connection #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 52 additions & 11 deletions proto/lagrange.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ syntax = "proto3";

package lagrange;

import "google/protobuf/duration.proto";

message WorkerToGwResponse {
oneof response {
string todo = 1;
}
UUID task_id = 1;
bytes task = 2;
}

// A message sent by the prover at the beginning of connection to the GW
// Contains fields that were previously communicated via JWT claims.
message WorkerReady {
// Version of the worker. Should follow SemVer format.
string version = 1;

// Class of the worker.
string worker_class = 2;
}
Expand All @@ -31,25 +31,66 @@ service WorkersService {
}

message WorkerDone {
UUID task_id = 1;
oneof reply {
string reply_string = 1;
string worker_error = 2;
bytes task_output = 2;
string worker_error = 3;
}
}

message UUID {
bytes id = 1;
}

message SubmitTaskRequest {
bytes task_bytes = 1;

// friendly name of a task for logging and tracing
string user_task_id = 2;

google.protobuf.Duration timeout = 3;

bytes price_requested = 4;
string class = 5;

// BE-encoded `U256`.
bytes stake_requested = 6;

// Priority of the task
uint64 priority = 7;
}

message SubmitTaskResponse {
UUID task_uuid = 2;
}

message AckedMessages {
repeated UUID acked_messages = 1;
}

message SubscribeToMessages {
repeated UUID subscribe_to_messages = 2;
}

message ProofChannelRequest {
oneof request {
string task = 1;
AckedMessages acked_messages = 1;
SubscribeToMessages subscribe_to_messages = 2;
}
}

message SubmitTaskResponse {
oneof reply {
string reply_string = 1;
message ProofReady {
UUID task_id = 1;
bytes task_output = 2;
}

message ProofChannelResponse {
oneof response {
ProofReady proof = 1;
}
}

service ClientsService {
rpc ClientToGw(stream SubmitTaskRequest) returns (stream SubmitTaskResponse) {}
rpc SubmitTask(SubmitTaskRequest) returns (SubmitTaskResponse) {}
rpc ProofChannel(stream ProofChannelRequest) returns (stream ProofChannelResponse) {}
}
Loading