All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Add method
bitcoin_get_block_headers
. - Support management canister method:
subnet_info
. (#532)- Add types:
SubnetInfoArgs
andSubnetInfoResult
.
- Add types:
- Add
AllowedViewers
variant toLogVisibility
enum. (#512)
- Attribute
#[on_low_wasm_memory]
for low-memory hook. (#528) - Support Threshold Schnorr signing management canister API. (#518)
- BREAKING: Add the
LoadSnapshot
variant toCanisterChangeDetails
. (#504)
- Support Canister State Snapshots. (#504)
- Add methods:
take_canister_snapshot
,load_canister_snapshot
,list_canister_snapshots
,delete_canister_snapshot
- Add types:
LoadSnapshotRecord
,SnapshotId
,Snapshot
,TakeCanisterSnapshotArgs
,LoadCanisterSnapshotArgs
,DeleteCanisterSnapshotArgs
- Add methods:
- BREAKING: Stable Memory always use 64-bit addresses and
stable64_*
system API. (#498) - BREAKING: Add
log_visibility
to the management canister API types: (#497)CanisterSettings
DefiniteCanisterSettings
.
- Provide safe wrapper of
in_replicated_execution
in ic-cdk. (#489)
- Upgrade
ic0
to v0.23.0. (#489) - BREAKING: Add
wasm_memory_limit
to the management canister API types: (#483)CanisterSettings
DefiniteCanisterSettings
.
- Management canister methods for interacting with the chunk store. (#461)
- Provide safe wrapper of
global_timer_set
in ic-cdk. (#475)
- Upgrade
ic-cdk-macros
to v0.9.0.
- Add
is_recovering_from_trap
function for implementing trap cleanup logic. (#456) - Allow setting decoding quota for canister endpoints and inter-canister calls. (#465)
- When defining canister endpoints, we add the following attributes:
#[update(decoding_quota = 10000, skipping_quota = 100, debug = true)]
skipping_quota
limits the amount of work allowed for skipping unneeded data on the wire. If this attributes is not present, we set a default quota of10_000
. This affects ALL existing canisters, and is mainly used to improve canister throughput. See docs on the Candid library to understand the skipping cost.decoding_quota
limits the total amount of work the deserializer can perform. See docs on the Candid library to understand the cost model.debug = true
prints the instruction count and the decoding/skipping cost to the replica log, after a successful deserialization. The decoding/skipping cost is logged only when you have already set a quota in the attributes. The debug mode is useful to determine the right quotas above. Developers can send a few large payloads to the debugging endpoint and know the actual decoding cost.
- When making inter-canister calls, we have a new function
call_with_config
to config the same decoding quotas described above. It's strongly recommended to usecall_with_config
when calling third-party untrusted canisters.
- When defining canister endpoints, we add the following attributes:
ic_cdk::api::call::arg_data
takesArgDecoderConfig
as argument. (#465)
- Add "reserved cycles" fields to the management canister API: (#449)
reserved_cycles
toCanisterStatusResponse
reserved_cycles_limit
toCanisterSettings
andDefiniteCanisterSettings
- The README file is now more informative and used as the front page of the doc site.
- The
call*
methods are documented with examples and notes.
- Upgrade
candid
to0.10
. (#448)
query_stats
incanister_status
response. (#432)
- Another type of performance counter: "call context instruction counter".
Can be fetched using either method below: (#435)
ic_cdk::api::performance_counter(1)
;ic_cdk::api::call_context_instruction_counter()
as a shorthand;
- Deprecate
ic_cdk::api::call::performance_counter()
in favor ofic_cdk::api::performance_counter()
. (#435)
cycles_burn
corresponding to system APIic0.cycles_burn128
. (#434)
- Upgrade
ic0
to0.21.1
. (#434)
- Upgrade
ic0
to0.21.0
. (#433)
- Candid Export workflow is changed. (#424)
- No need to compile for WASI separately.
- Canisters should still invoke
ic_cdk::export_candid!()
to export candid. - Then use
candid-extractor
to extract candid from the canister WASM.
- Upgrade
candid
to0.9
. (#411) - Remove
export
module. Please use candid directly in your project instead of usingic_cdk::export::candid
. - Remove
ic_cdk_macro::import
module. See below for a new way to import canisters.
-
Export Candid: (#386)
- A wasi feature that builds the canister as a standalone WASI binary. Running the binary in wasmtime outputs the canister interface
- Build step:
cargo build --target wasm32-unknown-unknown \ --release \ --package "$package" --features "ic-cdk/wasi" wasmtime "target/wasm32-unknown-unknown/release/$package.wasm" > $did_file cargo build --target wasm32-unknown-unknown \ --release \ --package "$package" ic-wasm "target/wasm32-unknown-unknown/release/$package.wasm" \ -o "target/wasm32-unknown-unknown/release/$package.wasm" \ metadata candid:service -v public -f $did_file
- In the canister code, users have to add
ic_cdk::export_candid!()
at the end oflib.rs
. In the future we may lift this requirement to provide a better DX.
-
Import Candid: (#390)
- Canister project adds
ic_cdk_bindgen
as a build dependency to generate canister bindings - build.rs
use ic_cdk_bindgen::{Builder, Config}; fn main() { let counter = Config::new("counter"); let mut builder = Builder::new(); builder.add(counter); builder.build(None); // default write to src/declarations }
- In the canister code,
mod declarations; use declarations::counter::counter; counter.inc().await?
- Canister project adds
- Hardcodes the fee for
sign_with_ecdsa
. (#407)
- Bitcoin API handles cycles cost under the hood. (#406)
- Set caller's canister version in the field
sender_canister_version
of management canister call payloads. (#401) - Add management canister types for
canister_info
management canister call (CanisterInfoRequest
andCanisterInfoResponse
). (#401)
- No hard-coded fees for management canister calls. (#404)
ic0.is_controller
as a public function. (#383)
TransformContext::new
has been replaced with dedicated functions that accept closures. (#385)CallFuture
only makes an inter-canister call if it is awaited. (#391)
WASM_PAGE_SIZE_IN_BYTES
madepub
. (#380)http_request_with_cycles
. (#381)
- Addressed a compatibility error in the signature of the
call
family of functions. (#379)
- Fix type name in error message when a deserialization error occurs after making a canister-to-canister call. (#355)
- Update document for http_request. (#372)
- The timers API is not a feature anymore, it moved into a separate library,
ic-cdk-timers
. (#368)
- Added
ic0.canister_version
as a public function. (#350)
- Allow timers to cancel themselves. (#360)
- Change from pleco to tanton for the chess library in the chess example. (#345)
- Refactor the executor to prevent a double-free on
join_all
. (#357)
-
Added composite queries via
#[query(composite = true)]
. (#344)Composite queries cannot be run as update calls, but can make inter-canister calls to other query functions.
-
Implemented the canister timers API, located in module
ic_cdk::timer
. (#342)
- Improve error message on trap while decoding arguments. (#339)
- Added
StableIO
to implement bothio::Write
andio::Read
for stable memory. (#335) - Added 64-bit support for
io::Write
andio::Read
viaStableIO
. - Implement
io::Seek
for stable storage.
StableWriter
andStableReader
are now wrappers aroundStableIO
.
BREAKING CHANGE of experimental API:
http_request
to supportcontext
field in callback function. (#326)
- Expose
offset
ofStableReader
andStableWriter
. (#330)
- Doc can build on docs.rs. (#327)
- Separate
ic0
crate for system API. (#324)
create_canister_with_extra_cycles
to specify cycles when create canister (#322)
create_canister
should charge 0.1T cycles (#322)
- Upgrade
candid
to0.8.0
(#321)
- Overhaul management canister, especially
transform
type inhttp_request
(#312)
- New
ic_cdk::api::management_canister
module for calling the IC management canister (#295) - Derive common traits for
RejectionCode
(#294) ManualReply::reject
function (#297)
- Failure to decode the reply in
ic_cdk::call
does not trap anymore (#301)
- Derive
CandidType
andDeserialize
forRejectionCode
(#291, #293)
instruction_counter
function as a shorthand forperformance_counter(0)
(#283)
- Make
CanisterStableMemory
public (#281) - BREAKING CHANGE: move performance_counter from the
ic_cdk::api::call
toic_cdk::api
module (#283)
- Outdated documentation for
ManualReply
(#286)
arg_data_raw_size
for checking the size of the arg-data-raw before copying to a vector or deserializing (#263)performance_counter
for getting the value of specified performance counter (#277)
- Use explicitly type u8 in vector initialization (#264)
- Make
reply_raw
avoid writing empty replies - Uses new format for candid environment variables in import macros. Requires DFX >=0.9.2 (#270)
BufferedStableReader
for efficient reading from stable memory (#247)BufferedStableWriter
for efficient writing to stable memory (#245)reply_raw
and publisharg_data_raw
for serialization-agnostic arguments fetching and replies (#256)- Support for one-way calls (see
notify
andnotify_raw
functions) (#261)
- Panicking after
.await
does not leak resources anymore (#232, #250)
- Update canister calling API for 128-bit cycles (#228)
- Take slice rather than owned Vec as input arg (#217)
- Remove non-stable storage API (#215)
- Allow configuring export macros to not reply (#210)
- Add Clone and Copy to RejectionCode (#202)
- Do not call done() in stable_restore() (#216)
- Remove out-of-bounds vulnerability (#208)
- Run inter-canister calls without awaiting (#233)
candid
is required to be included in[dependencies]
to use the#[import]
macro (#190)- Deprecate block_on in favour of the new spawn function (#189)
- Trap in setup panic hook (#172)
- Update system API for 128 bit cycles (#167)
- Add support for 64 bit stable memory (#137)
- Add support for 'heartbeat' and 'inspect_message' (#129)