Jacky Wang
109348b450
[cmd] added a helper module cli for clean cmd ( #3235 )
...
* [cmd] added a helper module cli for clean cmd
* [cmd] added parse.go and register.go in internal/cli
* [cmd] fix golint issues
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
Daniel Van Der Maden
b9b462d925
Small nit fixes ( #3240 )
...
* Update README.md
* [scripts] Remove unused vars from travis_node_checker.sh
4 years ago
Leo Chen
25a236a6a1
Merge pull request #3237 from Daniel-VDM/pr-rpc-tests
...
Node API Tests & README update (Stage 1 of Node API Overhaul)
4 years ago
Daniel Van Der Maden
ee18c43284
Add help to Makefile
4 years ago
Daniel Van Der Maden
eb3df51285
[travis] Add travis_node_checker.sh
...
* Remove slack notification
* Parallelize tests
4 years ago
Daniel Van Der Maden
b06c91caec
[test] Fix make-go
4 years ago
Janet Liang
22014801ee
[Explorer] Add explorer node in sync check ( #3215 )
...
* Fix minor typos
* Properly sort imports
* [explorer] Add /node-sync to return if the node is in sync
* [explorer] Use different status code for node out of sync & JSON error
* [main] Do not initialize syncing as a separate go routine to ensure stateSync pointer is initialized before explorer service creation (adds 0.002 seconds to node start up time)
[sync] Fix nil pointer on syncConfig, return true since node has not yet checked if it is in sync
* [explorer] Reverse sync for display
4 years ago
Daniel Van Der Maden
fc9c9ae48c
Update README.md
4 years ago
Daniel Van Der Maden
d5acb110e7
Add test & debug make commands with a help
4 years ago
Daniel Van Der Maden
09cd477274
Make given harmony build dynamically
4 years ago
Daniel Van Der Maden
0e94a927e8
[test] Add Node API test scripts
...
* Make debug.sh build dynamically for faster iteration
* Refactor deploy.sh build trigger
* Add go test script to test within docker image
4 years ago
Daniel Van Der Maden
bb96d8e73f
[scripts] Add shebang to travis_checker.sh
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
Leo Chen
a3257aa2ac
[rpc] add API to return p2p peer info
...
support both apiv1 and apiv2
Examples on localnet:
curl -s --request POST 'http://127.0.0.1:9500/ ' \
--header 'Content-Type: application/json' \
--data-raw '{ "jsonrpc": "2.0", "method": "hmyv2_getPeerInfo", "params": [""], "id": 1}'
curl -s --request POST 'http://127.0.0.1:9500/ ' \
--header 'Content-Type: application/json' \
--data-raw '{ "jsonrpc": "2.0", "method": "hmy_getPeerInfo", "params": [""], "id": 1}'
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
19b8a12197
[cleanup] remove unused constants
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
b09c73b1d8
[cleanup] remove unused shard client group
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
85062a3867
[p2p] separate handler channel for consensus/node messages
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Leo Chen
4e4afd87b4
[p2p] reject empty p2p messages
...
Signed-off-by: Leo Chen <leo@harmony.one>
4 years ago
Daniel Van Der Maden
25d250af81
[test] Add option to specify shard & add shard 1 explorer
4 years ago
Daniel Van Der Maden
ff1b689fb3
[test] remove .dht files on localnet debug
4 years ago
Daniel Van Der Maden
5fda02771d
[test] Fix merge conflict for deploy.sh
4 years ago
Daniel Van Der Maden
9e7542df63
[test] Add option to start an external node on test deploy.sh
4 years ago
Daniel Van Der Maden
bb9bb92273
[test] Update localnet deploy script
...
* Remove unused staking test function
* Make config more flexible for specifying BLS keys
* Refactor script to functional components for legibility
4 years ago
Rongjian Lan
6029ba5cf9
Remove all wrong usage of singlr flight; also fix voting power cache key ( #3229 )
4 years ago
Janet Liang
14e017defc
[RPC] Fix block "miner" field ( #3221 )
...
* [api] Update block miner to return the correct hex value instead of wrong one address (v1)
* [api] Update block miner to return the correct hex value instead of wrong one address (v2)
* [api] Refactor for readability
* [hmy] Cache leader conversion results
[api] Get leader address from cache
* Fix lint
* [api] Minor optimization
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
Leo Chen
27fe3e34aa
[rpc] add node peer id in node metadata
...
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
Leo Chen
af38bc655d
Merge pull request #3205 from SebastianJ/coverage-consensus
...
[coverage] [consensus] Additional unit tests / coverage
4 years ago
Sebastian Johnsson
435a4f60cb
Update consensus_test to account for bls key changes
4 years ago
Sebastian Johnsson
3ee054c522
Merge branch 'main' into coverage-consensus
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
Sebastian Johnsson
69c0436831
Merge branch 'main' into coverage-consensus
4 years ago
Rongjian Lan
4dd9757f08
Add nil check on leader checks
4 years ago
Rongjian Lan
c89b7f0efa
Fix slice append in multikey func ( #3206 )
4 years ago
Sebastian Johnsson
38c73659dc
Merge branch coverage-consensus
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
e5199939f5
Rename p2p testing package to comply with Travis CI
4 years ago
Sebastian Johnsson
098bd5c235
[coverage] [p2p] Improve p2p code coverage from 0% to 78.3%
4 years ago