Skip to content

Commit 7fdc5a6

Browse files
committed
update dep
1 parent 47b9f38 commit 7fdc5a6

File tree

2 files changed

+38
-44
lines changed

2 files changed

+38
-44
lines changed

Cargo.lock

Lines changed: 17 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/libzkp/src/tasks/batch.rs

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ pub struct BatchHeaderValidiumWithHash {
2828

2929
/// Parse header types passed from golang side and adapt to the
3030
/// definition in zkvm-prover's types
31-
/// We distinguish the header type in golang side according to the codec
32-
/// version, i.e. v7 - v9 (current), and validium
33-
/// And adapt it to the corresponding header version used in zkvm-prover's witness
34-
/// definition, i.e. v7- v8 (current), and validium
31+
/// We distinguish the header type in golang side according to the STF
32+
/// version, i.e. v6 - v10 (current), and validium
33+
/// And adapt it to the corresponding batch header type used in zkvm-prover's witness
34+
/// definition, i.e. v6, v7 (current), and validium
3535
#[derive(Clone, serde::Deserialize, serde::Serialize)]
3636
#[serde(untagged)]
3737
#[allow(non_camel_case_types)]
@@ -40,18 +40,18 @@ pub enum BatchHeaderV {
4040
Validium(BatchHeaderValidiumWithHash),
4141
/// Header for scroll's STF version v6.
4242
V6(BatchHeaderV6),
43-
/// Header for scroll's STF versions v7, v8, v9.
43+
/// Header for scroll's STF versions v7 - V10.
4444
///
4545
/// Since the codec essentially is unchanged for the above STF versions, we do not define new
4646
/// variants, instead re-using the [`BatchHeaderV7`] variant.
47-
V7_V8_V9_V10(BatchHeaderV7),
47+
V7_to_V10(BatchHeaderV7),
4848
}
4949

5050
impl core::fmt::Display for BatchHeaderV {
5151
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5252
match self {
5353
BatchHeaderV::V6(_) => write!(f, "V6"),
54-
BatchHeaderV::V7_V8_V9_V10(_) => write!(f, "V7_V8_V9_V10"),
54+
BatchHeaderV::V7_to_V10(_) => write!(f, "V7 - V10"),
5555
BatchHeaderV::Validium(_) => write!(f, "Validium"),
5656
}
5757
}
@@ -61,26 +61,29 @@ impl BatchHeaderV {
6161
pub fn batch_hash(&self) -> B256 {
6262
match self {
6363
BatchHeaderV::V6(h) => h.batch_hash(),
64-
BatchHeaderV::V7_V8_V9_V10(h) => h.batch_hash(),
64+
BatchHeaderV::V7_to_V10(h) => h.batch_hash(),
6565
BatchHeaderV::Validium(h) => h.header.batch_hash(),
6666
}
6767
}
6868

69-
pub fn must_v6_header(&self) -> &BatchHeaderV6 {
69+
pub fn to_zkvm_batch_header_v6(&self) -> &BatchHeaderV6 {
7070
match self {
7171
BatchHeaderV::V6(h) => h,
7272
_ => unreachable!("A header of {} is considered to be v6", self),
7373
}
7474
}
7575

76-
pub fn must_v7_v8_v9_v10header(&self) -> &BatchHeaderV7 {
76+
pub fn to_zkvm_batch_header_v7_to_v9(&self) -> &BatchHeaderV7 {
7777
match self {
78-
BatchHeaderV::V7_V8_V9_V10(h) => h,
79-
_ => unreachable!("A header of {} is considered to be in [v7, v8, v9]", self),
78+
BatchHeaderV::V7_to_V10(h) => h,
79+
_ => unreachable!(
80+
"A header of {} is considered to be in [v7, v8, v9, v10]",
81+
self
82+
),
8083
}
8184
}
8285

83-
pub fn must_validium_header(&self) -> &BatchHeaderValidium {
86+
pub fn to_zkvm_batch_header_validium(&self) -> &BatchHeaderValidium {
8487
match self {
8588
BatchHeaderV::Validium(h) => &h.header,
8689
_ => unreachable!("A header of {} is considered to be validium", self),
@@ -154,11 +157,11 @@ impl BatchProvingTask {
154157
version.fork,
155158
ForkName::EuclidV1,
156159
),
157-
BatchHeaderV::V7_V8_V9_V10(_) => assert!(
160+
BatchHeaderV::V7_to_V10(_) => assert!(
158161
matches!(version.fork, ForkName::EuclidV2 | ForkName::Feynman | ForkName::Galileo | ForkName::GalileoV2),
159162
"hardfork mismatch for da-codec@v7/8/9 header: found={}, expected={:?}",
160163
version.fork,
161-
[ForkName::EuclidV2, ForkName::Feynman, ForkName::Galileo],
164+
[ForkName::EuclidV2, ForkName::Feynman, ForkName::Galileo, ForkName::GalileoV2],
162165
),
163166
}
164167

@@ -228,7 +231,7 @@ impl BatchProvingTask {
228231

229232
let reference_header = match (version.domain, version.stf_version) {
230233
(Domain::Scroll, STFVersion::V6) => {
231-
ReferenceHeader::V6(*self.batch_header.must_v6_header())
234+
ReferenceHeader::V6(*self.batch_header.to_zkvm_batch_header_v6())
232235
}
233236
// The da-codec for STF versions v7, v8, v9 is identical. In zkvm-prover we do not
234237
// create additional variants to indicate the identical behaviour of codec. Instead we
@@ -243,9 +246,9 @@ impl BatchProvingTask {
243246
(
244247
Domain::Scroll,
245248
STFVersion::V7 | STFVersion::V8 | STFVersion::V9 | STFVersion::V10,
246-
) => ReferenceHeader::V7_V8_V9(*self.batch_header.must_v7_v8_v9_v10header()),
249+
) => ReferenceHeader::V7_V8_V9(*self.batch_header.to_zkvm_batch_header_v7_to_v9()),
247250
(Domain::Validium, STFVersion::V1) => {
248-
ReferenceHeader::Validium(*self.batch_header.must_validium_header())
251+
ReferenceHeader::Validium(*self.batch_header.to_zkvm_batch_header_validium())
249252
}
250253
(domain, stf_version) => {
251254
unreachable!("unsupported domain={domain:?},stf-version={stf_version:?}")

0 commit comments

Comments
 (0)