Leo Chen
8edebd2250
fix some send message failure
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Eugene Kim
4a2e1e2110
Move Host interface into the top-level p2p package
...
This is a move-only refactor, intended to bubble the Host interface
(which is the main p2p interface) to the top. It also has the effect of
reducing name stutter (host.Host → p2p.Host).
6 years ago
Leo Chen
49a48958d9
address all review comments
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
550da64144
fix all the go test errors after p2p changes
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
fcbf5c255a
add addPeer function support in p2p
...
This is mainly for hostv2 libp2p support.
addPeer will add new peer into the peerstore.
NewHost function add Identity support for libp2p after generating
keypair. The PeerID is generated from the public key, will be used to
find the right PeerInfo for libp2p communication.
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
f189ba0183
simplify SendMessage
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Eugene Kim
5ad4d5a8f0
Adjust import paths and also goimports
6 years ago
Leo Chen
c511c4d4e0
catch errors in SendMessage
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
cc322ce3ff
re-enable libp2p by default
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Minh Doan
2245b37851
fix the break at master
6 years ago
Leo Chen
c378482e23
enable libp2p by default
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
chaosma
6476146a81
add p2p unit tests
...
* add p2p unit tests; util_test.go NOT always pass
* remove addrToPrivKey
* minor refine
6 years ago
Richard Liu
79d7ac30c3
remove dup bufio.NewWriter ( #223 )
6 years ago
chaosma
da32d1c0bb
simplify read message content code ( #216 )
6 years ago
Richard Liu
7538f64d7e
fix p2p v2 on aws and for surviving from node killing. ( #204 )
...
* fix p2p v2 on aws and for surviving from node killing.
* update addrs
* fix typo
6 years ago
Rongjian Lan
fdcce8e4de
Add tests for node_handler.go; move stream interface to its own file;create mock for stream.go
6 years ago
Rongjian Lan
f26d62984c
Add tests for consensus leader code
6 years ago
Leo Chen
3356c61332
use in-repo log module for p2p
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
18a52968b3
fix can't bind address issue on AWS
...
on AWS EC2 instances, we can't bind the IP address, has to use no IP to
join host.
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
53a5c3c856
HAR-65: support node removal after node is offline
...
In p2p library, I added a channel notification mechansim when it failed
to send messages after retries. The failed p2p.Peer will be notified to
caller via the channel. Then the leader knows which peer is offline and
adds to an offline list.
Before another consensus is started, the ledaer will check the offline
list and remove the node from the validator list. Leader will have to
broadcast the Pong message to all validators to sync the public key
list.
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Richard Liu
edbcb88d45
fix p2p error related to beacon chain ( #142 )
...
* fix p2p error related to beacon chain
* add log
6 years ago
Richard Liu
64230da6ee
abstract out 2 versions of p2p
6 years ago
Minh Doan
2031ec09df
get rid of unused code
6 years ago
Leo Chen
ed791fad71
HAR-84: golint fix on ida
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
7bf3bfcdfc
HAR-65: use better broadcast model for ping message
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
8c08f5ba5e
HAR-84: fix golint warnings in crytpo, p2p
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
76375a2425
HAR-84: golint fix of p2p/peer.go
...
I have to touch a lot of files to fix the Ip => IP
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Richard Liu
9ac2645935
integrate libp2p as version 2 p2p
6 years ago
Leo Chen
1d7baff8c4
print # of retry when sending packet via socket
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
d8f0d504cc
fix validatorID not populated to all validator issue
...
now unique set of validatorID are sync'ed to all validators
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Minh Doan
ab2f39f5a3
fix import with goimport
6 years ago
Leo Chen
2a602db9b0
fix the build after rename the repo to harmony-one
...
[TEST]
$ ./go_executable_build.sh
Harmony (C) 2018. benchmark, version v1174-23ace87 (ec2-user@ 2018-11-15T12:07:48+0000)
Harmony (C) 2018. txgen, version v1174-23ace87 (ec2-user@ 2018-11-15T12:07:48+0000)
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
ak
5b1d0c1d81
todo sustain node server to receive pingback
6 years ago
Minh Doan
582cc2507a
add test
6 years ago
Minh Doan
d810811d6f
simple ida
6 years ago
Minh Doan
96ed2cc17a
setup interface for IDA
6 years ago
Leo Chen
6282530b3d
Add proper message when the block propagation started
...
It assumes bigger message > 1M is for block propagation.
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Leo Chen
e8b6a45fe0
log size of messages in log file
...
Signed-off-by: Leo Chen <leo@harmony.one>
6 years ago
Minh Doan
7f9c81874d
cleanup
6 years ago
Minh Doan
0e34dcf448
fix a lot of basic mistakes. See https://docs.google.com/document/d/1eIuVFnRra8Ggnj5zSTcGLn9iXGwHEdOHGC6-gHvvuGc
6 years ago
Eugene Kim
c6cd5c055d
Try to send out a message 10 times, then give up
...
This is to eliminate goroutine leaks.
6 years ago
Eugene Kim
f4b19d3bcd
Send unicast messages in background too
...
In general, protocol designs should not assume the underlying layer to
provide reliable transmission of a message or guaranteed receipt of
confirmation. Application level protocols that wish to guarantee
delivery should implement its own acknowledgement mechanism.
Note that our consensus (modeled after PBFT) does not require such
positive acknowledgements of each message sent.
6 years ago
Eugene Kim
d888bc2149
When broadcasting, do not wait for deliveries
...
If one peer is bogged down, it hinders the entire progress of the
consensus. Consensus should be allowed to proceed even with a few
outliers still lagging behind, if enough quorum has received the message
and sent replies back.
6 years ago
Minh Doan
9e1b9129e5
polish the logic of avoiding doing some unnessary work when # of peers is 0
6 years ago
Rongjian Lan
67b160901b
Add more logs and avoid validator broadcast when not necessary
6 years ago
Eugene Kim
b9930661b6
go fmt
6 years ago
Eugene Kim
3d46b3bb57
Use log15 (I stand corrected; we had it!)
6 years ago
Eugene Kim
ea0b358870
Remove unused import
6 years ago
Eugene Kim
bdf7e37ddc
Make send() retry with exponential backoff
6 years ago
Eugene Kim
8d277fb796
Make sendWithSocketClient() log and return error
6 years ago