From 6131c5e5cc1e83fdbfbc8fc4ce419765ba3d180a Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 31 Jul 2018 13:24:14 -0400 Subject: add cmake options --- include/hotstuff/consensus.h | 3 ++- include/hotstuff/entity.h | 4 ++-- include/hotstuff/hotstuff.h | 2 +- include/hotstuff/util.h | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include/hotstuff') diff --git a/include/hotstuff/consensus.h b/include/hotstuff/consensus.h index cb86bf6..1ff8f79 100644 --- a/include/hotstuff/consensus.h +++ b/include/hotstuff/consensus.h @@ -57,7 +57,8 @@ class HotStuffCore { * functions. */ void on_init(uint32_t nfaulty) { config.nmajority = 2 * nfaulty + 1; } - /** Call to deliver a block. + /* TODO: better name for "delivery" ? */ + /** Call to inform the state machine that a block is ready to be handled. * A block is only delivered if itself is fetched, the block for the * contained qc is fetched and all parents are delivered. The user should * always ensure this invariant. The invalid blocks will be dropped by this diff --git a/include/hotstuff/entity.h b/include/hotstuff/entity.h index ba3906b..333b66e 100644 --- a/include/hotstuff/entity.h +++ b/include/hotstuff/entity.h @@ -266,7 +266,7 @@ class EntityStorage { if (blk.get_cnt() == 2) /* only referred by blk and the storage */ { const auto &blk_hash = blk->get_hash(); -#ifdef HOTSTUFF_ENABLE_LOG_PROTO +#ifdef HOTSTUFF_PROTO_LOG HOTSTUFF_LOG_INFO("releasing blk %.10s", get_hex(blk_hash).c_str()); #endif for (const auto &cmd: blk->get_cmds()) @@ -274,7 +274,7 @@ class EntityStorage { blk_cache.erase(blk_hash); return true; } -#ifdef HOTSTUFF_ENABLE_LOG_PROTO +#ifdef HOTSTUFF_PROTO_LOG else HOTSTUFF_LOG_INFO("cannot release (%lu)", blk.get_cnt()); #endif diff --git a/include/hotstuff/hotstuff.h b/include/hotstuff/hotstuff.h index 4e7332f..287cbac 100644 --- a/include/hotstuff/hotstuff.h +++ b/include/hotstuff/hotstuff.h @@ -135,7 +135,7 @@ class HotStuffBase: public HotStuffCore { bool eb_loop; /** network stack */ PeerNetwork pn; -#ifdef HOTSTUFF_ENABLE_BLK_PROFILE +#ifdef HOTSTUFF_BLK_PROFILE BlockProfiler blk_profiler; #endif /* queues for async tasks */ diff --git a/include/hotstuff/util.h b/include/hotstuff/util.h index 2b02cfd..99b5ea4 100644 --- a/include/hotstuff/util.h +++ b/include/hotstuff/util.h @@ -13,12 +13,12 @@ class Logger: public salticidae::Logger { extern Logger logger; -#ifdef HOTSTUFF_ENABLE_DEBUG_LOG +#ifdef HOTSTUFF_DEBUG_LOG #define HOTSTUFF_NORMAL_LOG #define HOTSTUFF_ENABLE_LOG_DEBUG #endif -#ifdef HOTSTUFF_ENABLE_NORMAL_LOG +#ifdef HOTSTUFF_NORMAL_LOG #define HOTSTUFF_ENABLE_LOG_INFO #define HOTSTUFF_ENABLE_LOG_WARN #endif @@ -43,7 +43,7 @@ extern Logger logger; #define HOTSTUFF_LOG_ERROR(...) hotstuff::logger.error(__VA_ARGS__) -#ifdef HOTSTUFF_ENABLE_BLK_PROFILE +#ifdef HOTSTUFF_BLK_PROFILE class BlockProfiler { enum BlockState { BLK_SEEN, -- cgit v1.2.3-70-g09d2