aboutsummaryrefslogtreecommitdiff
path: root/include/hotstuff/consensus.h
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-18 14:34:43 -0400
committerDeterminant <[email protected]>2018-07-18 14:34:43 -0400
commit780cfa4ee8faf4c2662f3c739e8a5c9f1c8a1826 (patch)
treee54d5ecbb11634e9f2c211dd4cddd8903cda86d9 /include/hotstuff/consensus.h
parente08bf4e6a40cf82822c50b1433a573d0d8800f80 (diff)
move parent selection to PaceMaker
Diffstat (limited to 'include/hotstuff/consensus.h')
-rw-r--r--include/hotstuff/consensus.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/hotstuff/consensus.h b/include/hotstuff/consensus.h
index cb18db5..73d47ef 100644
--- a/include/hotstuff/consensus.h
+++ b/include/hotstuff/consensus.h
@@ -40,14 +40,11 @@ class HotStuffCore {
protected:
ReplicaID id; /**< identity of the replica itself */
- const int32_t parent_limit; /**< maximum number of parents */
public:
BoxObj<EntityStorage> storage;
- HotStuffCore(ReplicaID id,
- privkey_bt &&priv_key,
- int32_t parent_limit);
+ HotStuffCore(ReplicaID id, privkey_bt &&priv_key);
virtual ~HotStuffCore() = default;
/* Inputs of the state machine triggered by external events, should called
@@ -73,8 +70,11 @@ class HotStuffCore {
* The block mentioned in the message should be already delivered. */
void on_receive_vote(const Vote &vote);
- /** Call to submit new commands to be decided (executed). */
- void on_propose(const std::vector<command_t> &cmds);
+ /** Call to submit new commands to be decided (executed). "Parents" must
+ * contain at least one block, and the first block is the actual parent,
+ * while the others are uncles/aunts */
+ void on_propose(const std::vector<command_t> &cmds,
+ const std::vector<block_t> &parents);
/* Functions required to construct concrete instances for abstract classes.
* */
@@ -127,6 +127,7 @@ class HotStuffCore {
const ReplicaConfig &get_config() { return config; }
int8_t get_cmd_decision(const uint256_t &cmd_hash);
ReplicaID get_id() const { return id; }
+ const std::set<block_t, BlockHeightCmp> get_tails() const { return tails; }
operator std::string () const;
};