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

adds types and service rpc between gw and worker #3

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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
43 changes: 43 additions & 0 deletions proto/lagrange.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,49 @@ message TaskType {
}
}

message MessageEnvelope {
message RoutingKey {
string domain = 1;
uint64 priority = 2;
}
/// Query id is unique for each query and shared between all its tasks
string query_id = 1;

/// Task id is unique for each task and helps to map replies to tasks
string task_id = 2;

/// Task id referenced in the DB tasks table
/// TODO: optional?
int32 db_task_id = 3;

/// Estimate how long it takes this task to finish.
/// This includes may factors like: redis queue current length, workers count, parallel queries count, etc.
/// Ideally assigned by an "intelligent" algorithm. Not important for now though.
/// Might become relevant then we have clients waiting for results, and we can process queries
/// relatively fast.
uint64 rtt = 4;

/// How much work prover has to do
uint64 gas = 5;

/// How and where to route the message.
RoutingKey routing_key = 6;

/// Details of the task to be executed.
TaskType inner = 7;
}

message DownstreamPayload {
oneof downstream_payload {
MessageEnvelope todo = 1;
}
}

service WorkersService {
// A bidirectional streaming RPC between GW<->Worker
rpc WorkerToGw(stream ReplyType) returns (stream DownstreamPayload) {}
}

message ReplyType {
enum ProofCathegory {
PROOF_CATHEGORY_UNSPECIFIED = 0;
Expand Down
Loading