1/** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16syntax = "proto3"; 17package mindspore.fl; 18 19message CollectiveData { 20 bytes data = 1; 21} 22 23message CountRequest { 24 string name = 1; 25 string id = 2; 26} 27 28message CountResponse { 29 bool result = 1; 30 string reason = 2; 31} 32 33message CountReachThresholdRequest { 34 string name = 1; 35} 36 37message CountReachThresholdResponse { 38 bool is_enough = 1; 39} 40 41message ResetCounterRequest { 42 string name = 1; 43} 44 45message UpdateMetadataRequest { 46 string name = 1; 47 bytes value = 2; 48} 49 50message GetMetadataRequest { 51 string name = 1; 52} 53 54message GetMetadataResponse { 55 bytes value = 1; 56} 57 58enum CounterEventType { 59 FIRST_CNT = 0; 60 LAST_CNT = 1; 61} 62 63message CounterEvent { 64 CounterEventType type = 1; 65 string name = 2; 66 bytes data = 3; 67} 68 69message FLId { 70 string fl_id = 1; 71} 72 73message UpdateModelClientList { 74 repeated string fl_id = 1; 75} 76 77message DeviceMeta { 78 string fl_name = 1; 79 string fl_id = 2; 80 uint64 data_size = 3; 81} 82 83message FLIdToDeviceMeta { 84 map<string, DeviceMeta> fl_id_to_meta = 1; 85} 86 87message UpdateModelThreshold { 88 uint64 threshold = 1; 89} 90 91message ClientShares { 92 map<string, SharesPb> client_secret_shares = 1; 93} 94 95message PairClientShares { 96 string fl_id = 1; 97 SharesPb client_shares = 2; 98} 99 100message ClientKeys { 101 map<string, KeysPb> client_keys = 1; 102} 103 104message ClientNoises { 105 OneClientNoises one_client_noises = 1; 106} 107 108message PairClientKeys { 109 string fl_id = 1; 110 KeysPb client_keys = 2; 111} 112 113message OneClientNoises { 114 repeated float noise = 1; 115} 116 117message ClientShareStr { 118 string fl_id = 1; 119 bytes share = 2; 120 int32 index = 3; 121} 122 123message SharesPb { 124 repeated ClientShareStr clientsharestrs = 1; 125} 126 127message KeysPb { 128 repeated bytes key = 1; 129 string timestamp = 2; 130 int32 iter_num = 3; 131 bytes ind_iv = 4; 132 bytes pw_iv = 5; 133 bytes pw_salt = 6; 134 bytes signature = 7; 135 repeated string certificate_chain = 8; 136} 137 138message Prime { 139 bytes prime = 1; 140} 141 142message PBMetadata { 143 oneof value { 144 DeviceMeta device_meta = 1; 145 FLIdToDeviceMeta device_metas = 2; 146 147 FLId fl_id = 3; 148 UpdateModelClientList client_list = 4; 149 150 UpdateModelThreshold update_model_threshold = 5; 151 152 PairClientShares pair_client_shares = 6; 153 ClientShares client_shares = 7; 154 155 PairClientKeys pair_client_keys = 8; 156 ClientKeys client_keys = 9; 157 158 OneClientNoises one_client_noises = 10; 159 ClientNoises client_noises = 11; 160 161 Prime prime = 12; 162 } 163} 164 165message PBMetadataWithName { 166 string name = 1; 167 PBMetadata metadata = 2; 168} 169 170message SyncIterationRequest { 171 // The rank of the server which sends this synchronizing iteration request to the leader server. 172 uint32 rank = 1; 173} 174 175message SyncIterationResponse { 176 // The current iteration number. 177 uint64 iteration = 1; 178} 179 180message PrepareForNextIterRequest { 181 bool is_last_iter_valid = 1; 182 string reason = 2; 183} 184 185message PrepareForNextIterResponse { 186 string result = 1; 187} 188 189message NotifyLeaderMoveToNextIterRequest { 190 uint32 rank = 1; 191 bool is_last_iter_valid = 2; 192 uint64 iter_num = 3; 193 string reason = 4; 194} 195 196message NotifyLeaderMoveToNextIterResponse { 197 string result = 1; 198} 199 200message MoveToNextIterRequest { 201 bool is_last_iter_valid = 1; 202 uint64 last_iter_num = 2; 203 string reason = 3; 204} 205 206message MoveToNextIterResponse { 207 string result = 1; 208} 209 210message EndLastIterRequest { 211 uint64 last_iter_num = 1; 212} 213 214message EndLastIterResponse { 215 string result = 1; 216} 217