-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat: add management canister methods for interacting with the chunk store #461
Conversation
/// The list of chunks that make up the canister wasm | ||
pub chunk_hashes_list: Vec<ChunkHash>, | ||
pub chunk_hashes_list: Vec<Vec<u8>>, |
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.
This will be serialized inefficiently when using serde (it'll be fine when using candid, I think?).
We should either use ByteBuf
or manually implement serialize/deserialize for this field.
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.
Sure. I noticed that you were using serde_bytes::ByteBuf
. My latest commit focused on making the tests pass. And I felt that it's better to keep the types in API as native as possible, instead of forcing the users to import serde_bytes
.
I will go through the API data structures to make sure that all blob: Vec<u8>
are enhanced with #[serde(with = "serde_bytes")]
.
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.
Yeah ideally we'd expose Vec<u8>
rather than ByteBuf
, but when its Vec<Vec<u8>>
we can't use the #[serde(with = "serde_bytes")]
trick. I think the only way to avoid exposing ByteBuf
would be to manually implement serialize and deserialize.
For the inconsistency between the interface-spec and the replica implementation, the conclusion is that the replica will be modified to align with the spec. So we have to wait for that before we can complete this PR. And since it will be Turning this PR back to draft now. |
Description
Adds
upload_chunk
,stored_chunks
,clear_chunk_store
andinstall_chunked_code
to the management canister API.How Has This Been Tested?
I have tested this locally by uploading a wasm comprised of 3 chunks, the I queried
stored_chunks
which returned the chunks, then I calledinstall_chunked_code
which completed successfully, then I calledclear_chunk_store
, then I queriedstored_chunks
again and this time it was empty.Checklist: