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
Jacky Wang
f9c26e663b
[consensus] enable the consensus module can spin up doSync ( #3340 )
...
* [consensus] enable the consensus module can spin up doSync
* [consensus] remove the blockNumLowChan buffer in onCommitted. Move tryCatchup logic before informing blockNumLow
* [sync] Remove an unnecessary time ticker in sync to reduce one sync loop time from 3.5s to 1s (based on testnet)
* [consensus] also spin up state sync at onPrepared
* [consensus] removed onCommitted block number check since redundent
4 years ago
Rongjian Lan
f42338c30b
Add back multi-sig support and fix the multi-sig check for harmony nodes ( #3337 )
...
* Revert "Revert "Add multi-sig merged messaging logic (#3300 )""
This reverts commit cbd11331b4
.
* Allow harmony nodes to sign multisig from multiple accounts
4 years ago
Rongjian Lan
a5fa880ae3
Revert "Add multi-sig merged messaging logic ( #3300 )" ( #3326 )
...
This reverts commit ecf151592e
.
4 years ago
Rongjian Lan
ecf151592e
Add multi-sig merged messaging logic ( #3300 )
...
* Revert "[go.mod] version upgrade of libp2p modules"
This reverts commit ce53468e3e
.
* Add multi-sig merged messaging logic
* fix view change signature issue
* support multi-sig consensus messages
* Add multi-sig support for slashing
* Fix bls mask issue in looping
* Fix multisig aggregation issue
* Make multisig bitmap setting atomic
* Fix for PR comments
* Update pb.go
* Revert "Update pb.go"
This reverts commit be625b80c0
.
* Resolve comments and fix slashing logic
* fix test
* revert slash logic change
* Add missing field in slash moment
* Fix comment
4 years ago
Jacky Wang
2ddbe5a345
[cmd] change stressnet staking epoch back to 0. Remove block time set to 8 logic.
4 years ago
Jacky Wang
200b0ca9e0
[cmd] changed consensus to option field, removed consensus flags, changed broadcast invalid transaction to option fields
4 years ago
Rongjian Lan
c844b78d2d
fix uint64 overflow on committed msg out of sync check
4 years ago
Rongjian Lan
19db99d3f7
Increase time buffer; add db cache; change log level
4 years ago
Rongjian Lan
16c1b06269
fix 5 second duration fork
4 years ago
Rongjian Lan
a93c4c597d
Revert to use simple mutex
4 years ago
Rongjian Lan
43d0696505
Add 5 seconds block time and slot increase epoch
4 years ago
Rongjian Lan
a354b93676
Optimize bls Mask infra to avoid loops ( #3243 )
4 years ago
Rongjian Lan
f554fdb5a2
fix view change race issue ( #3242 )
4 years ago
Rongjian Lan
9c0554ddc9
Use finer grained RWMutex for consensus logic ( #3239 )
...
* Use finer graned RWMutex for consensus logic
* Correct GOMAXPROCS to be the same as num CPUs
4 years ago
Leo Chen
45b7cf7d88
[consensus] check double sign after commit payload verification
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
b568d91e47
[consensus] remove duplicated signature verification
...
Check the following issue on the detailed explanation of why this commit makes sense.
https://github.com/harmony-one/harmony/issues/3225
The onPrepare and onCommit will do signature verification of the message payload.
So, there is no need to do duplicated sanity check when handling Prepare/Commit messages.
We reserve the signature verification on other messages, as they are not duplicated.
This PR can reduce the CPU load of leader during consensus.
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Rongjian Lan
c3cad1be6b
Fix potential nil pointer ( #3220 )
4 years ago
Leo Chen
0435e2d203
[consensus] optimize onCommit
...
restore the original grace period function
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
b560f88978
[libp2p/consensus] p2p spamming defense
...
This is a big PR merged many small commits together.
We add the message validation function in libp2p layer.
In the validation function, we check the following conditions
1) the p2p message is a valid consensus message
2) the p2p message sender has a valid public key
3) the sender's public key is in the current committee
4) log the number of invalid/valid messages
After the validation, the valid messages will be forward to the network,
while the invalid messages will be filtered out.
The messages intended for the validator will be handled in the consensus layer.
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Rongjian Lan
bdd2a58e01
Remove expensive bls key serialization code ( #3217 )
4 years ago
Rongjian Lan
8a08da67ca
Remove unused code and add benchmark for consensus msg check ( #3211 )
4 years ago
Rongjian Lan
a168517dfc
Move BLS related wrapper structure into a separate package ( #3209 )
4 years ago
Sebastian Johnsson
435a4f60cb
Update consensus_test to account for bls key changes
4 years ago
Rongjian Lan
dbb0ed2f53
Bind public keys into private key wrapper ( #3208 )
4 years ago
Sebastian Johnsson
79b6dc3d9b
Add consensus message sender tests
4 years ago
Rongjian Lan
4dd9757f08
Add nil check on leader checks
4 years ago
Sebastian Johnsson
661b43f695
Rebase to main; use new shard.BLSPublicKeyWrapper wrapper
4 years ago
Sebastian Johnsson
6f891c9679
Explicitly set consensus.LeaderPubKey - tests are working locally but somehow fail while running on Travis CI
4 years ago
Sebastian Johnsson
8004330970
Update view change tests
4 years ago
Sebastian Johnsson
41c0b3d06b
[coverage] [consensus] Improved coverage for the consensus package
4 years ago
Sebastian Johnsson
680d384eac
Explicitly set consensus.LeaderPubKey - tests are working locally but somehow fail while running on Travis CI
4 years ago
Sebastian Johnsson
2658bfc4ea
Update view change tests
4 years ago
Sebastian Johnsson
7e5b6fe5e9
[coverage] [consensus] Improved coverage for the consensus package
4 years ago
Rongjian Lan
67d77c3965
Refactor bls public key into a wrapper ( #3203 )
...
* Refactor bls public key into a wrapper
* Fix build
* Fix
4 years ago