Releases: demergent-labs/kybra
0.6.0
This release focuses on removing the workarounds and necessary caveats in place because of the small Wasm binary limit implemented by the Internet Computer Protocol. This limit has been substantially lifted by the protocol itself, thus we were able to remove our workarounds. We've also made the initial installation process simpler and more robust.
New Features
- ic-wasm has been removed
- there is no longer a
post_install
step - memory ids
0
,1
,2
,252
,253
, and254
are no longer reserved - encrypted dfx identities are now supported
- guard functions now only allowed on
query
andupdate
methods - Wasm module hash caveat removed
ic.caller()
now correct ininit
andpost_upgrade
- metadata is now defined by the developer in
dfx.json
, no Kybra version is exposed init
andpost_upgrade
caveats removed
Breaking Changes
The post_install
canister property should no longer be used in the dfx.json
file, and we now recommend a metadata
canister property in the dfx.json
file.
Example:
{
"canisters": {
"simple_erc20": {
"type": "custom",
"build": "python -m kybra simple_erc20 src/main.py src/main.did",
"candid": "src/main.did",
"wasm": ".kybra/simple_erc20/simple_erc20.wasm",
"gzip": true,
"metadata": [
{
"name": "candid:service",
"path": "src/main.did"
},
{
"name": "cdk:name",
"content": "kybra"
}
],
"declarations": {
"output": "test/dfx_generated/simple_erc20",
"node_compatibility": true
}
}
}
}
What's Changed
- Large wasm binaries by @lastmjs in #465
- improve prints by @bdemann in #449
- Improve Python Stdlib Conditional Compilation Check by @lastmjs in #471
- Binstall by @lastmjs in #473
- Prebuilt stdlib by @lastmjs in #474
- Memory ids by @lastmjs in #475
- Misc fixes by @lastmjs in #476
- Assets stdlib by @lastmjs in #477
Full Changelog: 0.5.3...0.6.0
0.6.0rc5
kybra-bot automated release 0.6.0rc5
0.6.0rc4
kybra-bot automated release 0.6.0rc4
0.6.0rc3
kybra-bot automated release 0.6.0rc3
0.5.3
0.5.2
0.5.1
0.5.0
New Features
- Broad stdlib support
- Greatly expanded Python source code size limit
- Various syntax changes that we hope improve the developer experience and solve various issues
- Guard functions
- Greatly improved error reporting
- match function
Breaking Changes
Please follow this breaking change guide to ensure a smoother transition from previous versions of Kybra to version 0.5.0
.
It is recommended to do the following before starting a manual project migration:
- delete
~/.config/kybra
- delete your local
venv
- delete your local
.dfx
directory - delete your local
.kybra
directory
opt is now Opt
opt
has been renamed to Opt
Vec
The Vec
type has been introduced, and it must be used in place of list
.
Variant casing
Variants now follow conventions from Rust enums. The first letter will be uppercase and the rest camel case. For example, for the Result
types ok
is now Ok
and err
is now Err
.
void is now required on system methods
All canister methods must have an explicit return type. In the case of certain system methods like init
and post_upgrade
, you must explicitly return void
.
candid:service metadata is gone
For the time being the candid:service
metadata has been removed and Kybra relies on the __get_candid_interface_tmp_hack
canister method.
dfx.json
All dfx.json
files must add the following to the canister objects:
Add the post_install
script path:
"post_install": ".kybra/canister_name/post_install.sh"
Add gzip
true
:
"gzip": true
Remove .gz
from the Wasm path:
"wasm": ".kybra/canister_name/canister_name.wasm"
StableBTreeMap memory ids
StableBTreeMap
memory ids 0, 1, 2, 252, 253, 254 are now reserved. If you are using one of these memory ids then your application will break. Remember that migrating StableBTreeMap
s is not well supported, be careful with trying to upgrade an existing canister in production using a StableBTreeMap
.
None is no longer a type
None
is not a Candid type anymore. It has been replaced by null
.
Canister is now Service
Canister
has been renamed to Service
.
method is now service_query or service_update
The method
decorator is now service_query
or service_update
depending on if the Service
method is a query or an update method.
CanisterResult is now CallResult
CanisterResult
has been renamed to CallResult
.
manual is now Manual
manual
has been renamed to Manual
.
tuple is now Tuple
tuple
has been renamed to Tuple
.
alias is now Alias
alias
has been renamed to Alias
.
init and post_upgrade params
When adding init
and post_upgrade
params you must manually edit the Candid service and add the params on the first deploy. For more information see The Kybra Book.
No encrypted dfx identities
Encrypted dfx identities are no longer supported. For more information see The Kybra Book.
Wasm module hash no longer useful
The Wasm module hash has been rendered unuseful. For more information see The Kybra Book.
ic.caller() in init and post_upgrade
When deploying with dfx, ic.caller()
in init
and post_upgrade
will now be the canister's id and not the dfx identity's principal. For more information see The Kybra Book
init under-the-hood nuances
In order to allow for larger Kybra Wasm modules and to enable the Python stdlib, we had to introduce some trade-offs into the init
and post_upgrade
processes:
- The under-the-hood Rust
init
function of your application canister is never called directly, only thepost_upgrade
function. This function will call your Pythoninit
orpost_upgrade
function in a timer callback - When deploying to a local replica, errors from your
init
orpost_upgrade
will be logged from your replica, not from thedfx deploy
process - When deploying to mainnet, errors from your
init
orpost_upgrade
will not be logged - Your canister will go through the following main steps when deploying: first a deployer canister Wasm binary will be deployed to the canister, then your application Wasm binary will be chunk uploaded to the deployer canister along with the Python stdlib, and finally the deployer canister will call
install_code
on itself with the full application Wasm binary
What's Changed
- Add support for arbitrary virtualenvs by @dansteren in #253
- timers can now do cross canister calls by @lastmjs in #252
- Seed the custom randomness by @lastmjs in #255
- Improved organization of generated code by @dansteren in #254
- Void and null by @bdemann in #251
- Function guards by @bdemann in #256
- add initial version of Kybra book by @lastmjs in #264
- adding a lot of documentation by @lastmjs in #265
- 271 embrace results by @bdemann in #274
- Remove cargo test by @lastmjs in #283
- Kybra rewrite by @bdemann in #262
- The kybra book by @lastmjs in #279
- Func type no longer needs a TypeAlias and the type errors are gone by @lastmjs in #312
- test nested tuples by @bdemann in #313
- complex init example by @bdemann in #314
- explicit voids for system canister methods by @bdemann in #315
- change method decorator to either update or query by @bdemann in #316
- 288 update function guards by @bdemann in #318
- re-export kybra management modules by @bdemann in #319
- threshold ecdsa by @bdemann in #321
- 284 all examples should use the pretest method like azle and node compatibility should be set to true and dfx generated not checked in by @bdemann in #322
- 285 make sure all examples and tests match azle for example there is no async heartbeat test for kybra but there is for azle by @bdemann in #323
- 304 match function by @lastmjs in #330
- 303 unify external canister with service by @bdemann in #328
- update manual reply example by @bdemann in #331
- Update candid by @bdemann in #338
- Call result by @bdemann in #339
- Book verification by @bdemann in #344
- Vec tuple wrappers by @bdemann in #349
- 351 make type capitalization more uniform in kybra types by @bdemann in #353
- Vec tuple documentation by @bdemann in #352
- 351 update documentation by @bdemann in #354
- update dfx by @bdemann in #357
- Fixed name collisions by @dansteren in #362
- 358 support creating stablebtreemaps with type annotations by @bdemann in #363
- Error infrastructure by @bdemann in #375
- 307 too many params by @bdemann in #376
- 325 remove fragile snippets by @bdemann in #381
- Check for multiple definitions by @bdemann in #383
- Changed runtime errors to bubble up correctly by @dansteren in #389
- 364 runtime errors by @bdemann in #388
- Fixed Guard Functions example by @dansteren in #401
- Refactored calls to global python functions by @dansteren in #402
- Implemented broad support for the Python stdlib in Kybra by @lastmjs in #413
- Kybra build optimizations by @lastmjs in #415
- add warning and protection for the pre_upgrade method by @lastmjs in #423
- attempt to retrieve candid in post_install by @lastmjs in #430
- remove candid metadata by @lastmjs in #432
- make candid parsing much more robust by @lastmjs in #434
- test out a couple fixes by @lastmjs in #436
- add chunk upload clearing, use secrets stdlib by @lastmjs in https://github.com/demerge...
0.4.0
TLDR
There is no more need to manually install Rust on your machine. Kybra will now install an encapsulated Rust environment inside of ~/.config/kybra
per version of Kybra. You can also use a more flexible virtual environment setup. Composite queries are now supported for use in the local replica.
Breaking Changes
- Please delete your local
.dfx
directory before installing and deploying with the new version of Kybra - Please follow the new directions in the README for setting up your virtual environment
- You should add
.kybra
to your.gitignore
file
What's Changed
- Split example into three canisters by @bdemann in #233
- Rust cleanup by @lastmjs in #241
- fix stable structures by @lastmjs in #244
- Composite query by @bdemann in #213
- update documentation by @lastmjs in #246
- fix the type stub missing error by @lastmjs in #247
Full Changelog: 0.3.0...0.4.0
0.3.0
If you run into issues after an upgrade:
- Ensure all versions of dfx, Rust, and Python are exactly as described in the README
- Completely delete the
.dfx
directory and deploy again - Run
rustup update
TLDR
This release is all about introducing StableBTreeMap.
What's Changed
- Stable structures runtime by @lastmjs in #201
- parse stable storage nodes by @bdemann in #202
- add dependencies by @bdemann in #204
- Stable structures tests by @bdemann in #212
- Stable structures tests cleanup by @bdemann in #221
- Abstract ref_cell naming into common place by @dansteren in #220
- remove the todos we don't need anymore by @bdemann in #227
- Added documentation for StableBTreeMap by @dansteren in #228
- 163 stable structures by @lastmjs in #210
Full Changelog: 0.2.0...0.3.0