diff --git a/crates/libzkp/src/tasks/batch.rs b/crates/libzkp/src/tasks/batch.rs index eb2de6040a..e02b3f073c 100644 --- a/crates/libzkp/src/tasks/batch.rs +++ b/crates/libzkp/src/tasks/batch.rs @@ -35,8 +35,14 @@ pub struct BatchHeaderValidiumWithHash { #[derive(Clone, serde::Deserialize, serde::Serialize)] #[serde(untagged)] pub enum BatchHeaderV { + /// Header for validium mode. Validium(BatchHeaderValidiumWithHash), + /// Header for scroll's STF version v6. V6(BatchHeaderV6), + /// Header for scroll's STF versions v7, v8, v9. + /// + /// Since the codec essentially is unchanged for the above STF versions, we do not define new + /// variants, instead re-using the [`BatchHeaderV7`] variant. V7_8_9(BatchHeaderV7), } @@ -239,6 +245,16 @@ impl BatchProvingTask { (Domain::Scroll, STFVersion::V7) => { ReferenceHeader::V7(*self.batch_header.must_v7_header()) } + // The da-codec for STF versions v7, v8, v9 is identical. In zkvm-prover we do not + // create additional variants to indicate the identical behaviour of codec. Instead we + // add a separate variant for the STF version. + // + // We handle the different STF versions here however build the same batch header since + // that type does not change. The batch header's version byte constructed in the + // coordinator actually defines the STF version (v7, v8 or v9) and we can derive the + // hard-fork (feynman or galileo) and the codec from the version byte. + // + // Refer [`scroll_zkvm_types::public_inputs::Version`]. (Domain::Scroll, STFVersion::V8) | (Domain::Scroll, STFVersion::V9) => { ReferenceHeader::V8(*self.batch_header.must_v8_header()) }