Skip to content

Move and refactor the PutBlock method #196

@evan-forbes

Description

@evan-forbes

The PutBlock method was introduced as a method to Block in #178. Having PutBlock where it is now adds network dependencies to the types package, which is undesirable. The original thinking in doing so was so that erasured data could be cached instead of recomputed. While caching the erasured data is still a good idea, it was not implemented in #178 and does not necessarily require PutBlock being a method to Block.

We should probably make PutBlock a function and move it to a different package. This will require a general refactor, which includes exporting the utility function shared by PutBlock and fillDataAvailabilityHeader.

As for where to move it, per a suggestion by @liamsi, I think we should move PutBlock and it's related code to lazyledger-core/p2p/ipld.

ref: #178 (comment)

Metadata

Metadata

Assignees

Labels

C:dhtDHT and p2p related issues (IPFS mostly)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions