Reassemble a chunked Wasm installation on ICP
A chunk store identifies pieces by hash. Installation also needs an ordered recipe for reconstructing the intended module.
Keep the upload manifest
Imagine a file split into three pieces whose first and last byte strings happen to match. Upload the two distinct pieces and keep three positions in the list passed to install_chunked_code. Enumerating stored_chunks and sorting its hashes would discard the repeated position and the original ordering.
module = A || B || A
chunk_hashes_list = [hash(A), hash(B), hash(A)]
wasm_module_hash = sha256(A || B || A)
Check the assembled bytes
Compute the expected full-module hash from exactly the byte stream you split. If installation reports a mismatch, reconstruct that stream locally from the manifest before uploading missing pieces. Successful upload of every unique chunk proves their availability but says nothing about their order.