Skip to content

Commit d578f6d

Browse files
committed
fix doc comment
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent 737c918 commit d578f6d

File tree

4 files changed

+37
-39
lines changed

4 files changed

+37
-39
lines changed

modules/lcp-client/src/client_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl LCPClient {
352352

353353
/// check_and_update_tcb_evaluation_data_number checks if the current or next TCB evaluation data number update is required.
354354
///
355-
/// The update logic aligns strictly with the proto definition in `LCP.proto`:
355+
/// The update logic aligns strictly with the proto definition in `proto/definitions/ibc/lightclients/lcp/v1/lcp.proto`:
356356
/// - If the reserved next number's update time has arrived, it immediately replaces the current number.
357357
/// - Observing a number greater than the current number triggers updates depending on the configured grace period:
358358
/// - Zero grace period: Immediate update; no next number reserved.

proto/definitions/ibc/lightclients/lcp/v1/lcp.proto

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ message ClientState {
5858

5959
// The `key_expiration` is used to determine the validity period of the EK.
6060
//
61-
// Calculation logic differs slightly between IAS and DCAP:
61+
// The logic for calculating EK validity periods slightly differs between IAS and DCAP:
6262
//
6363
// IAS:
6464
// - This value must be greater than 0.
@@ -70,7 +70,7 @@ message ClientState {
7070
// min(`qv_output.validity.not_before` + key_expiration, `output.validity.not_after`)
7171
//
7272
// Considerations:
73-
// - Operators should fetch the latest collateral from PCS to ensure the EK validity starts close to the current time.
73+
// - Operators should fetch the latest collateral from Intel Provisioning Certification Service (PCS) to ensure the EK validity starts close to the current time.
7474
// - When the EK expires and the TCB evaluation data number has been updated, operators might not be immediately ready
7575
// to operate with the newly accepted TCB status, resulting in availability risks.
7676
// To mitigate this risk, operators should set an appropriate `tcb_evaluation_data_number_update_grace_period`.
@@ -103,7 +103,7 @@ message ClientState {
103103
// If this field is empty, operator signatures are not required, allowing any entity to act as an operator.
104104
//
105105
// Operational assumptions:
106-
// - At least one operator (incl. actors not included in `operators`) is expected to promptly reference and report the latest TCB evaluation data number.
106+
// - At least one operator (including entities not listed in the `operators` field) is expected to promptly reference and report the latest TCB evaluation data number.
107107
// - If no operator promptly reports the latest TCB number, the client continues accepting attestations based on outdated collateral for up to 12 months.
108108
// - Not all operators may immediately prepare an SGX environment compatible with the latest TCB level.
109109
// - The `tcb_evaluation_data_number_update_grace_period` ensures that all operators have a guaranteed minimum period to update their SGX environments, maintaining overall availability.
@@ -123,21 +123,18 @@ message ClientState {
123123
// The client only accepts the zkDCAP output generated using collateral with a TCB evaluation data number equal to or greater than this number.
124124
uint32 current_tcb_evaluation_data_number = 11;
125125

126-
// The grace period for updating to the latest TCB evaluation data number (in seconds)
126+
// The grace period (in seconds) for operators to update their SGX environments to support a newly observed TCB evaluation data number.
127127
//
128128
// Notes:
129129
// - A shorter grace period could increase availability risk if operators are not given sufficient time
130130
// to prepare the new SGX environment compatible with the updated TCB level.
131131
// - Conversely, a longer grace period could delay the adoption of the latest TCB level, potentially increasing security risks.
132132
// - Operators must carefully consider their operational preparation needs and security posture when configuring this value.
133133
//
134-
// Relationship among `tcb_evaluation_data_number_update_grace_period`,
135-
// `next_tcb_evaluation_data_number`, and `next_tcb_evaluation_data_number_update_time`:
136-
//
137-
// When a new TCB evaluation data number greater than the current one is observed:
134+
// When a new TCB evaluation data number greater than the current number is observed:
138135
//
139136
// - If the grace period is zero:
140-
// - The current TCB evaluation data number is updated immediately.
137+
// - The current number is updated immediately.
141138
//
142139
// - If the grace period is non-zero:
143140
// - The new number is reserved as `next_tcb_evaluation_data_number`.
@@ -153,8 +150,8 @@ message ClientState {
153150
// - Immediate activation of newly observed number, preserving the reserved next number.
154151
//
155152
// These edge cases can occur due to excessively long grace periods or frequent TCB Recovery Events occurring within shorter intervals than the typical 6-month update frequency.
156-
// However, since we assume that the operators can prepare for non-latest TCB, the practical availability impact of these edge cases is considered limited.
157-
// In addition, given a well-configured grace period aligned with typical TCB update intervals, the client will never skip the grace period for the each TCB number.
153+
// Note that we assume operators can maintain an appropriate TCB status based on previous TCB collateral. Therefore, we expect that immediate updates in these edge cases do not cause operational issues.
154+
// Additionally, with a well-configured grace period aligned with typical TCB update intervals, the client will never skip the configured grace period for any TCB number update.
158155
uint32 tcb_evaluation_data_number_update_grace_period = 12;
159156

160157
// Next TCB evaluation data number scheduled to be updated
@@ -174,15 +171,17 @@ message ClientState {
174171

175172
// Contains verifier-specific information for zkDCAP proofs.
176173
//
177-
// The format is as follows:
178-
// 0: zkVM type
179-
// 1-N: arbitrary data for each zkVM type
174+
// Data format:
175+
// - First byte (0): zkVM type identifier.
176+
// - Remaining bytes (1–N): zkVM-specific data.
177+
//
178+
// Currently, only RISC Zero zkVM (type=1) is supported, with the following format:
180179
//
181-
// Currently, only RISC Zero zkVM (type=1) is supported.
182-
// The format of the risc0 zkVM is as follows:
183-
// | 0 | 1 - 31 | 32 - 64 |
184-
// |---|----------|-----------|
185-
// | 1 | reserved | image id |
180+
// | Byte(s) | Description |
181+
// |---------|-----------------------------|
182+
// | 0 | zkVM type (fixed as 1) |
183+
// | 1–31 | Reserved (set as zero) |
184+
// | 32–63 | Image ID |
186185
repeated bytes zkdcap_verifier_infos = 15;
187186
}
188187

proto/src/descriptor.bin

152 Bytes
Binary file not shown.

proto/src/prost/ibc.lightclients.lcp.v1.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct ClientState {
7070
pub mrenclave: ::prost::alloc::vec::Vec<u8>,
7171
/// The `key_expiration` is used to determine the validity period of the EK.
7272
///
73-
/// Calculation logic differs slightly between IAS and DCAP:
73+
/// The logic for calculating EK validity periods slightly differs between IAS and DCAP:
7474
///
7575
/// IAS:
7676
/// - This value must be greater than 0.
@@ -82,7 +82,7 @@ pub struct ClientState {
8282
/// min(`qv_output.validity.not_before` + key_expiration, `output.validity.not_after`)
8383
///
8484
/// Considerations:
85-
/// - Operators should fetch the latest collateral from PCS to ensure the EK validity starts close to the current time.
85+
/// - Operators should fetch the latest collateral from Intel Provisioning Certification Service (PCS) to ensure the EK validity starts close to the current time.
8686
/// - When the EK expires and the TCB evaluation data number has been updated, operators might not be immediately ready
8787
/// to operate with the newly accepted TCB status, resulting in availability risks.
8888
/// To mitigate this risk, operators should set an appropriate `tcb_evaluation_data_number_update_grace_period`.
@@ -117,7 +117,7 @@ pub struct ClientState {
117117
/// If this field is empty, operator signatures are not required, allowing any entity to act as an operator.
118118
///
119119
/// Operational assumptions:
120-
/// - At least one operator (incl. actors not included in `operators`) is expected to promptly reference and report the latest TCB evaluation data number.
120+
/// - At least one operator (including entities not listed in the `operators` field) is expected to promptly reference and report the latest TCB evaluation data number.
121121
/// - If no operator promptly reports the latest TCB number, the client continues accepting attestations based on outdated collateral for up to 12 months.
122122
/// - Not all operators may immediately prepare an SGX environment compatible with the latest TCB level.
123123
/// - The `tcb_evaluation_data_number_update_grace_period` ensures that all operators have a guaranteed minimum period to update their SGX environments, maintaining overall availability.
@@ -137,21 +137,18 @@ pub struct ClientState {
137137
/// The client only accepts the zkDCAP output generated using collateral with a TCB evaluation data number equal to or greater than this number.
138138
#[prost(uint32, tag = "11")]
139139
pub current_tcb_evaluation_data_number: u32,
140-
/// The grace period for updating to the latest TCB evaluation data number (in seconds)
140+
/// The grace period (in seconds) for operators to update their SGX environments to support a newly observed TCB evaluation data number.
141141
///
142142
/// Notes:
143143
/// - A shorter grace period could increase availability risk if operators are not given sufficient time
144144
/// to prepare the new SGX environment compatible with the updated TCB level.
145145
/// - Conversely, a longer grace period could delay the adoption of the latest TCB level, potentially increasing security risks.
146146
/// - Operators must carefully consider their operational preparation needs and security posture when configuring this value.
147147
///
148-
/// Relationship among `tcb_evaluation_data_number_update_grace_period`,
149-
/// `next_tcb_evaluation_data_number`, and `next_tcb_evaluation_data_number_update_time`:
150-
///
151-
/// When a new TCB evaluation data number greater than the current one is observed:
148+
/// When a new TCB evaluation data number greater than the current number is observed:
152149
///
153150
/// - If the grace period is zero:
154-
/// - The current TCB evaluation data number is updated immediately.
151+
/// - The current number is updated immediately.
155152
///
156153
/// - If the grace period is non-zero:
157154
/// - The new number is reserved as `next_tcb_evaluation_data_number`.
@@ -167,8 +164,8 @@ pub struct ClientState {
167164
/// - Immediate activation of newly observed number, preserving the reserved next number.
168165
///
169166
/// These edge cases can occur due to excessively long grace periods or frequent TCB Recovery Events occurring within shorter intervals than the typical 6-month update frequency.
170-
/// However, since we assume that the operators can prepare for non-latest TCB, the practical availability impact of these edge cases is considered limited.
171-
/// In addition, given a well-configured grace period aligned with typical TCB update intervals, the client will never skip the grace period for the each TCB number.
167+
/// Note that we assume operators can maintain an appropriate TCB status based on previous TCB collateral. Therefore, we expect that immediate updates in these edge cases do not cause operational issues.
168+
/// Additionally, with a well-configured grace period aligned with typical TCB update intervals, the client will never skip the configured grace period for any TCB number update.
172169
#[prost(uint32, tag = "12")]
173170
pub tcb_evaluation_data_number_update_grace_period: u32,
174171
/// Next TCB evaluation data number scheduled to be updated
@@ -188,15 +185,17 @@ pub struct ClientState {
188185
pub next_tcb_evaluation_data_number_update_time: u64,
189186
/// Contains verifier-specific information for zkDCAP proofs.
190187
///
191-
/// The format is as follows:
192-
/// 0: zkVM type
193-
/// 1-N: arbitrary data for each zkVM type
188+
/// Data format:
189+
/// - First byte (0): zkVM type identifier.
190+
/// - Remaining bytes (1–N): zkVM-specific data.
191+
///
192+
/// Currently, only RISC Zero zkVM (type=1) is supported, with the following format:
194193
///
195-
/// Currently, only RISC Zero zkVM (type=1) is supported.
196-
/// The format of the risc0 zkVM is as follows:
197-
/// | 0 | 1 - 31 | 32 - 64 |
198-
/// |---|----------|-----------|
199-
/// | 1 | reserved | image id |
194+
/// | Byte(s) | Description |
195+
/// |---------|-----------------------------|
196+
/// | 0 | zkVM type (fixed as 1) |
197+
/// | 1–31 | Reserved (set as zero) |
198+
/// | 32–63 | Image ID |
200199
#[prost(bytes = "vec", repeated, tag = "15")]
201200
pub zkdcap_verifier_infos: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
202201
}

0 commit comments

Comments
 (0)