-
Notifications
You must be signed in to change notification settings - Fork 469
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
Add system API endpoints for cycle cost calculation #4110
base: master
Are you sure you want to change the base?
Conversation
🤖 Here's your preview: https://c4y23-xqaaa-aaaam-abayq-cai.icp0.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also add functions into the formal semantics: the actual return value can be abstracted over as arbitrary()
, but the rest should follow, e.g., ic0.canister_cycles_balance128
.
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
I measured the instructions on a canister that turns a Vec into a struct using candid::Decode!(). Whether candid uses serde_bytes itself, idk.
Yes. But there, the precise call type is already known without inspecting a blob. |
serde_bytes are used if the type you want to decode contains corresponding serde_bytes annotation. Could you please share the type definition you're decoding to? |
I think what rubs me the wrong way about the current proposal and the problem of possible future extensions is that the couples the System API (which is currently oblivious to the existence of the management canister and all other functionality) with these other special aspects of the system. Obviously my proposal would also couple them, just at the implementation level (by having to understand the payload) instead of the API level, and in some sense it's inevitable if we want to provide a synchronous API. |
While I agree with your analysis, I'd make a different trade-off. Having an API that is agnostic to the details has these disadvantages:
|
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Co-authored-by: mraszyk <[email protected]>
Design Doc