Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release candid 0.10 #493

Merged
merged 18 commits into from
Nov 16, 2023
Merged

Release candid 0.10 #493

merged 18 commits into from
Nov 16, 2023

Conversation

chenyan-dfinity
Copy link
Contributor

Break candid crates into candid, candid_parser and ic_principal.

lwshang and others added 18 commits October 23, 2023 15:33
Currently, the `candid` crate mainly consists of two parts:
* Candid data encoding/decoding
* Parser and derived functionality (bindgen)

The second part evolves fast which forces us to bump major version frequently.
Such version bumps propagated to the downstream projects (agent-rs, cdk-rs, sdk, ic monorepo, etc).

By splitting out `candid_parser`, we expect to have a stable `candid` crate.

Also, I move `Principal` into a separate `ic_principal` crate. Therefore, we can provide a lightweight dependency for those who only need `Principal`.

## Notable changes
* Some private or crate public methods are now public since they are called cross-crate
* Add `parse_idl_args()` and `parse_idl_value()` because in `candid_parser` we cannot implement `FromStr` for `IDLArgs` and `IDLValue` which are defined in `candid`.
* `TypeEnv` is defined in `candid`, so we can't implement type method `ast_to_type` in `candid_parser`. Instead I turned it into a function which takes `TypeEnv` as the first argument. Similarly, `size_helper()` and `size()` are changed.
* remove num_enum

* clean up parser dependencies

* checkpoint

* value feature

* remove codespan

* fix

* fix

* pretty

* remove mute_warning

* fix

* pretty refactor

* fix

* reexport candid in parser

* fix

* fix

* fix

* bignum feature

* bump candid_derive

* silence subtyping in decoder

* fix service_equal error reporting (#486)

* add IDLValue::Blob

* builder for config

* fix

* fix
* fix service_equal error reporting (#486)

* Add Arbitrary for Principal and extend random for Func

* Use  instead of

* fmt

* add arbitrary for principal

---------

Co-authored-by: Yan Chen <[email protected]>
Copy link

Benchmark for 2d15cf5

Click to view benchmark
Test Base PR %
Blob/&str 639.8±96.46µs 638.7±98.63µs -0.17%
Blob/ByteBuf 371.0±84.82µs 371.1±86.90µs +0.03%
Blob/Bytes 407.4±79.01µs 407.6±77.18µs +0.05%
Blob/String 651.2±260.51µs 653.7±255.14µs +0.38%
Collections/vec (text, nat) 49.3±0.91ms 51.5±2.04ms +4.46%
Collections/vec int 23.3±0.06ms 23.1±0.13ms -0.86%
Collections/vec int64 15.3±0.93ms 17.2±0.21ms +12.42%
Collections/vec nat8 11.1±0.37ms 12.1±0.08ms +9.01%
option list/1024 981.0±32.88µs 980.7±52.96µs -0.03%
profiles/1024 1875.8±33.34µs 1864.1±31.94µs -0.62%
variant list/1024 821.0±10.60µs 798.7±12.18µs -2.72%

@chenyan-dfinity chenyan-dfinity merged commit 1c00b4a into master Nov 16, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants