-
Notifications
You must be signed in to change notification settings - Fork 294
/
registry.subnet.v1.rs
497 lines (497 loc) · 22.9 KB
/
registry.subnet.v1.rs
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
/// A subnet: A logical group of nodes that run consensus
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubnetRecord {
#[prost(bytes = "vec", repeated, tag = "3")]
pub membership: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Maximum amount of bytes per message. This is a hard cap, which means
/// ingress messages greater than the limit will be dropped.
#[prost(uint64, tag = "5")]
pub max_ingress_bytes_per_message: u64,
/// Unit delay for blockmaker (in milliseconds).
#[prost(uint64, tag = "7")]
pub unit_delay_millis: u64,
/// Initial delay for notary (in milliseconds), to give time to rank-0 block
/// propagation.
#[prost(uint64, tag = "8")]
pub initial_notary_delay_millis: u64,
/// ID of the Replica version to run
#[prost(string, tag = "9")]
pub replica_version_id: ::prost::alloc::string::String,
/// The length of all DKG intervals. The DKG interval length is the number of rounds following the DKG summary.
#[prost(uint64, tag = "10")]
pub dkg_interval_length: u64,
/// Gossip Config
#[prost(message, optional, tag = "13")]
pub gossip_config: ::core::option::Option<GossipConfig>,
/// If set to yes, the subnet starts as a (new) NNS
#[prost(bool, tag = "14")]
pub start_as_nns: bool,
/// The type of subnet.
#[prost(enumeration = "SubnetType", tag = "15")]
pub subnet_type: i32,
/// The upper bound for the number of dealings we allow in a block.
#[prost(uint64, tag = "16")]
pub dkg_dealings_per_block: u64,
/// If `true`, the subnet will be halted: it will no longer create or execute blocks.
#[prost(bool, tag = "17")]
pub is_halted: bool,
/// Max number of ingress messages per block.
#[prost(uint64, tag = "18")]
pub max_ingress_messages_per_block: u64,
/// The maximum combined size of the ingress and xnet messages that fit into a block.
#[prost(uint64, tag = "19")]
pub max_block_payload_size: u64,
/// The maximum number of instructions a message can execute.
/// See the comments in `subnet_config.rs` for more details.
#[prost(uint64, tag = "20")]
pub max_instructions_per_message: u64,
/// The maximum number of instructions a round can execute.
/// See the comments in `subnet_config.rs` for more details.
#[prost(uint64, tag = "21")]
pub max_instructions_per_round: u64,
/// The maximum number of instructions an `install_code` message can execute.
/// See the comments in `subnet_config.rs` for more details.
#[prost(uint64, tag = "22")]
pub max_instructions_per_install_code: u64,
/// Information on whether a feature is supported by this subnet.
#[prost(message, optional, tag = "23")]
pub features: ::core::option::Option<SubnetFeatures>,
/// The maximum number of canisters that may be present on the subnet at any given time.
///
/// A value of 0 is equivalent to setting no limit. This also provides an easy way
/// to maintain compatibility of different versions of replica and registry.
#[prost(uint64, tag = "24")]
pub max_number_of_canisters: u64,
/// The list of public keys whose owners have "readonly" SSH access to all replicas on this subnet,
/// in case it is necessary to perform subnet recovery.
#[prost(string, repeated, tag = "25")]
pub ssh_readonly_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The list of public keys whose owners have "backup" SSH access to nodes on the NNS subnet
/// to make sure the NNS can be backed up.
#[prost(string, repeated, tag = "26")]
pub ssh_backup_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// ECDSA Config. This field cannot be set back to `None` once it has been set
/// to `Some`. To remove a key, the list of `key_ids` can be set to not include a particular key.
/// If a removed key is not held by another subnet, it will be lost.
#[prost(message, optional, tag = "27")]
pub ecdsa_config: ::core::option::Option<EcdsaConfig>,
/// If `true`, the subnet will be halted after reaching the next cup height: it will no longer
/// create or execute blocks.
///
/// Note: this flag is reset automatically when a new CUP proposal is approved. When that
/// happens, the `is_halted` flag is set to `true`, so the Subnet remains halted until an
/// appropriate proposal which sets `is_halted` to `false` is approved.
#[prost(bool, tag = "28")]
pub halt_at_cup_height: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EcdsaInitialization {
#[prost(message, optional, tag = "1")]
pub key_id: ::core::option::Option<super::super::crypto::v1::EcdsaKeyId>,
#[prost(message, optional, tag = "2")]
pub dealings: ::core::option::Option<InitialIDkgDealings>,
}
/// Contains the initial DKG transcripts for the subnet and materials to construct a base CUP (i.e.
/// a CUP with no dependencies on previous CUPs or blocks). Such CUP materials can be used to
/// construct the genesis CUP or a recovery CUP in the event of a subnet stall.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CatchUpPackageContents {
/// Initial non-interactive low-threshold DKG transcript
#[prost(message, optional, tag = "1")]
pub initial_ni_dkg_transcript_low_threshold:
::core::option::Option<InitialNiDkgTranscriptRecord>,
/// Initial non-interactive high-threshold DKG transcript
#[prost(message, optional, tag = "2")]
pub initial_ni_dkg_transcript_high_threshold:
::core::option::Option<InitialNiDkgTranscriptRecord>,
/// The blockchain height that the CUP should have
#[prost(uint64, tag = "3")]
pub height: u64,
/// Block time for the CUP's block
#[prost(uint64, tag = "4")]
pub time: u64,
/// The hash of the state that the subnet should use
#[prost(bytes = "vec", tag = "5")]
pub state_hash: ::prost::alloc::vec::Vec<u8>,
/// A uri from which data to replace the registry local store should be downloaded
#[prost(message, optional, tag = "6")]
pub registry_store_uri: ::core::option::Option<RegistryStoreUri>,
/// / The initial ECDSA dealings for boot strapping target subnets.
#[prost(message, repeated, tag = "7")]
pub ecdsa_initializations: ::prost::alloc::vec::Vec<EcdsaInitialization>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegistryStoreUri {
/// / The uri at which the registry store data should be retrieved. The data
/// / must be provided as gzipped tar archive
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
/// / A SHA-256, hex encoded hash of the contents of the data stored at the
/// / provided URI
#[prost(string, tag = "2")]
pub hash: ::prost::alloc::string::String,
/// / The registry version that should be used for the catch up package contents
#[prost(uint64, tag = "3")]
pub registry_version: u64,
}
/// Contains information pertaining to all subnets in the IC and their params.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubnetListRecord {
/// A list of subnet ids of all subnets present in this instance of the IC.
#[prost(bytes = "vec", repeated, tag = "2")]
pub subnets: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Initial non-interactive DKG transcript record
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitialNiDkgTranscriptRecord {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<super::super::super::types::v1::NiDkgId>,
#[prost(uint32, tag = "2")]
pub threshold: u32,
#[prost(bytes = "vec", repeated, tag = "3")]
pub committee: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(uint64, tag = "4")]
pub registry_version: u64,
#[prost(bytes = "vec", tag = "5")]
pub internal_csp_transcript: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IDkgTranscriptId {
#[prost(uint64, tag = "1")]
pub id: u64,
#[prost(message, optional, tag = "2")]
pub subnet_id: ::core::option::Option<super::super::super::types::v1::SubnetId>,
#[prost(uint64, tag = "3")]
pub source_height: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifiedIDkgDealing {
#[prost(uint32, tag = "1")]
pub dealer_index: u32,
#[prost(message, optional, tag = "6")]
pub signed_dealing_tuple: ::core::option::Option<IDkgSignedDealingTuple>,
#[prost(message, repeated, tag = "7")]
pub support_tuples: ::prost::alloc::vec::Vec<SignatureTuple>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IDkgTranscript {
#[prost(message, optional, tag = "1")]
pub transcript_id: ::core::option::Option<IDkgTranscriptId>,
#[prost(message, repeated, tag = "2")]
pub dealers: ::prost::alloc::vec::Vec<super::super::super::types::v1::NodeId>,
#[prost(message, repeated, tag = "3")]
pub receivers: ::prost::alloc::vec::Vec<super::super::super::types::v1::NodeId>,
#[prost(uint64, tag = "4")]
pub registry_version: u64,
#[prost(message, repeated, tag = "5")]
pub verified_dealings: ::prost::alloc::vec::Vec<VerifiedIDkgDealing>,
/// CBOR serialized IDkgTranscriptType
#[prost(bytes = "vec", tag = "6")]
pub transcript_type: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "super::super::crypto::v1::AlgorithmId", tag = "7")]
pub algorithm_id: i32,
/// serialised InternalRawTranscript
#[prost(bytes = "vec", tag = "8")]
pub raw_transcript: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DealerTuple {
#[prost(message, optional, tag = "1")]
pub dealer_id: ::core::option::Option<super::super::super::types::v1::NodeId>,
#[prost(uint32, tag = "2")]
pub dealer_index: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignatureTuple {
#[prost(message, optional, tag = "1")]
pub signer: ::core::option::Option<super::super::super::types::v1::NodeId>,
#[prost(bytes = "vec", tag = "2")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IDkgTranscriptParams {
#[prost(message, optional, tag = "1")]
pub transcript_id: ::core::option::Option<IDkgTranscriptId>,
#[prost(message, repeated, tag = "2")]
pub dealers: ::prost::alloc::vec::Vec<DealerTuple>,
#[prost(message, repeated, tag = "3")]
pub receivers: ::prost::alloc::vec::Vec<super::super::super::types::v1::NodeId>,
#[prost(uint64, tag = "4")]
pub registry_version: u64,
#[prost(enumeration = "super::super::crypto::v1::AlgorithmId", tag = "5")]
pub algorithm_id: i32,
#[prost(enumeration = "IDkgTranscriptOperation", tag = "6")]
pub idkg_transcript_operation: i32,
/// 0, 1, or 2 IDkgTranscripts
#[prost(message, repeated, tag = "7")]
pub idkg_transcript_operation_args: ::prost::alloc::vec::Vec<IDkgTranscript>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IDkgDealing {
#[prost(message, optional, tag = "1")]
pub transcript_id: ::core::option::Option<IDkgTranscriptId>,
/// serialised InternalRawDealing
#[prost(bytes = "vec", tag = "2")]
pub raw_dealing: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IDkgSignedDealingTuple {
#[prost(message, optional, tag = "1")]
pub dealer: ::core::option::Option<super::super::super::types::v1::NodeId>,
#[prost(message, optional, tag = "2")]
pub dealing: ::core::option::Option<IDkgDealing>,
#[prost(bytes = "vec", tag = "3")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitialIDkgDealings {
#[prost(uint32, tag = "1")]
pub version: u32,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<IDkgTranscriptParams>,
#[prost(message, repeated, tag = "4")]
pub signed_dealings: ::prost::alloc::vec::Vec<IDkgSignedDealingTuple>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtendedDerivationPath {
#[prost(message, optional, tag = "1")]
pub caller: ::core::option::Option<super::super::super::types::v1::PrincipalId>,
#[prost(bytes = "vec", repeated, tag = "2")]
pub derivation_path: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Per subnet P2P configuration
/// Note: protoc is mangling the name P2PConfig to P2pConfig
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GossipConfig {
/// max outstanding request per peer MIN/DEFAULT/MAX 1/20/200
#[prost(uint32, tag = "1")]
pub max_artifact_streams_per_peer: u32,
/// timeout for a outstanding request 3_000/15_000/180_000
#[prost(uint32, tag = "2")]
pub max_chunk_wait_ms: u32,
/// max duplicate requests in underutilized networks 1/28/6000
#[prost(uint32, tag = "3")]
pub max_duplicity: u32,
/// maximum chunk size supported on this subnet 1024/4096/131_072
#[prost(uint32, tag = "4")]
pub max_chunk_size: u32,
/// history size for receive check 1_000/5_000/30_000
#[prost(uint32, tag = "5")]
pub receive_check_cache_size: u32,
/// period for re evaluating the priority function. 1_000/3_000/30_000
#[prost(uint32, tag = "6")]
pub pfn_evaluation_period_ms: u32,
/// period for polling the registry for updates 1_000/3_000/30_000
#[prost(uint32, tag = "7")]
pub registry_poll_period_ms: u32,
/// period for sending a retransmission request
///
/// config for advert distribution.
#[prost(uint32, tag = "8")]
pub retransmission_request_ms: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubnetFeatures {
/// This feature flag controls whether canister execution happens
/// in sandboxed process or not. It is disabled by default.
#[prost(bool, tag = "2")]
pub canister_sandboxing: bool,
/// This feature flag controls whether canisters of this subnet are capable of
/// performing http(s) requests to the web2.
#[prost(bool, tag = "3")]
pub http_requests: bool,
/// Status of the SEV-SNP feature.
#[prost(enumeration = "SevFeatureStatus", optional, tag = "7")]
pub sev_status: ::core::option::Option<i32>,
/// Controls whether to collect/publish data to the onchain observability canister
#[prost(bool, optional, tag = "8")]
pub onchain_observability: ::core::option::Option<bool>,
}
/// Per subnet ECDSA configuration
#[derive(serde::Serialize, serde::Deserialize, candid::CandidType, Eq)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EcdsaConfig {
/// Number of quadruples to create in advance.
#[prost(uint32, tag = "1")]
pub quadruples_to_create_in_advance: u32,
/// Identifiers for threshold ECDSA keys held by the subnet.
#[prost(message, repeated, tag = "3")]
pub key_ids: ::prost::alloc::vec::Vec<super::super::crypto::v1::EcdsaKeyId>,
/// The maximum number of signature requests that can be enqueued at once.
#[prost(uint32, tag = "4")]
pub max_queue_size: u32,
/// Signature requests will timeout after the given number of nano seconds.
#[prost(uint64, optional, tag = "5")]
pub signature_request_timeout_ns: ::core::option::Option<u64>,
/// Key rotation period of a single node in milliseconds.
/// If none is specified key rotation is disabled.
#[prost(uint64, optional, tag = "6")]
pub idkg_key_rotation_period_ms: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IDkgTranscriptOperation {
Unspecified = 0,
Random = 1,
ReshareOfMasked = 2,
ReshareOfUnmasked = 3,
UnmaskedTimesMasked = 4,
}
impl IDkgTranscriptOperation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
IDkgTranscriptOperation::Unspecified => "I_DKG_TRANSCRIPT_OPERATION_UNSPECIFIED",
IDkgTranscriptOperation::Random => "I_DKG_TRANSCRIPT_OPERATION_RANDOM",
IDkgTranscriptOperation::ReshareOfMasked => {
"I_DKG_TRANSCRIPT_OPERATION_RESHARE_OF_MASKED"
}
IDkgTranscriptOperation::ReshareOfUnmasked => {
"I_DKG_TRANSCRIPT_OPERATION_RESHARE_OF_UNMASKED"
}
IDkgTranscriptOperation::UnmaskedTimesMasked => {
"I_DKG_TRANSCRIPT_OPERATION_UNMASKED_TIMES_MASKED"
}
}
}
}
/// Represents the type of subnet. Subnets of different type might exhibit different
/// behavior, e.g. being more restrictive in what operations are allowed or privileged
/// compared to other subnet types.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SubnetType {
Unspecified = 0,
/// A normal subnet where no restrictions are applied.
Application = 1,
/// A more privileged subnet where certain restrictions are applied,
/// like not charging for cycles or restricting who can create and
/// install canisters on it.
System = 2,
/// A subnet type that is like application subnets but can have some
/// additional features.
VerifiedApplication = 4,
}
impl SubnetType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SubnetType::Unspecified => "SUBNET_TYPE_UNSPECIFIED",
SubnetType::Application => "SUBNET_TYPE_APPLICATION",
SubnetType::System => "SUBNET_TYPE_SYSTEM",
SubnetType::VerifiedApplication => "SUBNET_TYPE_VERIFIED_APPLICATION",
}
}
}
/// These modes correspond to milestones in the SEV-SNP development plan.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SevFeatureStatus {
/// The SEV-SNP feature is disabled.
///
/// SEV-SNP enabled machines run the Guest without SEV-SNP.
///
/// Warning: transitioning from SEV_FEATURE_STATUS_SECURE_ENABLED will result loss of all data.
Unspecified = 0,
/// The SEV-SNP feature is enabled in insecure mode.
///
/// SEV-SNP enabled machines run the Guest with SEV-SNP but without disk integrity protection
/// and storing the KEK (Key Encryption Key) in cleartext.
///
/// Warning: transitioning from any mode other than SEV_FEATURE_STATUS_UNSPECIFIED will result
/// in loss of all data.
InsecureEnabled = 1,
/// The SEV-SNP feature is enabled in insecure mode with disk integrity protection.
///
/// SEV-SNP enabled machines run the Guest with SEV-SNP but with disk integrity protection
/// and storing the KEK (Key Encryption Key) in cleartext.
///
/// Warning: transitioning to or from this mode will result loss of all data.
InsecureIntegrityEnabled = 2,
/// The SEV-SNP feature is enabled in secure mode with disk integrity protection.
///
/// SEV-SNP enabled machines run the Guest with SEV-SNP with disk integrty protection
/// and the KEK (Key Encryption Key) is derived from the measurement. Upgrades result
/// in the loss of all data as the KEK is not passed to the new Guest.
///
/// Warning: transitioning to or from this mode except for SEV_FEATURE_STATUS_SECURE_ENABLED
/// will resut in loss of all data.
SecureNoUpgradeEnabled = 3,
/// The SEV-SNP feature is enabled in secure mode with disk integrity protection.
///
/// SEV-SNP enabled machines run the Guest with SEV-SNP with disk integrty protection
/// and the KEK (Key Encryption Key) is derived from the measurement. Upgrades do not
/// result in the loss of data as the KEK is passed to the new Guest.
///
/// Warning: transitioning to or from this mode except for SEV_FEATURE_STATUS_SECURE_NO_UPGRADE_ENABLED
/// will result in loss of all data.
SecureEnabled = 4,
}
impl SevFeatureStatus {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SevFeatureStatus::Unspecified => "SEV_FEATURE_STATUS_UNSPECIFIED",
SevFeatureStatus::InsecureEnabled => "SEV_FEATURE_STATUS_INSECURE_ENABLED",
SevFeatureStatus::InsecureIntegrityEnabled => {
"SEV_FEATURE_STATUS_INSECURE_INTEGRITY_ENABLED"
}
SevFeatureStatus::SecureNoUpgradeEnabled => {
"SEV_FEATURE_STATUS_SECURE_NO_UPGRADE_ENABLED"
}
SevFeatureStatus::SecureEnabled => "SEV_FEATURE_STATUS_SECURE_ENABLED",
}
}
}