Skip to content

First stab at system API design#198

Merged
nomeata merged 2 commits intodesign/systemfrom
joachim/design/system
Mar 1, 2019
Merged

First stab at system API design#198
nomeata merged 2 commits intodesign/systemfrom
joachim/design/system

Conversation

@nomeata
Copy link
Contributor

@nomeata nomeata commented Feb 28, 2019

This is a first stab, please review.

Note that this is just to get started working on the document in branch design/system. So please do comment and complain about anything that goes in a fundamentally wrong direction, but maybe propose refinements and extensions (e.g. time) in a separate PR against the design/system. The grand acceptance is only when we merge design/system into master.

Copy link
Contributor

@ggreif ggreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First reading. Makes sense to me. I assume msgref and i32 are IDL types, not ActorScript types?

> 333 : i32;
stdin:1.7-1.10: type error, unbound type identifier i32

Also, this document is supposed to mention the system libraries? Possible candidates could be:

  • bignum
  • CBOR serialisation (part of V8)

It might be interesting to have a debugger : () -> () system call, too.

The meaning of the error codes is not specified in this proposal.

Like `msg.reply`, this function returns to the WebAssembly module and does not
immediatelly send a response. It traps if `msg.reject` or `msg.reply` has been
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
immediatelly send a response. It traps if `msg.reject` or `msg.reply` has been
immediately send a response. It traps if `msg.reject` or `msg.reply` has been

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a pretty radical change from the existing System.API in that the system no longer has much or indeed any insight into the structure of the messages. While I know @nomeata has been advocating that for a while now, we do need to discuss what, if anything, we lose with this approach. IIUC the main suggestion to me that the message payload is now just a binary blob of app/IDL interpreted data plus a side-table of reference, presumably referenced (at most) by index from within the blob. This actually might be a very convenient separation in that the system can easily track the flow of references (should we continue to support them) without having to parse the structure of the binary data. But are we losing anything?

Copy link
Contributor Author

@nomeata nomeata Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the system no longer has much or indeed any insight into the structure of the messages

There is the IDL…

IUC the main suggestion to me that the message payload is now just a binary blob of app/IDL interpreted data plus a side-table of reference, presumably referenced (at most) by index from within the blob.

Correct. That is how serialization works at the moment, so it is inspired by our (well, my) experience there, in that it is always a elembuf with always a databuf in the last element.

But are we losing anything?

We are losing the ability to send primitive DFINITY types (i32, actorref) directly, without any serialization to a binary+table format.

Co-Authored-By: nomeata <mail@joachim-breitner.de>
@nomeata
Copy link
Contributor Author

nomeata commented Feb 28, 2019

First reading. Makes sense to me. I assume msgref and i32 are IDL types, not ActorScript types

Neither, they are WebAssembly types.

Also, this document is supposed to mention the system libraries?

No, I don’t think they are part of the System API. What should be added here (separately) is dynamic linking, maybe following https://github.com/dfinity-lab/discussion/issues/65 or https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.

It might be interesting to have a debugger : () -> () system call, too.

Yes, that would be on scope for this document. Feel free to make a PR again design/system (once this is merged, I guess, so that there is a file to extend). Maybe also chat with the SDK people what semantics they expect here.

@nomeata
Copy link
Contributor Author

nomeata commented Mar 1, 2019

I’ll merge this into design/system, and then everyone is invited to propose changes there, for example by clicking the edit button on
https://github.com/dfinity-lab/actorscript/blob/design/system/design/system-api.md

@nomeata nomeata merged commit 93014c1 into design/system Mar 1, 2019
@nomeata nomeata deleted the joachim/design/system branch March 1, 2019 10:01
dfinity-bot added a commit that referenced this pull request Oct 19, 2020
## Changelog for ic-ref:
Branch: release-0.11
Commits: [dfinity-lab/ic-ref@9edd0fdd...824fd6d9](https://github.com/dfinity-lab/ic-ref/compare/9edd0fdda006519118ed40515b84c74f69c59bc1...824fd6d904b0635349820ca52262ce91fd9e695c)

* [`ad7f600e`](https://github.com/dfinity-lab/ic-ref/commit/ad7f600ed6a95a1f30766addce6753f7106e75b9) ic-ref: Introduce Env data type ([dfinity-lab/ic-ref⁠#198](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/ic-ref/issues/198))
* [`b9bd4d3f`](https://github.com/dfinity-lab/ic-ref/commit/b9bd4d3f2e28ce966258eba1ba2392035edc54fa) ic-ref: Introduce CanisterActions type
* [`449da3c9`](https://github.com/dfinity-lab/ic-ref/commit/449da3c92d79b3fc0a1641631cc2f032f3f0d6f5) ic-ref-test: Systematically test System API availability
* [`871565bb`](https://github.com/dfinity-lab/ic-ref/commit/871565bb5fede65cb21f3f2e23e3d884eee2a934) Remove IC.Logger (not really useful)
* [`578465cc`](https://github.com/dfinity-lab/ic-ref/commit/578465cce07470a6f0498bf464e6e6a77cd8547e) ic-ref-test: Remove some tests that became obsolete
* [`a30b0b4e`](https://github.com/dfinity-lab/ic-ref/commit/a30b0b4ee0cdaa9a7485522d87c9e5bb41f3903b) Bump nixpkgs to 20.09 ([dfinity-lab/ic-ref⁠#201](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/ic-ref/issues/201))
* [`89463035`](https://github.com/dfinity-lab/ic-ref/commit/8946303584e4b5c0d44990e9f58b177258ed425e) Update caba.project.freeeze file
* [`f172aad1`](https://github.com/dfinity-lab/ic-ref/commit/f172aad192b63b9b8bd8314bcab1b7a95bde1784) ic-ref-test: No priming
* [`449b3efc`](https://github.com/dfinity-lab/ic-ref/commit/449b3efc732be3445d67c56ecbfc423fb1ab1b03) ic-ref-test: Fix “call from query“ tests
* [`824fd6d9`](https://github.com/dfinity-lab/ic-ref/commit/824fd6d904b0635349820ca52262ce91fd9e695c) ic-ref-test: Canister deletion tests
mergify bot pushed a commit that referenced this pull request Oct 19, 2020
## Changelog for ic-ref:
Branch: release-0.11
Commits: [dfinity-lab/ic-ref@9edd0fdd...824fd6d9](https://github.com/dfinity-lab/ic-ref/compare/9edd0fdda006519118ed40515b84c74f69c59bc1...824fd6d904b0635349820ca52262ce91fd9e695c)

* [`ad7f600e`](https://github.com/dfinity-lab/ic-ref/commit/ad7f600ed6a95a1f30766addce6753f7106e75b9) ic-ref: Introduce Env data type ([dfinity-lab/ic-ref⁠#198](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/ic-ref/issues/198))
* [`b9bd4d3f`](https://github.com/dfinity-lab/ic-ref/commit/b9bd4d3f2e28ce966258eba1ba2392035edc54fa) ic-ref: Introduce CanisterActions type
* [`449da3c9`](https://github.com/dfinity-lab/ic-ref/commit/449da3c92d79b3fc0a1641631cc2f032f3f0d6f5) ic-ref-test: Systematically test System API availability
* [`871565bb`](https://github.com/dfinity-lab/ic-ref/commit/871565bb5fede65cb21f3f2e23e3d884eee2a934) Remove IC.Logger (not really useful)
* [`578465cc`](https://github.com/dfinity-lab/ic-ref/commit/578465cce07470a6f0498bf464e6e6a77cd8547e) ic-ref-test: Remove some tests that became obsolete
* [`a30b0b4e`](https://github.com/dfinity-lab/ic-ref/commit/a30b0b4ee0cdaa9a7485522d87c9e5bb41f3903b) Bump nixpkgs to 20.09 ([dfinity-lab/ic-ref⁠#201](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/ic-ref/issues/201))
* [`89463035`](https://github.com/dfinity-lab/ic-ref/commit/8946303584e4b5c0d44990e9f58b177258ed425e) Update caba.project.freeeze file
* [`f172aad1`](https://github.com/dfinity-lab/ic-ref/commit/f172aad192b63b9b8bd8314bcab1b7a95bde1784) ic-ref-test: No priming
* [`449b3efc`](https://github.com/dfinity-lab/ic-ref/commit/449b3efc732be3445d67c56ecbfc423fb1ab1b03) ic-ref-test: Fix “call from query“ tests
* [`824fd6d9`](https://github.com/dfinity-lab/ic-ref/commit/824fd6d904b0635349820ca52262ce91fd9e695c) ic-ref-test: Canister deletion tests
dfinity-bot added a commit that referenced this pull request Jun 23, 2023
## Changelog for ic-hs:
Branch: master
Commits: [dfinity/ic-hs@52369fa1...f092a2d5](dfinity/ic-hs@52369fa...f092a2d)

* [`12590345`](dfinity/ic-hs@1259034) bump cachix/install-nix-action ([dfinity/ic-hs⁠#201](https://github.com/dfinity/ic-hs/issues/201))
* [`2ef5690c`](dfinity/ic-hs@2ef5690) Bump openssl from 0.10.48 to 0.10.55 in /httpbin-rs ([dfinity/ic-hs⁠#202](https://github.com/dfinity/ic-hs/issues/202))
* [`46af8266`](dfinity/ic-hs@46af826) sync httpbin implementation with ic repo ([dfinity/ic-hs⁠#193](https://github.com/dfinity/ic-hs/issues/193))
* [`1fd276eb`](dfinity/ic-hs@1fd276e) implement Call context removal transition ([dfinity/ic-hs⁠#191](https://github.com/dfinity/ic-hs/issues/191))
* [`11c00d2a`](dfinity/ic-hs@11c00d2) catch HTTP exception from HTTPS outcalls ([dfinity/ic-hs⁠#195](https://github.com/dfinity/ic-hs/issues/195))
* [`9eb5bf48`](dfinity/ic-hs@9eb5bf4) deleted call contexts prevent canister from stopping (again) ([dfinity/ic-hs⁠#190](https://github.com/dfinity/ic-hs/issues/190))
* [`f092a2d5`](dfinity/ic-hs@f092a2d) implement and test canister history ([dfinity/ic-hs⁠#198](https://github.com/dfinity/ic-hs/issues/198))
mergify bot pushed a commit that referenced this pull request Jun 23, 2023
## Changelog for ic-hs:
Branch: master
Commits: [dfinity/ic-hs@52369fa1...f092a2d5](dfinity/ic-hs@52369fa...f092a2d)

* [`12590345`](dfinity/ic-hs@1259034) bump cachix/install-nix-action ([dfinity/ic-hs⁠#201](https://github.com/dfinity/ic-hs/issues/201))
* [`2ef5690c`](dfinity/ic-hs@2ef5690) Bump openssl from 0.10.48 to 0.10.55 in /httpbin-rs ([dfinity/ic-hs⁠#202](https://github.com/dfinity/ic-hs/issues/202))
* [`46af8266`](dfinity/ic-hs@46af826) sync httpbin implementation with ic repo ([dfinity/ic-hs⁠#193](https://github.com/dfinity/ic-hs/issues/193))
* [`1fd276eb`](dfinity/ic-hs@1fd276e) implement Call context removal transition ([dfinity/ic-hs⁠#191](https://github.com/dfinity/ic-hs/issues/191))
* [`11c00d2a`](dfinity/ic-hs@11c00d2) catch HTTP exception from HTTPS outcalls ([dfinity/ic-hs⁠#195](https://github.com/dfinity/ic-hs/issues/195))
* [`9eb5bf48`](dfinity/ic-hs@9eb5bf4) deleted call contexts prevent canister from stopping (again) ([dfinity/ic-hs⁠#190](https://github.com/dfinity/ic-hs/issues/190))
* [`f092a2d5`](dfinity/ic-hs@f092a2d) implement and test canister history ([dfinity/ic-hs⁠#198](https://github.com/dfinity/ic-hs/issues/198))
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.

3 participants