Skip to content

Commit 4bba003

Browse files
committed
fix(zkvms/zkm): Override zkm SDK
The SDK is out of date. A PR is opened: ProjectZKM/zkm-project-template#54 However, its not certain it will be merged soon, so for now this workaround will have to do.
1 parent 91fb361 commit 4bba003

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 1ad671fc0694f28c3c8fe224d33b403bc6be0952 Mon Sep 17 00:00:00 2001
2+
From: Kamen Mladenov <[email protected]>
3+
Date: Fri, 21 Feb 2025 11:33:26 +0200
4+
Subject: [PATCH] chore: Increase DEGREE_BITS_RANGE
5+
6+
After SHA256 precompile was introduced, the DEGREE_BITS_RANGE value was
7+
increased to 12 elements.
8+
https://github.com/zkMIPS/zkm/pull/222
9+
---
10+
sdk/src/local/util.rs | 16 ++++++++++++++--
11+
1 file changed, 14 insertions(+), 2 deletions(-)
12+
13+
diff --git a/sdk/src/local/util.rs b/sdk/src/local/util.rs
14+
index 702ae8b..e389f1e 100644
15+
--- a/sdk/src/local/util.rs
16+
+++ b/sdk/src/local/util.rs
17+
@@ -16,8 +16,20 @@ use zkm_prover::cpu::kernel::assembler::segment_kernel;
18+
use zkm_prover::fixed_recursive_verifier::AllRecursiveCircuits;
19+
use zkm_prover::generation::state::{AssumptionReceipts, Receipt};
20+
21+
-const DEGREE_BITS_RANGE: [Range<usize>; 8] =
22+
- [10..21, 12..22, 11..21, 8..21, 6..21, 6..21, 6..21, 13..23];
23+
+const DEGREE_BITS_RANGE: [Range<usize>; 12] = [
24+
+ 10..21,
25+
+ 12..22,
26+
+ 11..21,
27+
+ 8..21,
28+
+ 6..10,
29+
+ 6..10,
30+
+ 6..16,
31+
+ 6..16,
32+
+ 6..16,
33+
+ 6..16,
34+
+ 6..21,
35+
+ 13..23,
36+
+];
37+
38+
const D: usize = 2;
39+
type C = PoseidonGoldilocksConfig;
40+
--
41+
2.47.0
42+

zkvms/zkm/default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ let
5555
protobuf
5656
metacraft-labs.zkm
5757
];
58+
59+
overrideVendorGitCheckout = ps: drv:
60+
if drv.src.shortRev == "155221d" && builtins.any (p: p.name == "zkm-sdk") ps then
61+
drv.overrideAttrs (_: {
62+
patches = [
63+
./0001-chore-Increase-DEGREE_BITS_RANGE.patch
64+
];
65+
})
66+
else
67+
drv;
5868
};
5969

6070
craneLib = craneLib-default.overrideToolchain metacraft-labs.zkm;

0 commit comments

Comments
 (0)