aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-07-06 19:01:33 -0400
committerDeterminant <[email protected]>2019-07-06 19:01:33 -0400
commit7a52e54b14eed096acce1c224ab46626f7c8cbaf (patch)
treefac3fd58092cc50fc7168ff5febbdd688015c6c8 /src
parent24b6cea7be8b78eaa3681d6274d671057ed112b5 (diff)
...
Diffstat (limited to 'src')
-rw-r--r--src/hotstuff.cpp11
-rw-r--r--src/hotstuff_app.cpp22
2 files changed, 5 insertions, 28 deletions
diff --git a/src/hotstuff.cpp b/src/hotstuff.cpp
index 69501c0..5ae0fe6 100644
--- a/src/hotstuff.cpp
+++ b/src/hotstuff.cpp
@@ -80,17 +80,6 @@ void HotStuffBase::exec_command(uint256_t cmd_hash, commit_cb_t callback) {
cmd_pending.enqueue(std::make_pair(cmd_hash, callback));
}
-void HotStuffBase::do_elected() {
- // TODO: improve this
- tcall.async_call([this](salticidae::ThreadCall::Handle &) {
- HOTSTUFF_LOG_PROTO("reproposing waiting commands");
- std::vector<uint256_t> cmds;
- for (auto &p: decision_waiting)
- cmds.push_back(p.first);
- on_propose(cmds, pmaker->get_parents());
- });
-}
-
void HotStuffBase::on_fetch_blk(const block_t &blk) {
#ifdef HOTSTUFF_BLK_PROFILE
blk_profiler.get_tx(blk->get_hash());
diff --git a/src/hotstuff_app.cpp b/src/hotstuff_app.cpp
index 871bafb..a0fe80b 100644
--- a/src/hotstuff_app.cpp
+++ b/src/hotstuff_app.cpp
@@ -114,20 +114,6 @@ class HotStuffApp: public HotStuff {
resp_queue.enqueue(fin);
}
- void do_elected() override {
- HotStuff::do_elected();
- }
-
-//#ifdef HOTSTUFF_AUTOCLI
-// void do_demand_commands(size_t blk_size) override {
-// size_t ncli = client_conns.size();
-// size_t bsize = (blk_size + ncli - 1) / ncli;
-// hotstuff::MsgDemandCmd mdc{bsize};
-// for(const auto &conn: client_conns)
-// cn.send_msg(mdc, conn);
-// }
-//#endif
-
#ifdef HOTSTUFF_MSG_STAT
std::unordered_set<conn_t> client_conns;
void print_stat() const;
@@ -178,7 +164,8 @@ int main(int argc, char **argv) {
auto opt_help = Config::OptValFlag::create(false);
auto opt_pace_maker = Config::OptValStr::create("dummy");
auto opt_fixed_proposer = Config::OptValInt::create(1);
- auto opt_qc_timeout = Config::OptValDouble::create(0.5);
+ auto opt_base_timeout = Config::OptValDouble::create(1);
+ auto opt_prop_delay = Config::OptValDouble::create(1);
auto opt_imp_timeout = Config::OptValDouble::create(11);
auto opt_nworker = Config::OptValInt::create(1);
auto opt_repnworker = Config::OptValInt::create(1);
@@ -198,7 +185,8 @@ int main(int argc, char **argv) {
config.add_opt("tls-cert", opt_tls_cert, Config::SET_VAL);
config.add_opt("pace-maker", opt_pace_maker, Config::SET_VAL, 'p', "specify pace maker (dummy, rr)");
config.add_opt("proposer", opt_fixed_proposer, Config::SET_VAL, 'l', "set the fixed proposer (for dummy)");
- config.add_opt("qc-timeout", opt_qc_timeout, Config::SET_VAL, 't', "set QC timeout (for sticky)");
+ config.add_opt("base-timeout", opt_base_timeout, Config::SET_VAL, 't', "set the initial timeout for the Round-Robin Pacemaker");
+ config.add_opt("prop-delay", opt_prop_delay, Config::SET_VAL, 't', "set the delay that follows the timeout for the Round-Robin Pacemaker");
config.add_opt("imp-timeout", opt_imp_timeout, Config::SET_VAL, 'u', "set impeachment timeout (for sticky)");
config.add_opt("nworker", opt_nworker, Config::SET_VAL, 'n', "the number of threads for verification");
config.add_opt("repnworker", opt_repnworker, Config::SET_VAL, 'm', "the number of threads for replica network");
@@ -247,7 +235,7 @@ int main(int argc, char **argv) {
if (opt_pace_maker->get() == "dummy")
pmaker = new hotstuff::PaceMakerDummyFixed(opt_fixed_proposer->get(), parent_limit);
else
- pmaker = new hotstuff::PaceMakerRR(parent_limit, opt_qc_timeout->get(), ec);
+ pmaker = new hotstuff::PaceMakerRR(ec, parent_limit, opt_base_timeout->get(), opt_prop_delay->get());
HotStuffApp::Net::Config repnet_config;
ClientNetwork<opcode_t>::Config clinet_config;