Skip to content

Conversation

@ong-jonas
Copy link
Collaborator

Requirements

  1. Edit item docs and internal comments to be more informative and contain the latest information.

  2. Refactor ambiguous relationship between the engine and network_handle modules. Specifically, adding engine thread JoinHandle<()> to allow a graceful shutdown of the network and implementing a more intuitive NetworkHandle via [Peer] struct.

    struct Peer {
        engine: JoinHandle<()>,
        to_engine: Sender<EngineCommand>,
    }

    impl Peer {
        pub fn broadcast_mempool_msg(&self, txn: TransactionV1ToV2);
        pub fn broadcast_hotstuff_rs_msg(&self, msg: hotstuff_rs::Message);
        pub fn broadcast_dropped_txn_msg(&self, msg: DroppedTxnMessage);
        pub fn send_hotstuff_rs_msg(&self, msg: hotstuff_rs::Message);
   } 
  1. Removing “Send To” and “Broadcast” semantics in the codebase, instead a topic-oriented semantics is preferred (one topic for HotStuff-rs, one topic for Mempool).

  2. Implementation of EngineCommand

    enum EngineCommand {
        Publish(Topic, Message),
        Shutdown,
    }
  1. Rename topics as shown to make relationship between Consensus and Mailbox topics more explicit.
    pub enum Topic {
        HotStuffRsBroadcast,
        HotStuffRsSend(PeerID),
        Mempool,
        DroppedTxns,
    }
  1. The concrete type of the error type of engine::start should be present instead of using Box.

  2. Consistent Logging, detail and text formatting.

  3. Consistent “use” statements

@ong-jonas ong-jonas closed this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant