spacemeshos / post

Spacemesh POST protocol implementation
MIT License
19 stars 20 forks source link

PoST package structure for v1.0 #116

Open fasmat opened 1 year ago

fasmat commented 1 year ago

The package structure of PoST is quite confusing and could be improved for the next major release. I propose the following layout for clearer naming of types and generally reducing the number of individual packages a user of the library has to interact with:

With this structure it is unlikely that a user of the library has to import more than one package at a time, while at the moment proving and verifying also always require to also import config and shared both of which collide with packages with the same name in other modules. post.Config is more meaningful than config.Config, proving.Generate/ verifying.Verify are less clear compared to proof.Generate / proof.Verify.

Also there is a clear dependency chain between packages of these structure:

post/proof -> post -> post/internal

The former packages only import the later and not vice versa.

fasmat commented 1 year ago

From architecture discussion: