parallelchain-io / hotstuff_rs

Rust implementation of the HotStuff consensus algorithm.
34 stars 4 forks source link

removing yield_now() and detecting malicious behaviour #3

Closed ghost closed 1 year ago

ghost commented 1 year ago
  1. Remove thread::yield_now() from the code. It is not good practice to use these as it increases CPU loading and reduces throughput.
  2. I don't see handling of blocks that are malicious anywhere? Does the library expect the user to handle this by themselves? If yes how is it done. Provide some help. Sad I would expect this feature to be there.
lyulka commented 1 year ago

The point about yield_now is well noted, but difficult to improve without making Network async (which we are considering for a future major release).

The library some aspects of proposed blocks (e.g., signatures) for whether they are “malicious”, but not all. Most notably, blocks’ data are totally App-provided, so apps should decide whether a proposed block’s data is valid.

Return Invalid from App::validate_block_request if a block is invalid according to your application’s rules.

lyulka commented 1 year ago

Closing due to lack of activity.