-
Notifications
You must be signed in to change notification settings - Fork 29
/
machine-manager.proto
113 lines (95 loc) · 3.15 KB
/
machine-manager.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright Cartesi and individual authors (see AUTHORS)
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
import "cartesi-machine.proto";
package CartesiMachineManager;
service MachineManager {
rpc NewSession (NewSessionRequest) returns (CartesiMachine.Hash) {}
rpc SessionRun (SessionRunRequest) returns (SessionRunResponse) {}
rpc SessionStep (SessionStepRequest) returns (SessionStepResponse) {}
rpc SessionStore (SessionStoreRequest) returns (CartesiMachine.Void) {}
rpc SessionReadMemory (SessionReadMemoryRequest) returns (SessionReadMemoryResponse) {}
rpc SessionWriteMemory (SessionWriteMemoryRequest) returns (CartesiMachine.Void) {}
rpc SessionReplaceMemoryRange (SessionReplaceMemoryRangeRequest) returns (CartesiMachine.Void) {}
rpc SessionGetProof (SessionGetProofRequest) returns (CartesiMachine.MerkleTreeProof) {}
rpc EndSession (EndSessionRequest) returns (CartesiMachine.Void) {}
}
message NewSessionRequest {
CartesiMachine.MachineRequest machine = 1;
string session_id = 2;
bool force = 3;
}
message SessionRunRequest {
string session_id = 1;
repeated uint64 final_cycles = 2;
}
message SessionRunProgress {
uint64 progress = 1;
uint64 application_progress = 2;
uint64 updated_at = 3;
uint64 cycle = 4;
}
message SessionRunResult {
repeated CartesiMachine.RunResponse summaries = 1;
repeated CartesiMachine.Hash hashes = 2;
}
message SessionRunResponse {
oneof run_oneof {
SessionRunProgress progress = 1;
SessionRunResult result = 2;
}
}
message SessionStepRequest {
string session_id = 1;
uint64 initial_cycle = 2;
oneof step_params_oneof {
CartesiMachine.StepUarchRequest step_params = 3;
};
}
message SessionStepResponse {
CartesiMachine.AccessLog log = 1;
}
message SessionStoreRequest {
string session_id = 1;
CartesiMachine.StoreRequest store = 2;
}
message SessionReadMemoryRequest {
string session_id = 1;
uint64 cycle = 2;
CartesiMachine.ReadMemoryRequest position = 3;
}
message SessionReadMemoryResponse {
CartesiMachine.ReadMemoryResponse read_content = 1;
}
message SessionReplaceMemoryRangeRequest {
string session_id = 1;
uint64 cycle = 2;
CartesiMachine.MemoryRangeConfig range = 3;
}
message SessionWriteMemoryRequest {
string session_id = 1;
uint64 cycle = 2;
CartesiMachine.WriteMemoryRequest position = 3;
}
message SessionGetProofRequest {
string session_id = 1;
uint64 cycle = 2;
CartesiMachine.GetProofRequest target = 3;
}
message EndSessionRequest {
string session_id = 1;
bool silent = 2;
}