-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(erasure_coding): introduce erasure coding for PoV Distributor #3281
Conversation
3fb226c
to
76b4323
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fd5543b
to
76ff2bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool stuff. I have a few comments. It should be good to go after that!
Now that there is a feature branch for parachains |
b0ac8d0
to
4ed66eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic!!
@@ -186,17 +183,12 @@ func readLEB128ToUint64(r io.Reader, buf []byte) (uint64, int, error) { | |||
} | |||
|
|||
// readStream reads from the stream into the given buffer, returning the number of bytes read | |||
func readStream(stream libp2pnetwork.Stream, bufPointer *[]byte, maxSize uint64) (int, error) { | |||
func readStream(stream libp2pnetwork.Stream, bufPointer *[]byte, maxSize uint64) (tot int, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opinion/preference: better to not use named returns to avoid returning unexpectedly by mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, these changes were from @EclesioMeloJunior (I'm not sure why they're showing as changes on this PR, I think I may have done something wrong when rebasing this branch onto feat/parachain.)
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…hainSafe#3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…hainSafe#3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
…3281) Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com> Co-authored-by: Edward Mack <emack@pop-os.localdomain>
Changes
This PR introduces functions to implement erasure coding for use by PoV Distributor for sharding PoV bytes.
ObtainChunks
splits the provided data intovalidatorsQty
number of chunks plus additional parity chunks for reconsturctionReconstruct
reconstructs decodable data from a set of chunks.This uses Reed-Solomon Erasure Coding go library created by Backblaze, see blog post for details.
Currently these function work with []byte data, future functions will construct chunks from PoV structs.
Tests
go test github.com/ChainSafe/gossamer/lib/erasure-coding -v
Issues
Regarding issue #3275
Primary Reviewer
@kishansagathiya
@timwu20