Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

erasure coding: square width should vary per block instead of being fixed #68

Closed
liamsi opened this issue Sep 10, 2020 · 3 comments · Fixed by #79
Closed

erasure coding: square width should vary per block instead of being fixed #68

liamsi opened this issue Sep 10, 2020 · 3 comments · Fixed by #79
Labels
bug Something isn't working

Comments

@liamsi
Copy link
Member

liamsi commented Sep 10, 2020

Currently, the availableDataOriginalSquareSize does not depend on the amount of data in the block if I understand correctly:
https://github.com/lazyledger/lazyledger-specs/blob/master/specs/data_structures.md#consensus-parameters

What would be pros/cons to change this to depend on the amount of data in each block (and hence to vary per block)?

According to @adlerjohn:

But it could be made to vary per-block I guess. It would then need to be in the block header.

I think arranging the data into a square that depends on the total number of shares per block makes sense. Otherwise we might create large blocks for no reason.

@liamsi liamsi added help wanted Extra attention is needed question Further information is requested labels Sep 10, 2020
@musalbas
Copy link
Member

I think the size of the square definitely needs to be dynamic and not fixed, for security reasons. The lower the number of shares there are in a block, the more likely that all light clients will have collectively sampled them. Furthermore, having a fixed square size would mean that nodes need to do an amount of computation equivalent to the maximum block size to compute the root every time, which is very inefficient.

@adlerjohn
Copy link
Member

Makes sense to have it vary per block.

@liamsi liamsi changed the title Question: should the square width vary per block or should it be fixed? erasure coding: square width should vary per block instead of being fixed Sep 14, 2020
@liamsi liamsi added bug Something isn't working and removed help wanted Extra attention is needed question Further information is requested labels Sep 14, 2020
@liamsi
Copy link
Member Author

liamsi commented Sep 14, 2020

OK, seems like we all agree that this should vary per block. Updated the title and the labels to better reflect this decision.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants