-
Notifications
You must be signed in to change notification settings - Fork 86
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: allow upload/retrieve of assets of arbitrary size from asset canister #1482
Conversation
create_batch, create_chunk, create_asset, set_asset_content, get, get_chunk work manually
Use serde_bytes for [u8] Co-authored-by: Yan Chen <[email protected]>
Thanks for walking me through these change yesterday! in general it lgtm. I am taking a pass through the .rs sections... |
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.
may want review from others as well
…et-canister-large-assets
…#1483) And add support for http requests in the base storage canister (with a default to `/index.html`). This does not support other encodings than `identity` for now (and doesn't even return any headers). This support will be added to the upgraded asset storage canister built in #1482. Added a test that uses `curl localhost` to test that the asset storage AND the webserver properly support the http requests. This commit also upgrades tokio and reqwest in order to work correctly. There are also _some_ performance issues noted (this is slower than the `icx-http-server` for some reason), but those are not considered criticals and could be improved later on. Renamed the `project_name` in our own generated assets to `canister_name`, for things that are generated during canister build (and not project generation). Ref https://github.com/dfinity/dx-triage/issues/96
Per the design doc:
Adds asset canister methods:
Reworks the asset installer in
dfx
to use these methods. It can therefore upload assets that exceed the message ingress size. Separate work (which this PR enables) will have to updateagent-js
to download these large assets.Other than allowing the storage and retrieval of large assets, this PR does not address:
dfx
always uploads withcontent-type: application/octet-stream
andcontent-encoding: identity
dfx
always uploads all assets (even those that have not changed), and still does not delete assets that were previously uploaded but no longer exist.store()
,retrieve()
, andlist()
method signatures are unchanged for the time being, for backward compatibility. Later work will remove theretrieve()
method, change the semantics and parameters ofstore()
, and change the parameters and return type oflist()
.