Quickfix: start erasure decoding once any K blocks arrived (#199)

ECC decoding can be done with any encoded.K blocks, and now we start it once any K blocks arrived.

Previous code essentially waited for all blocks to arrive (or fail to arrive), that may mean unnecessary delays.

New code will sometimes ECC-decode when parity blocks were retrieved faster that data blocks (instead of waiting for data blocks from network), but we expect that it's OK due to extremely fast Leopard decoding (~~500 MB/s)
This commit is contained in:
Bulat-Ziganshin 2022-08-20 06:21:55 +03:00 committed by GitHub
parent e48450d671
commit 7ec039f822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -200,7 +200,9 @@ proc decode*(
resolved = 0 resolved = 0
while true: while true:
if resolved >= (encoded.K + encoded.M) or idxPendingBlocks.len <= 0: # Continue to receive blocks until we have just enough for decoding
# or no more blocks can arrive
if (resolved >= encoded.K) or (idxPendingBlocks.len == 0):
break break
let let