feature(emulator): bump emulator (v0.21.0), rootfs (v0.18.0), linux (6.5.13-ctsi-2-uio-test1-v0.21.0)#791
Open
mpolitzer wants to merge 2 commits into
Open
feature(emulator): bump emulator (v0.21.0), rootfs (v0.18.0), linux (6.5.13-ctsi-2-uio-test1-v0.21.0)#791mpolitzer wants to merge 2 commits into
mpolitzer wants to merge 2 commits into
Conversation
mpolitzer
force-pushed
the
feature/bump-emulator-v0.21.0
branch
8 times, most recently
from
July 22, 2026 13:03
6f9e2f3 to
3e8ec67
Compare
mpolitzer
marked this pull request as ready for review
July 23, 2026 17:40
There was a problem hiding this comment.
Pull request overview
This PR updates the rollups-node integration to newer Cartesi machine components (emulator/rootfs/linux) and adapts the Go/Lua tooling and machine abstractions to upstream API changes (renamed headers/defines, new CMIO response contract, and updated hash-collection entrypoints).
Changes:
- Bump emulator/rootfs/linux dependency pins (Dockerfile + test download helpers + packaging constraints).
- Update emulator CGo bindings and machine backend interfaces for renamed HTIF/CMIO constants and the new
SendCmioResponse(revertRootHash, ...)API. - Remove explicit checkpoint-hash writing and adjust replay/proof tooling for renamed flags and base64/hex hash formats.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/dependencies.sha256 | Updates SHA256s for test kernel/rootfs downloads. |
| test/dependencies | Updates test dependency download URLs (kernel/rootfs). |
| pkg/machine/machine.go | Removes WriteCheckpointHash from the Machine interface. |
| pkg/machine/machine_test.go | Updates mock machine to reflect interface removal. |
| pkg/machine/libcartesi.go | Adapts libcartesi backend for new CMIO response signature and adds new root-hash collection path. |
| pkg/machine/libcartesi_test.go | Updates mocks/tests for new libcartesi interface methods and signatures. |
| pkg/machine/implementation.go | Uses GetRootHash and passes revertRootHash into SendCmioResponse; removes checkpoint write method. |
| pkg/machine/implementation_test.go | Updates tests to mock GetRootHash + new SendCmioResponse signature; removes checkpoint-hash tests. |
| pkg/machine/backend.go | Updates Backend interface SendCmioResponse signature. |
| pkg/machine/backend_test.go | Updates backend mock helpers to include GetRootHash + new SendCmioResponse signature. |
| pkg/emulator/types.go | Switches to new headers and renames CMIO constants to HTIF equivalents. |
| pkg/emulator/remote.go | Switches JSON-RPC header include to new name. |
| pkg/emulator/machine.go | Switches core emulator header include, updates C bindings for new APIs and CMIO response signature. |
| pkg/emulator/emulator.go | Switches JSON-RPC header include to new name. |
| Makefile | Updates test dependency download target to include rootfs and new kernel artifact name. |
| internal/manager/instance.go | Removes pre-processing checkpoint write before advance. |
| internal/manager/instance_test.go | Removes checkpoint-write error path tests and mock fields. |
| Dockerfile | Bumps emulator version used in build image and updates SHA256s. |
| control.template | Updates required emulator version range for the Debian package. |
| cmd/cartesi-rollups-machine-tool/replay_dave.lua | Updates Dave replay script to new CMIO API and HTIF constants. |
| cmd/cartesi-rollups-machine-tool/main.go | Renames flags and converts proof hashes from base64 to hex. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+268
to
+274
|
|
||
| // v0.21 API expects log2(mcycle_period) instead of the raw period value | ||
| // Use exact integer arithmetic: for powers of 2, log2 = position of highest set bit | ||
| log2Period := uint64(bits.Len64(state.Period) - 1) | ||
| if (1 << log2Period != state.Period) { | ||
| return Failed, fmt.Errorf("period must be a power of 2, got %v.", state.Period) | ||
| } |
Comment on lines
+276
to
+279
| rawResult, err := e.inner.CollectMCycleRootHashes(mcycleEnd, log2Period, state.Phase, state.BundleLog2, "") | ||
| if err != nil { | ||
| return Failed, err | ||
| } |
Comment on lines
+287
to
+305
| err = json.Unmarshal(rawResult, &result) | ||
| if err != nil { | ||
| return Failed, errors.New("failed to unmarshal CollectMCycleRootHashes result") | ||
| } | ||
|
|
||
| // convert from base64 | ||
| for i, base64Hash := range result.RootHashes { | ||
| rawHash, err := base64.StdEncoding.DecodeString(base64Hash) | ||
| if err != nil { | ||
| return Failed, err | ||
| } | ||
| if len(rawHash) != HashSize { | ||
| return Failed, fmt.Errorf("received an invalid hash during RunAndCollectRootHashes at index %v, with value: %v.", i, base64Hash) | ||
| } | ||
| state.Hashes = append(state.Hashes, (Hash)(rawHash)) | ||
|
|
||
| } | ||
| return decodeBreakReason(result.BreakReason), nil | ||
| } |
Comment on lines
+259
to
+261
| return e.RunAndCollectRootHashesNew(mcycleEnd, state, timeout) | ||
| //return e.RunAndCollectRootHashesOld(mcycleEnd, state, timeout) | ||
| } |
Comment on lines
+500
to
+506
| func base64ToHex(s string) (string, error) { | ||
| raw, err := base64.StdEncoding.DecodeString(s) | ||
| if err != nil { | ||
| return "", fmt.Errorf("expected %s to be a hash in base64. %w", s, err) | ||
| } | ||
| return common.Hash(raw).Hex(), nil | ||
| } |
| # syntax=docker.io/docker/dockerfile:1 | ||
|
|
||
| ARG EMULATOR_VERSION=0.20.0 | ||
| ARG EMULATOR_VERSION=0.21.0-test6 |
Comment on lines
+1
to
+2
| https://github.com/cartesi/image-kernel/releases/download/v0.21.0-test1/linux-6.5.13-ctsi-2-uio-test1-v0.21.0.bin | ||
| https://github.com/cartesi/machine-guest-tools/releases/download/v0.18.0-test7/rootfs-tools.ext2 |
| @shasum -ca 256 test/dependencies.sha256 | ||
| @cd $(DOWNLOADS_DIR) && ln -s rootfs-tools.ext2 rootfs.ext2 | ||
| @cd $(DOWNLOADS_DIR) && ln -s linux-6.5.13-ctsi-1-v0.20.0.bin linux.bin | ||
| @cd $(DOWNLOADS_DIR) && ln -s linux-6.5.13-ctsi-2-uio-test1-v0.21.0.bin linux.bin |
mpolitzer
force-pushed
the
feature/bump-emulator-v0.21.0
branch
from
July 24, 2026 14:54
927f913 to
69822b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
CM_CMIO_*->CM_HTIF_*;UARCH_HALT_FLAG->UARCH_HALTrevertRootHash. Checkpoint is now done "automatically" from it.pkg/machine/implementation.go:348about whererevertRootHashvalue will come from. Currently done via a call toGetRootHashright there.bumps: