PoC-Consortium / engraver

PoCC Burstcoin Reference Plotter
MIT License
63 stars 39 forks source link

engraver writestatus call corrupts bytes at end of file when not using direct io #44

Closed mmullis closed 6 years ago

mmullis commented 6 years ago

Testing some plots with TurboPlotter 0.9.1+ indicates end of plot file is invalid when NOT using direct io. Used TP9K on both windows and mac with same result.

Tracked it down to this code that calls writestatus after the plot is written.

  if (! use_direct_io) {
            writestatus();
   }

Example cmd: ./plot64 -v -d ./plots -s 1200000 -n 1000 -t 8 -k 888888801 -X 0

A possible fix would be to increase the file size to hold the resume id and write it as much as needed. Once the plot is complete, truncate to remove the unnecessary resume data at end of file.

JohnnyFFM commented 6 years ago

Has been fixed in Engraver 2.0. Plot files status is written using indirect i/o now.