Skip to content

Commit f064832

Browse files
authored
chore: add inline-docs for avoiding confusion (#1754)
1 parent aac3929 commit f064832

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

crates/libzkp/src/tasks/batch.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ pub struct BatchHeaderValidiumWithHash {
3535
#[derive(Clone, serde::Deserialize, serde::Serialize)]
3636
#[serde(untagged)]
3737
pub enum BatchHeaderV {
38+
/// Header for validium mode.
3839
Validium(BatchHeaderValidiumWithHash),
40+
/// Header for scroll's STF version v6.
3941
V6(BatchHeaderV6),
42+
/// Header for scroll's STF versions v7, v8, v9.
43+
///
44+
/// Since the codec essentially is unchanged for the above STF versions, we do not define new
45+
/// variants, instead re-using the [`BatchHeaderV7`] variant.
4046
V7_8_9(BatchHeaderV7),
4147
}
4248

@@ -239,6 +245,16 @@ impl BatchProvingTask {
239245
(Domain::Scroll, STFVersion::V7) => {
240246
ReferenceHeader::V7(*self.batch_header.must_v7_header())
241247
}
248+
// The da-codec for STF versions v7, v8, v9 is identical. In zkvm-prover we do not
249+
// create additional variants to indicate the identical behaviour of codec. Instead we
250+
// add a separate variant for the STF version.
251+
//
252+
// We handle the different STF versions here however build the same batch header since
253+
// that type does not change. The batch header's version byte constructed in the
254+
// coordinator actually defines the STF version (v7, v8 or v9) and we can derive the
255+
// hard-fork (feynman or galileo) and the codec from the version byte.
256+
//
257+
// Refer [`scroll_zkvm_types::public_inputs::Version`].
242258
(Domain::Scroll, STFVersion::V8) | (Domain::Scroll, STFVersion::V9) => {
243259
ReferenceHeader::V8(*self.batch_header.must_v8_header())
244260
}

0 commit comments

Comments
 (0)