Merge branch 'master' into feature/ceremony-files

This commit is contained in:
Veaceslav Doina 2024-06-26 05:40:14 +03:00
commit 3c17e130ca
No known key found for this signature in database
GPG Key ID: 351E7AA9BD0DFEB8
2 changed files with 13 additions and 6 deletions

View File

@ -11,6 +11,7 @@ env:
nim_version: v1.6.14 nim_version: v1.6.14
rust_version: 1.78.0 rust_version: 1.78.0
binary_base: codex binary_base: codex
nim_flags: '-d:verify_circuit=true'
upload_to_codex: false upload_to_codex: false
jobs: jobs:
@ -74,7 +75,7 @@ jobs:
- name: Release - Build - name: Release - Build
run: | run: |
make NIMFLAGS="--out:${{ env.binary }}" make NIMFLAGS="--out:${{ env.binary }} ${{ env.nim_flags }}"
- name: Release - Upload binaries - name: Release - Upload binaries
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -240,14 +240,14 @@ proc streamEntireDataset(
self: CodexNodeRef, self: CodexNodeRef,
manifest: Manifest, manifest: Manifest,
manifestCid: Cid, manifestCid: Cid,
): ?!LPStream = ): Future[?!LPStream] {.async.} =
## Streams the contents of the entire dataset described by the manifest. ## Streams the contents of the entire dataset described by the manifest.
## ##
trace "Retrieving blocks from manifest", manifestCid trace "Retrieving blocks from manifest", manifestCid
if manifest.protected: if manifest.protected:
# Retrieve, decode and save to the local store all EС groups # Retrieve, decode and save to the local store all EС groups
proc erasureJob(): Future[void] {.async.} = proc erasureJob(): Future[?!void] {.async.} =
try: try:
# Spawn an erasure decoding job # Spawn an erasure decoding job
let let
@ -258,10 +258,16 @@ proc streamEntireDataset(
self.taskpool) self.taskpool)
without _ =? (await erasure.decode(manifest)), error: without _ =? (await erasure.decode(manifest)), error:
trace "Unable to erasure decode manifest", manifestCid, exc = error.msg trace "Unable to erasure decode manifest", manifestCid, exc = error.msg
except CatchableError as exc: # --------------------------------------------------------------------------
# FIXME this is a HACK so that the node does not crash during the workshop.
# We should NOT catch Defect.
except Exception as exc:
trace "Exception decoding manifest", manifestCid, exc = exc.msg trace "Exception decoding manifest", manifestCid, exc = exc.msg
return failure(exc.msg)
# --------------------------------------------------------------------------
asyncSpawn erasureJob() if err =? (await erasureJob()).errorOption:
return failure(err)
# Retrieve all blocks of the dataset sequentially from the local store or network # Retrieve all blocks of the dataset sequentially from the local store or network
trace "Creating store stream for manifest", manifestCid trace "Creating store stream for manifest", manifestCid
@ -283,7 +289,7 @@ proc retrieve*(
return await self.streamSingleBlock(cid) return await self.streamSingleBlock(cid)
self.streamEntireDataset(manifest, cid) await self.streamEntireDataset(manifest, cid)
proc store*( proc store*(
self: CodexNodeRef, self: CodexNodeRef,