From 745cb7a88baec540386f57edac7c84db889d63eb Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 3 Aug 2018 16:58:55 -0400 Subject: add pace maker option --- include/hotstuff/hotstuff.h | 2 +- include/hotstuff/liveness.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'include/hotstuff') diff --git a/include/hotstuff/hotstuff.h b/include/hotstuff/hotstuff.h index 41c83b4..b0a6827 100644 --- a/include/hotstuff/hotstuff.h +++ b/include/hotstuff/hotstuff.h @@ -128,7 +128,6 @@ class HotStuffBase: public HotStuffCore { size_t blk_size; /** libevent handle */ EventContext eb; - pacemaker_bt pmaker; private: /** whether libevent handle is owned by itself */ @@ -138,6 +137,7 @@ class HotStuffBase: public HotStuffCore { #ifdef HOTSTUFF_BLK_PROFILE BlockProfiler blk_profiler; #endif + pacemaker_bt pmaker; /* queues for async tasks */ std::unordered_map blk_fetch_waiting; std::unordered_map blk_delivery_waiting; diff --git a/include/hotstuff/liveness.h b/include/hotstuff/liveness.h index c87a242..c3d7d73 100644 --- a/include/hotstuff/liveness.h +++ b/include/hotstuff/liveness.h @@ -166,7 +166,7 @@ class PaceMakerDummyFixed: public PaceMakerDummy { * sees such new QC, if the QC is given by itself, it becomes the proposer, * otherwise yields to the creator of the QC as a follower. */ -class PMStickyProposer: public PMWaitQC { +class PMStickyProposer: virtual public PaceMaker { enum { PROPOSER, FOLLOWER, @@ -340,7 +340,7 @@ class PMStickyProposer: public PMWaitQC { public: void init(HotStuffCore *hsc) override { - PMWaitQC::init(hsc); + PaceMaker::init(hsc); to_candidate(); } @@ -370,6 +370,11 @@ class PMStickyProposer: public PMWaitQC { } }; +struct PaceMakerSticky: public PMAllParents, public PMStickyProposer { + PaceMakerSticky(int32_t parent_limit): + PMAllParents(parent_limit), PMStickyProposer() {} +}; + } #endif -- cgit v1.2.3-70-g09d2