Leo Chen
793529ee24
[viewchange] rename stopViewChange to startNewView
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
bdd717edfb
[viewchange] protect consensus structure using mutex
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
3784d6a564
[viewchange] simplify onNewView function
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
f8e2fd7120
[viewchange] lock to process view change
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
b6deec9a5a
[viewchange] add RLock for m1Payload functions
...
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
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
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
0ad38d2a1c
make viewchange variable private
...
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
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
Rongjian Lan
79cf6afd37
revert multi-sig messaging code ( #3361 )
...
* revert multi-sig messaging code
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
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
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
Rongjian Lan
19db99d3f7
Increase time buffer; add db cache; change log level
4 years ago
Rongjian Lan
a354b93676
Optimize bls Mask infra to avoid loops ( #3243 )
4 years ago
Rongjian Lan
a168517dfc
Move BLS related wrapper structure into a separate package ( #3209 )
4 years ago
Rongjian Lan
dbb0ed2f53
Bind public keys into private key wrapper ( #3208 )
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
Rongjian Lan
68ab784d63
Refactor quorum calculation and signature submission process ( #3201 )
4 years ago
Rongjian Lan
71e9abdcbf
Avoid validator sending msgs if the key is not in committee
4 years ago
Rongjian Lan
8057b05592
Fix multi-key related issues when keys are not in committee ( #3132 )
...
* do not break if leader's multikeys not in committee (#3126 )
* do not break on leader commit (#3127 )
* Fix multi-key submitVote (#3129 )
* Add missing check on viewidbitmap
* correct log level
4 years ago
Rongjian Lan
2d003b4249
Remove unnecessary block verification ( #3111 )
...
* Remove unnecessary block verification
* Move block verification to right after deserialization
5 years ago
Rongjian Lan
32dfea43a5
Make leader commit m1payload itself ( #2997 )
...
* Make leader commit m1payload itself
* remove test code
5 years ago
Rongjian Lan
1dad435291
fix crash on parsed block ( #2993 )
5 years ago
Rongjian Lan
3a32fedb1d
Fix commit payload ( #2986 )
...
* Always use block data for commit payload
* remove the misleading consensus.epoch
* Fix lint and test
* Remove consensus.String(); fix slash test
5 years ago
Edgar Aroutiounian
c2f089f618
[node] Throttle acceptance of incoming messages ( #2970 )
...
* [node] Throttle acceptance of incoming messages
* [p2p] Add sampled logger
* [go.mod] Bump libs
* [p2p][node] More sampled logs
* [p2p] Disable auto relay, force public reachability, fix bandwidth reporter, enable NAT service
* [p2p] Turn off some options
* [node] Remove noisy and incorrect impl p2p log
* [node] Sample bump to 24 second
* [p2p] Remove linger of metric
* [consenus] Fix race condition
* [consensus] Race condition for grace period
* [node] Less noisy closure
* [node] Less noisy closure
* [node] Bump context timeout on message, explicit cancel of context
* [node] Cost back to 1 when reach threshold back of being fine
* [node] Sync race condition
* [node] toStart buf chan 1
* [p2p] Turn options on again
* [node][p2p] Lower throttle point for test, remove noisy log, make time delay throttle small
* [consensus] Fix nil pointer
* [node] Remove noisy log, increase infrequency of Burst topic log
* [blockchain] Nil pointer check
* [node] Fix threshold, lessen log
* [node] Bump throttle
* [node] Nil to verify new block
* [node] Keep threshold at half
5 years ago
Rongjian Lan
7c292f64be
Fix viewID issue on prepared block during view change ( #2972 )
...
* Fix viewID issue on prepared block during view change
* Add more checks and remove comments
* Fix lint
* update rlp encode pointer
* Revert go gen changes
* add go gen code
* [api] Fix proto to pass travis
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
5 years ago
Daniel Van Der Maden
451d16c14d
Add viewID to block signed content ( #2877 )
...
* [consensus] Add ConstructCommitPayload for consensus signatures
* [internal/engine] verify consensus sigs on hash+blockNum+viewID
* [consensus] Add ConstructCommitPayload for consensus signatures
* [internal/engine] verify consensus sigs on hash+blockNum+viewID
* [consensus] verify consensus sigs on hash+blockNum+viewID
* [node] verify consensus sigs for explorer on hash+blockNum+viewID
* [crosslink] Add viewID & tie break by viewID last on sort
* [api] Update crosslink constructor for viewID addition
* [staking] Verify consensus sigs on hash+blockNum+viewID
* [slash] update tests
* [engine] Fix VerifyHeaderWithSignature commit signature payload
* [crosslink] Make NewCrossLink return a pointer to CrossLink
* [node] update ConstructCrossLinkMessage to reflect NewCrossLink change
* [debug] Remove debugging logs
5 years ago
Ganesha Upadhyaya
d9045590ef
[consensus][view-change] onViewChange set keys and add signatures for all keys in case of multi-key new leader ( #2826 )
5 years ago
Ganesha Upadhyaya
9d54a638f2
Revert "[consensus][viewchange] fix total power of signers in IsQuorumAchieved for view change" ( #2823 )
...
This reverts commit 3fd5ea170b
.
5 years ago
Edgar Aroutiounian
82b71619d2
[node] Redundant field removed - dead files & scripts , update deprecated libp2p package names, fold p2p code ( #2817 )
...
* [project] Remove unused test script
* [project] Remove stale testplan
* [project] Remove stale test configs
* [internal] Unused code
* [node] Remove redundnat peer count field
* [p2p] Remove leftover idea code, fix deprecated warnings
* [project] Remove .gitmodule
* [internal] Fix travis, update deprecated package usage
* [node] Remove ineffective test
* [p2p] Update deprecated package names & func usage
* [p2p] Make error explicit, remove unidiomatic return signature
* [p2p] Remove dead code, lower max p2p message size max limit
* [project][p2p] Remove dead p2p code, fold all p2p code into one file
* [p2p] Remove unsed function parameter
* [node] Add log in bootstrap
* [node] Unnecessary pointer usage
* [p2p] Unused errors.go
* [node] Log out when next consensus check in bootstrap
5 years ago