From 9e745354fe10f31b829f0c02a2aa464f391ffd19 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 18 Jul 2018 21:44:40 -0400 Subject: ... --- include/hotstuff/client.h | 15 +++++++++------ include/hotstuff/hotstuff.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'include/hotstuff') diff --git a/include/hotstuff/client.h b/include/hotstuff/client.h index 2127595..87e60b7 100644 --- a/include/hotstuff/client.h +++ b/include/hotstuff/client.h @@ -17,20 +17,23 @@ enum { struct Finality: public Serializable { ReplicaID rid; int8_t decision; + uint256_t cmd_hash; uint256_t blk_hash; public: Finality() = default; - Finality(ReplicaID rid, int8_t decision, uint256_t blk_hash): - rid(rid), decision(decision), blk_hash(blk_hash) {} + Finality(ReplicaID rid, int8_t decision, + uint256_t cmd_hash, uint256_t blk_hash): + rid(rid), decision(decision), + cmd_hash(cmd_hash), blk_hash(blk_hash) {} void serialize(DataStream &s) const override { - s << rid << decision; + s << rid << decision << cmd_hash; if (decision == 1) s << blk_hash; } void unserialize(DataStream &s) override { - s >> rid >> decision; + s >> rid >> decision >> cmd_hash; if (decision == 1) s >> blk_hash; } }; @@ -40,8 +43,8 @@ struct MsgClient: public salticidae::MsgBase<> { void gen_reqcmd(const Command &cmd); void parse_reqcmd(command_t &cmd, HotStuffCore *hsc) const; - void gen_respcmd(const uint256_t &cmd_hash, const Finality &fin); - void parse_respcmd(uint256_t &cmd_hash, Finality &fin) const; + void gen_respcmd(const Finality &fin); + void parse_respcmd(Finality &fin) const; void gen_chkcmd(const uint256_t &cmd_hash); void parse_chkcmd(uint256_t &cmd_hash) const; diff --git a/include/hotstuff/hotstuff.h b/include/hotstuff/hotstuff.h index 0aa83de..c8d8b5d 100644 --- a/include/hotstuff/hotstuff.h +++ b/include/hotstuff/hotstuff.h @@ -168,7 +168,7 @@ class HotStuffBase: public HotStuffCore { /* the API for HotStuffBase */ /* Submit the command to be decided. */ - ReplicaID add_command(command_t cmd); + promise_t exec_command(command_t cmd); void add_replica(ReplicaID idx, const NetAddr &addr, pubkey_bt &&pub_key); void start(bool eb_loop = false); -- cgit v1.2.3-70-g09d2