Summary
Currently, smart contract canisters can send update calls to any canister. These calls can even form “chains” of calls such as the following:
Imagine you have three canisters: A, B, and C.
A.updateCall() → B.updateCall() → C
Result: A gets a response in around 4 seconds*
*(if it’s within the same subnet, it could be much faster or as slow as 5 seconds per call if its cross-subnet)
This is helpful in making an application composed of multiple canisters calling each other. The “catch” is that update calls are replicated using consensus so they take around 2 seconds each. This means that if A calls B which calls C, then it may take 2 seconds (A → B) + 2 seconds (B → C) or 4 seconds for A to get a response. If one had a system where 10 canisters had to linearly call each other with update calls, it may take up to 20 seconds for the initial canister to get a response as each canister update call takes 2 seconds. Not great user experience.
Fortunately, we have query calls that are very very fast (around 200 ms) and can also be sent to any canister, but currently, they cannot be chained in the same way as “inter-canister query calls.” This project is about adding inter-canister query calls as a native feature to the IC.
This would allow the following chain to happen:
A.queryCall() → B.queryCall() → C
Result: A gets a response in around 400 milliseconds.
Rationale
This feature has been asked about many times and is the most popular in the community megathread. Here are some examples of the community asking for it:
- Megathread: Community Submissions for DFINITY Foundation’s Roadmap - #5 by wang
- Megathread: Community Submissions for DFINITY Foundation’s Roadmap - #34 by witter
- Fast Inter-Canister Query Calls - #3 by Steve
- Consensus and inter-canister calls - #7 by pie-silo
What you can do to help
- Ask questions on intent, design, trade-offs
- Propose design ideas
- Propose a narrower or different scope for the project
- Say whether you like or dislike prioritizing this project
- Vote on proposals
Want to see what to expect? Check out project to get a sense of the emerging process: Increased Canister Smart Contract Memory
Documentation
This project is just starting, but there has been significant design thought put into this in the past (but not enough time to prioritize its implementation). More documentation will be posted here, but there are some helpful links to add context: https://sdk.dfinity.org/docs/developers-guide/tutorials/intercanister-calls.html
Key people involved
Ulan (@ulan ), Akhilesh Singhania (@akhilesh.singhania), bogdan warinschi (@bogwar )