Add tikv-jemallocator and crates-io patches for ckb-vm asm mode on rv64gc - #13
Draft
gpBlockchain with Copilot wants to merge 6 commits into
Draft
Add tikv-jemallocator and crates-io patches for ckb-vm asm mode on rv64gc#13gpBlockchain with Copilot wants to merge 6 commits into
gpBlockchain with Copilot wants to merge 6 commits into
Conversation
- Update ckb-testtool dependency in Cargo.toml and demo/tests/Cargo.toml to use https://github.com/gpBlockchain/ckb-testtool.git branch copilot/update-ckb-vm-dependencies - Update rust-toolchain from 1.84.0 to 1.85.0 (required for edition 2024) - Fix compilation errors from new ckb-testtool API (ScriptHashType import, Pack type disambiguation for Uint64) - Add .github/workflows/riscv64-test.yml CI workflow using qemu-riscv64 - Add .gitignore for target directory Co-authored-by: gpBlockchain <32102187+gpBlockchain@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update ckb-testtool repository to new GitHub URL
Update ckb-testtool to gpBlockchain fork and add riscv64gc qemu CI
Feb 25, 2026
Debug-mode test binaries are too large for QEMU user-mode emulation's default address space, causing 'memory allocation of 24 bytes failed'. Building with --release produces smaller, optimized binaries that fit within QEMU's limits, matching the approach used in ckb-vm PR #502. Co-authored-by: gpBlockchain <32102187+gpBlockchain@users.noreply.github.com>
Cargo patches only apply at the top-level manifest. The patches in ckb-testtool's Cargo.toml were not propagating, so ckb-vm 0.24.14 from crates.io (no rv64gc asm support) was being resolved instead of the mohanson-fork/ckb-vm asm_rv64im branch. Changes: - Add [patch.crates-io] section to root Cargo.toml, mirroring the patches from ckb-testtool (ckb-vm, ckb-vm-definitions, and all ckb-* crates from gpBlockchain/ckb fork) - Bump Rust toolchain to 1.92.0 (required by patched dependencies) - Update CI workflows to use Rust 1.92.0 Co-authored-by: gpBlockchain <32102187+gpBlockchain@users.noreply.github.com>
Copilot
AI
changed the title
Update ckb-testtool to gpBlockchain fork and add riscv64gc qemu CI
Enable ckb-vm ASM mode on rv64gc via crates-io patches and toolchain bump
Feb 25, 2026
The test binary under qemu-riscv64-static fails with "memory allocation of 4 bytes failed" because host ASLR fragments the virtual address space, causing QEMU's guest mmap/brk syscall translations to fail. Wrap the QEMU runner with `setarch linux64 --addr-no-randomize` to disable Address Space Layout Randomization. This gives QEMU a more contiguous, deterministic address space layout so the guest binary's memory allocations can succeed. Co-authored-by: gpBlockchain <32102187+gpBlockchain@users.noreply.github.com>
Copilot
AI
changed the title
Enable ckb-vm ASM mode on rv64gc via crates-io patches and toolchain bump
Update ckb-testtool to asm_rv64im fork, add RISC-V 64 QEMU CI
Feb 25, 2026
Use jemalloc as the global allocator in test mode to work around memory allocation failures when running under QEMU riscv64 user-mode emulation. Co-authored-by: gpBlockchain <32102187+gpBlockchain@users.noreply.github.com>
Copilot
AI
changed the title
Update ckb-testtool to asm_rv64im fork, add RISC-V 64 QEMU CI
Add tikv-jemallocator and crates-io patches for ckb-vm asm mode on rv64gc
Feb 27, 2026
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.
Running tests under
qemu-riscv64-staticfails withmemory allocation of 4 bytes faileddue to the system allocator's interaction with QEMU user-mode emulation. Additionally, the[patch.crates-io]entries inckb-testtool's Cargo.toml don't propagate (Cargo only applies patches from the workspace root), so ckb-vm was resolving to the crates.io version without rv64gc asm support.Changes
Cargo.toml: Addtikv-jemallocator = "0.6"as dev-dependency; add[patch.crates-io]mirroring ckb-testtool's patches forckb-vm/ckb-vm-definitions(mohanson-fork asm_rv64im) and allckb-*crates (gpBlockchain fork)src/main.rs: Use jemalloc as global allocator in test mode:src/main.rs: FixScriptHashType/Scriptimports (moved fromckb_stdtockb_testtool) and disambiguatePack::<Uint64>::pack()calls required by newckb-gen-types1.xrust-toolchain.toml: Bump to 1.92.0 (MSRV of patched deps).github/workflows/riscv64-test.ymlwith qemu-riscv64 cross-test job using--releaseandsetarch linux64 --addr-no-randomize💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.