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

Candid decoding: Improve handling of references #2231

Closed
nomeata opened this issue Jan 7, 2021 · 1 comment · Fixed by #2297
Closed

Candid decoding: Improve handling of references #2231

nomeata opened this issue Jan 7, 2021 · 1 comment · Fixed by #2297
Labels
idl Candid or serialisation P1 high priority, resolve before the next milestone

Comments

@nomeata
Copy link
Collaborator

nomeata commented Jan 7, 2021

The latest Candid test suite extensions show that our decoding of service and function references isn’t great (need to do stricter checking in the type table).

Shouldn’t be too hard, but is also not too pressing, so maybe a small story in the next sprint. Or just general plate cleaning soonish.

Demo: #2225 can be merged

@nomeata
Copy link
Collaborator Author

nomeata commented Jan 18, 2021

I am kinda waiting for #2210 to be in, so that I don’t have to touch c code that gets removed anyways.

nomeata added a commit that referenced this issue Feb 1, 2021
This PR:

  * Bumps candid to get the latest test suite, including
    http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/153

  * Validate `service` and `func` types in the type table. Fixes: #2231.
    In particular

    - method names are valid UTF-8
    - method names are in strictly ascending order
    - method types are indeed function type
    - function annotations must be 0 or 1.

  * Updates IDL-Motoko.mo to not use the field hash when encoding
    otherwise unsupported Candid method names (such as ☃)

  * Update `mo_id/*.rs` accordingly

  * The test suite runner will ignore such unsupported test cases.
@rossberg rossberg added idl Candid or serialisation P1 high priority, resolve before the next milestone labels Feb 2, 2021
@mergify mergify bot closed this as completed in #2297 Feb 17, 2021
mergify bot pushed a commit that referenced this issue Feb 17, 2021
This PR:

  * Bumps candid to get the latest test suite, including dfinity/candid#153

  * Validate `service` and `func` types in the type table. Fixes: #2231.
    In particular

    - method names are valid UTF-8
    - method names are in strictly ascending order
    - method types are indeed function type
    - function annotations must be 0 or 1.

  * Updates IDL-Motoko.mo to not use the field hash when encoding
    otherwise unsupported Candid method names (such as ☃)

    This means that our type export is less surjective; see #1668 for a discussion of a possible fix.

  * Update `mo_id/*.rs` accordingly

  * Test cases for importing unrepresentable Candid types, including a new error code and a long error description.

  * The test suite runner will ignore such unsupported test cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idl Candid or serialisation P1 high priority, resolve before the next milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants