diff --git a/script/research/consensusd/src/main.rs b/script/research/consensusd/src/main.rs index 18d4fc540..405c17b48 100644 --- a/script/research/consensusd/src/main.rs +++ b/script/research/consensusd/src/main.rs @@ -67,8 +67,8 @@ async fn api_service_init(executor: Arc>, config: &ConsensusdConfig /// RPCAPI: /// Node checks if its the current slot leader and generates the slot Block (represented as a Vote structure). -/// TODO: 1. Nodes count not hard coded. -/// 2. Proposed block broadcast. +/// Missing: 1. Nodes count not hard coded. +/// 2. Proposed block broadcast. fn proposal_task(config: &ConsensusdConfig) { let state_path = expand_path(&config.state_path).unwrap(); let id = config.id; @@ -90,7 +90,7 @@ fn proposal_task(config: &ConsensusdConfig) { if proposed_block.is_none() { println!("Node is not the epoch leader. Sleeping till next epoch..."); } else { - // TODO: Proposed block broadcast. + // Missing: Proposed block broadcast. println!("Node is the epoch leader. Proposed block: {:?}", proposed_block); } diff --git a/script/research/consensusd/src/service/api_service.rs b/script/research/consensusd/src/service/api_service.rs index ca20f6dbd..91e1950f8 100644 --- a/script/research/consensusd/src/service/api_service.rs +++ b/script/research/consensusd/src/service/api_service.rs @@ -86,9 +86,9 @@ impl APIService { /// Node checks if its the current slot leader and generates the slot Block (represented as a Vote structure). /// --> {"jsonrpc": "2.0", "method": "consensus_task", "params": [1], "id": 0} /// <-- {"jsonrpc": "2.0", "result": [PublicKey, Vote], "id": 0} - /// TODO: 1, This should be a scheduled task. - /// 2. Nodes count not from request. - /// 3. Proposed block broadcast. + /// Missing: 1, This should be a scheduled task. + /// 2. Nodes count not from request. + /// 3. Proposed block broadcast. async fn consensus_task(&self, params: Value) -> JsonResult { let args = params.as_array().unwrap(); @@ -114,7 +114,7 @@ impl APIService { serde_json::to_value(self.id).unwrap(), )) } else { - // TODO: Proposed block broadcast. + // Missing: Proposed block broadcast. JsonResult::Resp(jsonresp( json!((state.public_key, x)), serde_json::to_value(self.id).unwrap(), @@ -134,8 +134,8 @@ impl APIService { /// Node receives a proposed block, verifies it and stores it in its current state. /// --> {"jsonrpc": "2.0", "method": "receive_proposed_block", "params": [PublicKey, Vote, 1], "id": 0} /// <-- {"jsonrpc": "2.0", "result": [PublicKey, Vote], "id": 0} - /// TODO: 1. Nodes count not from request. - /// 2. Vote broadcast. + /// Missing: 1. Nodes count not from request. + /// 2. Vote broadcast. async fn receive_proposed_block(&self, params: Value) -> JsonResult { let args = params.as_array().unwrap(); @@ -166,7 +166,7 @@ impl APIService { serde_json::to_value(self.id).unwrap(), )) } else { - // TODO: Vote broadcast. + // Missing: Vote broadcast. JsonResult::Resp(jsonresp( json!((state.public_key, x)), serde_json::to_value(self.id).unwrap(), @@ -186,7 +186,7 @@ impl APIService { /// Node receives a block vote and perform the consensus protocol corresponding functions, based on its current state. /// --> {"jsonrpc": "2.0", "method": "receive_vote", "params": [PublicKey, Vote, 1], "id": 0} /// <-- {"jsonrpc": "2.0", "result": true, "id": 0} - /// TODO: 1. Nodes count not from request. + /// Missing: 1. Nodes count not from request. async fn receive_vote(&self, params: Value) -> JsonResult { let args = params.as_array().unwrap(); diff --git a/script/research/consensusd/src/service/state.rs b/script/research/consensusd/src/service/state.rs index 30d2208eb..ea2249ff5 100644 --- a/script/research/consensusd/src/service/state.rs +++ b/script/research/consensusd/src/service/state.rs @@ -40,7 +40,7 @@ pub struct State { impl State { pub fn new(id: u64, genesis_time: Timestamp, init_block: Block) -> State { - // TODO: clock sync + // Missing: clock sync let secret = SecretKey::random(&mut OsRng); State { id, diff --git a/script/research/streamlet_rust/src/structures/node.rs b/script/research/streamlet_rust/src/structures/node.rs index 19a710344..09e8c0810 100644 --- a/script/research/streamlet_rust/src/structures/node.rs +++ b/script/research/streamlet_rust/src/structures/node.rs @@ -40,7 +40,7 @@ pub struct Node { impl Node { pub fn new(id: u64, genesis_time: Instant, init_block: Block) -> Node { - // TODO: clock sync + // Missing: clock sync const K: u32 = 11; let secret = SecretKey::random(&mut OsRng); Node { diff --git a/script/research/validatord/src/consensus/state.rs b/script/research/validatord/src/consensus/state.rs index a691124d2..75e5255eb 100644 --- a/script/research/validatord/src/consensus/state.rs +++ b/script/research/validatord/src/consensus/state.rs @@ -127,7 +127,7 @@ pub struct ValidatorState { impl ValidatorState { pub fn new(db_path: PathBuf, id: u64, genesis: i64) -> Result { - // TODO: clock sync + // Missing: clock sync let secret = SecretKey::random(&mut OsRng); let db = sled::open(db_path)?; let public = PublicKey::from_secret(secret);