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

Implement seal_call_runtime #854

Closed
4 tasks
cmichi opened this issue Jul 12, 2021 · 3 comments · Fixed by #1641
Closed
4 tasks

Implement seal_call_runtime #854

cmichi opened this issue Jul 12, 2021 · 3 comments · Fixed by #1641
Labels
B-enhancement New feature or request

Comments

@cmichi
Copy link
Collaborator

cmichi commented Jul 12, 2021

With paritytech/substrate#9276 implemented, we can now introduce seal_call_runtime into ink!, providing contracts with the ability of dispatching calls into the runtime.

ToDo

  • Add a new ink! API function self.env().call_runtime(…) analog to our other env() API functions (e.g. with UI tests under crates/lang/macro/tests/ui/). See the linked issue for the contracts pallet API.
  • Add an example which demonstrates how to call into the runtime. It should be possible to do this analog to the rand-extension example.
  • Implement a test for this new example in the ink-waterfall.
  • Add a section to the ink-docs, describing how this new functionality can be used.
@cmichi cmichi added the B-enhancement New feature or request label Jul 12, 2021
@athei
Copy link
Contributor

athei commented Oct 18, 2021

You have to keep in mind that extrinsics cannot return any data (only success/fail). They communicate via events with the offchain world. So something like rand-extension isn't possible with seal_call_runtime. It is unstable for a reason. There are several open questions around it:

  • Is it OK that it can't return data or should we make an effort to deliver events (asynchronously) to contracts?
  • There are issues around stability. Contract APIs must be stable but extrinsics are allowed to change. Once you allow some extrinsic to be called from a contract it puts a heavy burden on the runtime to never change this API.

@Robbepop
Copy link
Collaborator

What is the difference from this feature to chain extensions that allow for the same functionality?

@athei
Copy link
Contributor

athei commented Oct 18, 2021

Explained here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants