spacemeshos / post

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

add -theads and -nonces into postcli -genproof #221

Open pigmej opened 1 year ago

pigmej commented 1 year ago

To have a more realistic time and -genproof we should add threads and nonces to the CLI. Also that will mean that the -genproof will be able to do exactly the same as node will do in cycle_gap.

maxpla3 commented 1 year ago

I see two use cases for genproof:

  1. Check the initialized data. In general, one would like to do this check as fast as possible. I.e. using as many threads as possible makes sense.
  2. Measure the required time for proof generation. In this case one would set threads and nonces to the exact same values as will be used by the node.

Allowing the user to provide threads and nonces would improve 1 and enable 2.

Another useful addition would be to show the consumed time for pow and disk read individually after proof has been generated. Something like this:

Required time for PoW: 123 seconds
Required time for post read: 456 seconds
Mean read speed: 150MiB/s
reythia commented 1 year ago

PR added for the basics.

We should consider separating -genproof from initialising data and https://github.com/spacemeshos/post/issues/219 before expanding genproof use amongst users.

As it stands postcli runs through the intialising processes and only then runs -genproof. It means users have to supply the post generating arguments to run -genproof.

A user running -genproof without supplying -numunits can lead to data loss.

reythia commented 1 year ago

-genproof usage can also be enhanced by https://github.com/spacemeshos/post-rs/pull/119

Currently a user running -genproof (or the poet cycle gap) may struggle to diferentiate the k2pow phase from the post reading phase.