Leo Chen
cadec98dd9
[viewchange] ignore viewchange/newview messages if not in viewchanging mode
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
92130a2ba3
[viewchange] retry sending view change messages
...
retry is needed, as the next leader may not enter view change mode immediately
when other validators already sent out view change messages.
Then the new leader may not collect enough signatures for the new view before
timeout.
This can speed up the view change process.
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Rongjian Lan
a4d8e7d949
update aggregate sig epoch
4 years ago
Rongjian Lan
b6171945cf
Fix refactor; add test for AggregateVotes
4 years ago
Rongjian Lan
0141604162
Add multikey dedup and test cases
4 years ago
Rongjian Lan
b13c96bc1e
Add more unit tests for vote submission
4 years ago
Leo Chen
8b7a640cdf
[viewchange] remove unused function
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
3bad6006a1
[viewchange] newview message reprocessing
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
3bd65c850b
[viewchange] validate payload of m1 message
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
1c0e872b6e
[viewchange] init bitmap before init payload
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
75fb354ee7
[viewchange] rename VerifyViewChange to ProcessViewChange
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
0871866848
[misc] fixed comment of onNewView
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
7620fce074
[viewchange] fix InitPayload func
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
5ba139fded
[log] use info level for viewchange log
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
df9d54443d
[viewchange] rename NextAfter to NthNext
...
The NthNext will return the nth key after the current pubkey
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
669302ea2e
[viewchange] config viewchange timeout to 45s
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
60f7237c65
[misc] add one comment
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
55f6c29045
[viewchange] restore old next leader logic
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
85f782f783
[viewchange] avoid reentrant of newview message
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
5d4cdbdd06
[core] simplify switchPhase as it is always called in override mode
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
5d7693d318
fix travis checker
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
f9018be0ca
protect IsM1PayloadEmpty with a lock
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
0ad38d2a1c
make viewchange variable private
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
45cc4d24a0
make view change struct private
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
096614eab1
address review comments
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
a229177945
[viewchange] rename view change files
...
[viewchange] new view change struct
move all view change data structure to a new viewchange struct
[viewchange] wrap functions in viewchange struct
[viewchange] newView process can not be reentrant
[viewchange] additional debug
[viewchange] always add m3 message to bitmap
[viewchange] shorten the duration for view change
[viewchange] further cleanup of onNewView func
[viewchange] add validpayloadlength const
[viewchange] only add m3 message if valid m1/m2 received
[viewchange] set next leader to any key
[viewchange] print more error message in log
[viewchange] get leader pubkey from coinbase
[viewchange] rename files back for easy review
[viewchange] fix nil pointer in getNextLeader
[viewchange] fix review comments
[viewchange] squash single used function
[viewchange] code re-org
[viewchange] clean up functions
[viewchange] minor typo fix
[viewchange] code clean up and more comments
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Rongjian Lan
10ca5433ac
Add tests for prepare and commit message construction
4 years ago
Rongjian Lan
2a45a1d684
correct func comment
4 years ago
Rongjian Lan
eb837336a8
Refactor multi-sig logic for validator; Add slashing sanity check
4 years ago
Rongjian Lan
dc24b3ad52
Basic multi-sig logic
4 years ago
Leo Chen
aba83d4681
Revert "[viewchange] fix getNextLeader"
...
This reverts commit 9dc8f43288
.
4 years ago
Leo Chen
db82575018
[viewchange] rename curViewID variable to blockViewID
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
b76ac39d48
[viewchange] rename GetCurViewID to GetCurBlockViewID
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
3693196926
[viewchange] rename SetCurViewID to SetCurBlockViewID
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
f5bd6a3490
[viewchange] fixed wrong viewID function calls
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
9dc8f43288
[viewchange] fix getNextLeader
...
next leader can be any leader depending on the gap of the view ID
do not change current pubkey unless leader change succeeded
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
a551c05ed8
[rpc] expose consensus internal data via rpc
...
This is used to debug consensus/viewchange state.
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Rongjian Lan
79cf6afd37
revert multi-sig messaging code ( #3361 )
...
* revert multi-sig messaging code
4 years ago
Rongjian Lan
151286ce04
Fix travis
4 years ago
Rongjian Lan
09ce0bac9d
Correct mistakenly committed code
4 years ago
Rongjian Lan
6845775078
Make block proposal async and receiving last commit sig through channel
4 years ago
Jacky Wang
3adab4496c
Revert "[consensus] enable the consensus module can spin up doSync ( #3340 )" ( #3350 )
...
This reverts commit f9c26e663b
.
4 years ago
Leo Chen
e079fb1473
[viewchange] simplify vc message initialization
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
5e556b812d
[misc] move SenderPubkeys check to sanity check func
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
79d43c2ce8
fix test cases
...
updated protoc version
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
7dcdbe7d2b
fix golint
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
0c04a2b574
[consensus] rename SetViewID to SetViewIDs
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
54912716ce
[validation] move newview validation to p2p layer
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
42923336c9
[viewchange] encapsulate both viewID and viewChangeID
...
[viewchange] encapsulate view ID in the State struct
do NOT ues consensus.current directory to set/get viewID
use the following functions
consensus.SetCurViewID, consensus.SetViewChangingID
consensus.GetCurViewID, consensus.GetViewChangingID
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
c2e962a035
[debug] add debug rpc calls
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago