Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bos dpos pbft #34

Merged
merged 117 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
13ba0a3
dpos pbft
qianxiaofeng Dec 4, 2018
e3a5548
merge bos develop and resolve conflict
qianxiaofeng Dec 4, 2018
4b07cbf
bug fix: ignore empty certificate on view change validation
VincentOCL Dec 4, 2018
1739686
Merge branch 'feature/dpos-pbft' into feature/bos-dpos-pbft
qianxiaofeng Dec 4, 2018
a92589f
bug fix: force switch to new schedule when there is new schedule in p…
VincentOCL Dec 6, 2018
de5b3de
Merge branch 'feature/dpos-pbft' into feature/bos-dpos-pbft
qianxiaofeng Dec 6, 2018
c60b4d7
open view change related logs.
Dec 7, 2018
4fc0b6a
separate checkpoint db from pbft state
Dec 7, 2018
93f7899
update certificate validations.
Dec 7, 2018
5496207
add logs for large scale debug.
Dec 7, 2018
a1e568b
bug fix: generate prepare (commit) certificates with valid prepare (c…
Dec 7, 2018
b1f7367
turn on view change related logs for testing.
Dec 8, 2018
897365a
extend waiting time on BP schedule change.
Dec 8, 2018
9e23af3
Merge remote-tracking branch 'origin/debug' into feature/dpos-pbft
Dec 9, 2018
63e5ddd
separate checkpoint db from state db; remove dpos confirm related logic.
Dec 10, 2018
c67fcb8
move checkpoints dir into blocks dir; open more logs for debug.
Dec 10, 2018
fcd959b
no longer persist target view (default value will be current view +1)…
Dec 10, 2018
a1f7f59
bug fix: avoid fetching empty block state.
Dec 10, 2018
1a7f6b4
open prepare-adding related logs
Dec 10, 2018
6cb6d07
bug fix: inappropriate comparision may lead to crash during sorting.
Dec 11, 2018
6f6c135
force activate schedule once gpo is set.
Dec 11, 2018
2fbb45c
remove unnecessary logs.
Dec 11, 2018
9a9761a
force all bps, who belong to any schedule in fork db blocks, sending …
Dec 12, 2018
cde9086
bp candidates are involved in pbft consensus.
Dec 13, 2018
919dfbc
bug fix: proposed new view should be strictly equal to view changed c…
Dec 13, 2018
42d467f
open new_view related logs.
Dec 13, 2018
3c4ba8d
force new view check, even if I am the primary.
Dec 13, 2018
6027d47
bug fix: calculate primary key
Dec 13, 2018
a209a85
extend view change timeout to 8 sec.
Dec 14, 2018
73da364
skip view change validation for test.
Dec 14, 2018
1b2c335
skip new view validation for test.
Dec 14, 2018
c0f72ce
add prepare validation
Dec 14, 2018
bcb0d3b
update prepared(committed) cert validation, add uuid info for view ch…
Dec 17, 2018
87e47d6
open view change validation related log.
Dec 17, 2018
dd907c7
increase prepare (commit) timeout to 2s.
Dec 17, 2018
6ef6e5f
remove unnecessary logs; optimise msg validation.
Dec 18, 2018
d6ecd17
remove unnecessary validations
Dec 18, 2018
341d590
remove uuid from pbft msgs; only publish new msgs into chain plugin.
Dec 19, 2018
7a3b246
reformat end itr validation.
Dec 19, 2018
902216c
include chain_id into pbft msgs; extend msg cache ttl to very long.
Dec 20, 2018
ad3c9d7
include chain_id into pbft msgs; extend msg cache ttl to very long.
Dec 20, 2018
c887cbc
skip all signature validation for test.
Dec 20, 2018
47d1db8
change to fetch from forkdb
qianxiaofeng Dec 20, 2018
1a00450
fix crash bug
qianxiaofeng Dec 20, 2018
40edec1
optimise certificate validation
Dec 20, 2018
77e7173
add uuid into pbft msgs
Dec 20, 2018
109df31
replace committed cert with stable checkpoint; use stable checkpoints…
Dec 21, 2018
582406d
send view change immediately on transition to veiw change state (do n…
Dec 21, 2018
8349b03
increase view change waiting time.
Dec 21, 2018
32571d2
bug fix: fetch stable checkpoint block id.
Dec 21, 2018
482997f
remove sig validation for profiling
Dec 24, 2018
24841bb
bug fix: accept prepare(commit) msgs from bp candidates; enqueue msg …
Dec 25, 2018
c456513
skip cert check on view change msgs
Dec 26, 2018
3dd7802
no pbft msgs if all connections are syncing
Dec 26, 2018
3651da0
use stable checkpoints as view change cert
Dec 26, 2018
463d6eb
add current view into view change msg.
Dec 26, 2018
9a4d34c
skip sig check for profiling; add timestamp & current view in view ch…
Dec 26, 2018
29cf06f
force resend checkpoints; send msgs only to active connections
Dec 26, 2018
c474e21
optimise debug log.
Dec 26, 2018
4681642
add constructor (destructor) log for pbft ctrl;
Dec 26, 2018
8c02eb1
add timestamp to all pbft msgs; skip all msgs that are generated befo…
Dec 27, 2018
03a52d3
add connection monitor log
qianxiaofeng Dec 27, 2018
ec03953
add more connection monitor info
qianxiaofeng Dec 27, 2018
05abee1
add view assertion
Dec 27, 2018
d28d0b2
Merge remote-tracking branch 'origin/feature/dpos-pbft' into feature/…
qianxiaofeng Dec 29, 2018
2486469
remove debug logs; optimise some implementation.
Dec 29, 2018
0372028
Merge remote-tracking branch 'origin/feature/dpos-pbft' into feature/…
qianxiaofeng Dec 29, 2018
c0bd6f9
prevent bp set lib via checkpoints; force send prepare (commit) msg a…
Dec 29, 2018
3377cc9
Merge remote-tracking branch 'origin/feature/dpos-pbft' into feature/…
qianxiaofeng Dec 29, 2018
90484c7
merge bos develop
qianxiaofeng Dec 29, 2018
be88c15
enable net plugin queue log and restrict out queue size to 10
qianxiaofeng Dec 31, 2018
b255b5f
dont send pbft untili handshake finished
qianxiaofeng Dec 31, 2018
49504a0
use pbft_queue to send pbft message
qianxiaofeng Dec 31, 2018
078fadd
bug fix: treat an isolated node as synced one.
Jan 1, 2019
79bb2c2
add log
qianxiaofeng Jan 2, 2019
1ca5d18
revert Dockerfile
qianxiaofeng Jan 2, 2019
e9e4dba
fix network issue by adding pbft queue and timeout
qianxiaofeng Jan 2, 2019
f30b788
Merge branch 'feature/dpos-pbft' into feature/bos-dpos-pbft
qianxiaofeng Jan 2, 2019
1a9069b
separate outqueue limit for write queue and pbft queue
qianxiaofeng Jan 2, 2019
d730bf6
add debug log in handle pbft msg.
Jan 2, 2019
12b1a66
check write queue size for safty
qianxiaofeng Jan 2, 2019
1562822
add log
qianxiaofeng Jan 2, 2019
b2f22a5
update log
qianxiaofeng Jan 2, 2019
674264b
disable 'syncing' & 'current' check; add set_view api in producer api…
Jan 3, 2019
8d8d967
remove write queue size limit, add log for local_txns
qianxiaofeng Jan 3, 2019
8dd0989
Merge branch 'feature/dpos-pbft-fix-network-issue-with-log' of https:…
qianxiaofeng Jan 3, 2019
7185786
clear outqueue when close conn
qianxiaofeng Jan 3, 2019
d5aa7ef
Merge branch 'feature/dpos-pbft-fix-network-issue-with-log' into feat…
qianxiaofeng Jan 3, 2019
d6908de
resolve conflict
qianxiaofeng Jan 3, 2019
4d0dcc0
do not bcast pbft msgs if I am not in sync; only bcast (forward) to c…
Jan 4, 2019
5591039
add timeout when conn is doing connecting
qianxiaofeng Jan 4, 2019
f0907f2
clean up do_queue_write
qianxiaofeng Jan 4, 2019
088bf07
increase checkpoint interval to 100; increase block production sleep …
Jan 4, 2019
520b68a
Merge branch 'feature/dpos-pbft-fix-network-issue-with-log' into feat…
Jan 4, 2019
71c6173
skip switch fork if is pbft prepared, to ensure invariance
Jan 5, 2019
f91e205
add pbft test
qianxiaofeng Jan 5, 2019
737d57b
add pbft_supported into block_state, ensure prepared fork is current …
VincentOCL Jan 7, 2019
3656c27
bug fix: set prepared block as pbft_supported
VincentOCL Jan 7, 2019
3ffcac3
Merge remote-tracking branch 'origin/feature/dpos-pbft-fix-fork-issue…
qianxiaofeng Jan 8, 2019
6fa1483
Merge branch 'develop' into feature/bos-dpos-pbft
qianxiaofeng Jan 8, 2019
54cf928
resolve conflict
qianxiaofeng Jan 8, 2019
2687db2
bug fix: set my prepare block as supported fork.
VincentOCL Jan 8, 2019
02c5e44
correct conditions for prepare reserve; fix typo
VincentOCL Jan 8, 2019
75ebe7c
add prepared and my prepare priority to fork_db, to ensure fork_db he…
VincentOCL Jan 8, 2019
8963611
add log
qianxiaofeng Jan 8, 2019
8f78be9
bug fix: add all prepared cert info pbft db, to ensure consistency
VincentOCL Jan 9, 2019
5baf6ab
Merge remote-tracking branch 'origin/feature/dpos-pbft-fix-fork-issue…
VincentOCL Jan 9, 2019
6bf336d
clear pbft state during transit to new view
VincentOCL Jan 9, 2019
94ab297
prevent sending and receiving pbft msgs during syncing; reformat logs;
VincentOCL Jan 9, 2019
8959c2c
Merge branch 'feature/dpos-pbft-fix-fork-issue' into feature/dpos-pbft
VincentOCL Jan 9, 2019
584ee59
switch connection stats monitor to debug level
VincentOCL Jan 9, 2019
ac46164
Merge branch 'feature/dpos-pbft' into feature/bos-dpos-pbft
qianxiaofeng Jan 9, 2019
a6e5fad
correct my prepare mark; remove unnecessary methods; change log level…
VincentOCL Jan 11, 2019
db7466b
Merge remote-tracking branch 'origin/feature/dpos-pbft' into feature/…
qianxiaofeng Jan 11, 2019
407d7e3
remove dlog
qianxiaofeng Jan 11, 2019
957e8e0
Merge remote-tracking branch 'bos/feature/bos-dpos-pbft' into feature…
qianxiaofeng Jan 12, 2019
d6cfba8
Merge branch 'feature/dpos-pbft' into feature/bos-dpos-pbft
qianxiaofeng Jan 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,16 +2181,16 @@ void controller::set_pbft_prepared(const block_id_type& id) const {
my->pbft_prepared.emplace(id);
my->fork_db.mark_pbft_prepared_fork(id);

dlog("fork_db head ${h}", ("h", fork_db().head()->id));
dlog("prepared block id ${b}", ("b", id));
// dlog("fork_db head ${h}", ("h", fork_db().head()->id));
// dlog("prepared block id ${b}", ("b", id));
}

void controller::set_pbft_my_prepare(const block_id_type& id) const {
my->my_prepare.reset();
my->my_prepare.emplace(id);
my->fork_db.mark_pbft_my_prepare_fork(id);
dlog("fork_db head ${h}", ("h", fork_db().head()->id));
dlog("my prepare block id ${b}", ("b", id));
// dlog("fork_db head ${h}", ("h", fork_db().head()->id));
// dlog("my prepare block id ${b}", ("b", id));
}

block_id_type controller::get_pbft_my_prepare() const {
Expand Down
20 changes: 10 additions & 10 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2988,7 +2988,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_prepare(msg)) return;

bcast_pbft_msg(msg);
dlog("sending prepare at height: ${h}, view: ${v}", ("h", msg.block_num)("v", msg.view));
// dlog("sending prepare at height: ${h}, view: ${v}", ("h", msg.block_num)("v", msg.view));
}

void net_plugin_impl::pbft_outgoing_commit(const pbft_commit &msg) {
Expand All @@ -2999,7 +2999,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_commit(msg)) return;

bcast_pbft_msg(msg);
dlog("sending commit at height: ${h}, view: ${v}", ("h", msg.block_num)("v", msg.view));
// dlog("sending commit at height: ${h}, view: ${v}", ("h", msg.block_num)("v", msg.view));
}

void net_plugin_impl::pbft_outgoing_view_change(const pbft_view_change &msg) {
Expand All @@ -3010,7 +3010,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_view_change(msg)) return;

bcast_pbft_msg(msg);
dlog("sending view change {cv: ${cv}, tv: ${tv}}", ("cv", msg.current_view)("tv", msg.target_view));
// dlog("sending view change {cv: ${cv}, tv: ${tv}}", ("cv", msg.current_view)("tv", msg.target_view));
}

void net_plugin_impl::pbft_outgoing_new_view(const pbft_new_view &msg) {
Expand All @@ -3021,7 +3021,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_new_view(msg)) return;

bcast_pbft_msg(msg);
dlog("sending new view at ${n}", ("n", msg));
// dlog("sending new view at ${n}", ("n", msg));
}

void net_plugin_impl::pbft_outgoing_checkpoint(const pbft_checkpoint &msg) {
Expand Down Expand Up @@ -3066,7 +3066,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_prepare(msg)) return;

forward_pbft_msg(c, msg);
dlog("received prepare at height: ${n}, view: ${v}, from ${k}, ", ("n", msg.block_num)("v", msg.view)("k", msg.public_key));
// dlog("received prepare at height: ${n}, view: ${v}, from ${k}, ", ("n", msg.block_num)("v", msg.view)("k", msg.public_key));

pbft_incoming_prepare_channel.publish(msg);

Expand All @@ -3083,7 +3083,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_commit(msg)) return;

forward_pbft_msg(c, msg);
dlog("received commit at height: ${n}, view: ${v}, from ${k}, ", ("n", msg.block_num)("v", msg.view)("k", msg.public_key));
// dlog("received commit at height: ${n}, view: ${v}, from ${k}, ", ("n", msg.block_num)("v", msg.view)("k", msg.public_key));

pbft_incoming_commit_channel.publish(msg);
}
Expand All @@ -3099,7 +3099,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_view_change(msg)) return;

forward_pbft_msg(c, msg);
dlog("received view change {cv: ${cv}, tv: ${tv}} from ${v}", ("cv", msg.current_view)("tv", msg.target_view)("v", msg.public_key));
// dlog("received view change {cv: ${cv}, tv: ${tv}} from ${v}", ("cv", msg.current_view)("tv", msg.target_view)("v", msg.public_key));

pbft_incoming_view_change_channel.publish(msg);
}
Expand All @@ -3115,7 +3115,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_new_view(msg)) return;

forward_pbft_msg(c, msg);
dlog("received new view at ${n}, from ${v}", ("n", msg)("v", msg.public_key));
// dlog("received new view at ${n}, from ${v}", ("n", msg)("v", msg.public_key));

pbft_incoming_new_view_channel.publish(msg);
}
Expand All @@ -3131,7 +3131,7 @@ namespace eosio {
if (!pcc.pbft_db.is_valid_checkpoint(msg)) return;

forward_pbft_msg(c, msg);
dlog("received checkpoint at ${n}, from ${v}", ("n", msg.block_num)("v", msg.public_key));
// dlog("received checkpoint at ${n}, from ${v}", ("n", msg.block_num)("v", msg.public_key));

pbft_incoming_checkpoint_channel.publish(msg);
}
Expand Down Expand Up @@ -3661,7 +3661,7 @@ namespace eosio {
my->pbft_message_cache_timer.reset( new boost::asio::steady_timer( app().get_io_service()));
my->connection_monitor_timer.reset( new boost::asio::steady_timer( app().get_io_service()));
my->pbft_message_cache_ticker();
my->connection_monitor_ticker();
// my->connection_monitor_ticker();
} FC_LOG_AND_RETHROW()
}

Expand Down