Skip to content

feature: Service-worker. Add certified streaming for chunkified assets#5

Closed
3cL1p5e7 wants to merge 1 commit intodfinity:masterfrom
3cL1p5e7:feature/service-worker-streaming-chunks
Closed

feature: Service-worker. Add certified streaming for chunkified assets#5
3cL1p5e7 wants to merge 1 commit intodfinity:masterfrom
3cL1p5e7:feature/service-worker-streaming-chunks

Conversation

@3cL1p5e7
Copy link
Copy Markdown

@3cL1p5e7 3cL1p5e7 commented Feb 9, 2022

Problem:

for assets over 2mb size, verification did not pass. This is because the worker only loads and checks the sha256-hashes of the first chunk. Obviously, the hash of the chunk and the hash of the entire file (in sha256 field) do not match.

Solution:

Make service-worker to load and concat all chunks before hash-check.

Important

This PR is related, but not blocked by 2 others
dfinity/icp-js-core#527
dfinity/certified-assets#22

Comments:

  • Now service-worker can check certificates for any assets over 2mb size.
  • It was necessary to update the Jest because I caught an error Wrong magic number when I did IDL.encode -> IDL.decode. Current Jest setup corresponds to dfinity/agent-js/agent setup.
  • fetch: self.fetch.bind(self) is passed to HttpAgent intentionally. See fix: fetch binding icp-js-core#527

Waiting for comments on implementation

@Ali-Piccioni
Copy link
Copy Markdown
Contributor

droid update

@ghost ghost added the external_contributor label May 4, 2022
@Ali-Piccioni Ali-Piccioni reopened this May 4, 2022
@ghost
Copy link
Copy Markdown

ghost commented May 4, 2022

Dear @3cL1p5e7,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

@ghost ghost closed this May 4, 2022
@ghost
Copy link
Copy Markdown

ghost commented May 4, 2022

Dear @3cL1p5e7,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

2 similar comments
@ghost
Copy link
Copy Markdown

ghost commented May 4, 2022

Dear @3cL1p5e7,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

@ghost
Copy link
Copy Markdown

ghost commented May 4, 2022

Dear @3cL1p5e7,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

gitlab-dfinity pushed a commit that referenced this pull request May 10, 2024
gitlab-dfinity pushed a commit that referenced this pull request May 10, 2024
Feat(NODE-1353): Consolidate rootfs utils #5

 

See merge request dfinity-lab/public/ic!19185
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants