C++ canisters are now async

Proud to announce that icpp-pro 7.0.0rc1 brings async to C++ canisters and full support of all ic0 system calls.

Here is a full list of capabilities we added recently to bring C++ on par with Motoko and Rust support:

Inter-canister calls

  • Async inter-canister calls with C++20 coroutines (co_await), with bounded-wait and unbounded-wait calls
  • Self-calls, and yield_fresh_budget() to continue in a new message with a fresh instruction limit
  • Composition: IC_Task (a coroutine that awaits another coroutine and gets its result) and IC_CallAll (several calls in flight at once)
  • Composite queries, including composite queries that call themselves or other composite queries
  • Upgrades are refused while calls are in flight
  • call_with_best_effort_response and msg_deadline

Management canister

  • Threshold ECDSA and Schnorr (public key and signing)
  • HTTPS outcalls, with transform, replicated or non-replicated
  • vetKD (public key and key derivation)
  • create_canister
  • raw_rand

Cycles and costs

  • Cost estimation: cost_call, cost_create_canister, cost_http_request, cost_sign_with_ecdsa, cost_sign_with_schnorr, cost_vetkd_derive_key
  • cost_http_request_v2
  • 128-bit cycles APIs, including call_cycles_add128

Security and trust

  • Certified data (certified_data_set, data_certificate)
  • Ingress inspection, with a user-declared canister_inspect_message hook
  • Caller info: the four msg_caller_info_* imports
  • Root key: root_key

Canister and system info

  • Environment variables: the six env_var_* imports, plus getenv() support
  • Introspection: canister_version, canister_status, in_replicated_execution, performance_counter
  • Subnet info: subnet_self and subnet_self_node_count
  • Coverage: 67 of 71 ic0 imports are bound. The four stable64_* imports are left out on purpose, because 64-bit stable memory is already available through the file system

Correctness and upgrade safety

  • Fixed real traps in canister_pre_upgrade, reject and cleanup entries, and get_caller() in heartbeat and timer entries
  • Entry-point guards on every IC_API method, following the replica’s rules for where each ic0 call is allowed
  • Multi-field Candid variants are encoded in hash order, as the spec requires
  • Fixed the ic0 header: removed five dead “funds” declarations, split the merged call_perform/stable_size line, and fixed the Mock IC’s mismatched reject-message declarations

Candid

  • New Candid types in icpp-candid: func references and vec blob, plus the nested types the management canister needs

Build and release

  • Built-in reduction of globals in wasm from 1000 to 1
  • Reproducible builds: locked Rust toolchain builds, exact dependency pins, a failed compile fails the build, retries on network errors

Testing

  • A full Mock IC round trip for calls, so they can be tested natively
  • An upgrade-hook regression guard: the Mock IC refuses ic0 calls where the replica does, and a canister is upgraded in place by every test run
  • Smoketests

Demos

  • An ICRC-1 client demo against a pinned ledger wasm (balance and transfer, with idempotent retries)
5 Likes