Skip to content

chore: upgrade ziren to v2.0 - #22

Closed
eigmax wants to merge 3 commits into
mainfrom
chore/ziren-v2
Closed

eigmax wants to merge 3 commits into
mainfrom
chore/ziren-v2

Conversation

@eigmax

@eigmax eigmax commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Moves the GOAT client (main) from Ziren v1.2.7 to Ziren's default branch (main, 2.0.0). The provers now run 2.0.0 and no longer accept v1.2.7.

  • The host crates (zkm-build, zkm-core-executor, zkm-prover, zkm-sdk) and the guest's zkm-zkvm are plain git dependencies on Ziren's default branch, with no tag, branch or [patch]. This is the same form the stateless (EthProofs) branch uses.
  • The precompile patches move from their -ziren-1.2.7 tags to their branches, and kzg-rs to patch-0.2.7 without default features. The forks' branch tips declare zkm-lib/zkm-zkvm at Ziren tag v1.2.7, which would put a second zkm-zkvm into the guest (duplicate #[global_allocator]). The lockfiles therefore pin the commits just before that tag was added, whose only difference is the untagged Ziren dependency: bn aba71380, k256 8266b228, p256 a6f1a1fb, alloy-primitives 59313700, kzg-rs 855ea697, bls12_381 bcf93974. These are the same commits stateless locks. Both lockfiles hold one Ziren source. A cargo update of a fork would move it back to the tagged tip; giving the forks Ziren-2.0 branches or tags would remove that pin.
  • zkm-build 2.0 compiles the guest with the zkm toolchain on its own (ZKM_GUEST_TOOLCHAIN overrides it), so the host no longer has to be built under that toolchain.
  • The report CSV header listed accrue_logs_bloom_cycles_count, but the record never carried a value for it. The host therefore exited with a CSV error after every successful execution when the report file was new. This already happens on main with v1.2.7.

Cached blocks executed in the zkVM (host --cache-dir bin/host), total cycles:

block v1.2.7 (main) v2.0 (this branch)
GOAT testnet3 9831027 27,516,777 26,640,460 (−3.2%)
Ethereum 25134887 31,250,795 25,980,122 (−16.9%)

The cached Ethereum block 24438200 fails with MismatchedStateRoot in the guest on both main and this branch, so the cached input is stale and the failure is not from this change.

host, eth-proofs and continuous all build. When the workspace is built in one cargo build, their build scripts compile the guest into the same target directory at the same time (and host with different rustflags). Building the binaries one at a time avoids the clash, as it does on main.

Ziren's main branch is the 2.0.0 line the provers now run; v1.2.7 is no
longer accepted by them. Take the host crates (zkm-build, zkm-core-executor,
zkm-prover, zkm-sdk) from Ziren main, and patch Ziren's git source with the
checkout next to this repository, for the host and for the guest. The
precompile forks declare zkm-lib/zkm-zkvm at a Ziren tag, and cargo cannot
redirect one branch of a git URL to another, so the patch is what makes the
guest link a single zkm-zkvm.

The precompile patches move from their -ziren-1.2.7 tags to their branches
(alloy-primitives in the guest to the branch with the word hasher), and
kzg-rs to its patch-0.2.7 branch without default features. The guest
toolchain selection the README describes is done by zkm-build itself.
The header listed accrue_logs_bloom_cycles_count, but the guest no longer
profiles that stage (the logs bloom comes precomputed in the client
input) and write_record never pushed a value for it, so the header had
79 fields and every record 78. The csv writer rejects that whenever the
report file is created fresh, and the host exited with a CSV error right
after a successful execution. The column goes; the only reader of the
report, the cycle-count diff test, never used it.
Take the Ziren crates as plain git dependencies on its default branch
(main, 2.0.0), the way the stateless branch does, and drop the [patch]
sections that redirected them to a sibling checkout.

The precompile forks' branch tips declare zkm-lib/zkm-zkvm at Ziren tag
v1.2.7, which would put a second zkm-zkvm into the guest. The lockfiles
pin the commits just before that tag was added, whose only difference is
that they declare Ziren without a tag (bn aba71380, k256 8266b228, p256
a6f1a1fb, alloy-primitives 59313700, kzg-rs 855ea697, bls12_381 bcf93974),
the same commits stateless locks. alloy-primitives goes back to its plain
branch in the guest. Both lockfiles hold one Ziren source.
@eigmax

eigmax commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

Superseded by #24: GOAT's branch is feat/slot-state-check, so the upgrade targets it there.

@eigmax eigmax closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant