massa icon indicating copy to clipboard operation
massa copied to clipboard

Internal Audit: Massa-PoS-Worker

Open dr-chain opened this issue 1 year ago • 1 comments

Function feed_cycle It is a non-blocking function where the worker is separate, so the feed is queued and not applied immediately and that's done to avoid blocking while drawing. This is because the drawing is heavy (~70k long sequence) and may get even heavier (~400k+) when the requirements of super majority w.r.t. endorsements kick in.

Function perform_draws It uses BTreeMap to store the address <->rolls mapping. Although not efficient as a hashmap, it still is the best choice since the order has to be maintained.

PR to include the above details: #3689

If they are implemented somewhere else, we can move them here so that we are coherent w.r.t. other modules.

Further possible improvements (with inputs from @damip)

  • [ ] warning in case of time mismatch
  • [ ] crossbeam for better perf
  • [ ] crossbeam to alert in case of channel congestion
  • [ ] checking timestamp instead of the draw cycles to see if we have the right draw cycle to return

dr-chain avatar Mar 15 '23 11:03 dr-chain

@AurelienFT @Eitu33 I will create a PR and add those changes soon.

dr-chain avatar Mar 15 '23 12:03 dr-chain