celestiaorg / celestia-core

A fork of CometBFT
Apache License 2.0
489 stars 269 forks source link

merging back potentially split shares into corresponding fields of Block.Data #231

Closed liamsi closed 3 years ago

liamsi commented 3 years ago

Currently, there is no method to parse back the block.Data. This will be required to read the block though (#212).

Ideally, this would be implemented in a separate PR. The way this would work is to use the fact, that the shares are encoded with a length delimiter. So by reading the length from a share, we should be able to deduct the number of shares a Tx (messages / interm. state roots/ evidence) actually spans and merge the shares back together (if necessary).

ref: https://github.com/lazyledger/lazyledger-specs/issues/147

evan-forbes commented 3 years ago

can we close this issue?

liamsi commented 3 years ago

Yes, I think this is completed. Otherwise this would not work: https://github.com/lazyledger/lazyledger-core/blob/7fca45bbd271909c5c14bf1ce60071481540d600/p2p/ipld/read.go#L27