feat: ic-certified-assets. Add chunk trees for certification #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
That is a part of proposal about chunks certification (with backward compatibility).
These improvements are a proposal to improve the certification infrastructure around IC and might be considered as a recommendation for dfinity-team.
Goal
Make it possible to certify asset chunks. Validate chunk certificates on the service-worker and icx-proxy.
Why
At the moment, the service-worker and icx-proxy does not support the certification of chunkified files. Moreover, right now it is not possible to correctly stream chunkified and large audio and video files to the front-end.
This problems could be solved independently if it would be possible to install an additional service-worker in the certified zone of the domain
ic0.app
(for 206 partial http-request handling). But is is impossible because there is unable to place custom worker onic0.app
domain.Making your own custom player for audio and video is extremely difficult due to the large number of formats and non-native implementation.
Details
To make this possible, support for HTTP-range requests for
http_request
query method has been added. This is done to support native htmlaudio/video
element (which uses 206 partial http-request) and to determine the index of the chunk throught 206 partial http-request.Using 206 partial http-requests allows you to focus only on certification in the worker and icx-proxy.
Steps