* state syncing integration
* fix grpc too many sockets issue; fix last mile catch up issue
* fix in sync message not updated; modify sync_test with new flag; pass
golint test
* address issues in the pull request
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).
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>
This is necessary to make sure every validators can receive
the latest list of PublicKeys.
Without this patch, the deploy.sh running locally can hardly reach
consensus for 60+ validators in one shard.
With this patch, the deploy.sh test can reach consensus on 100
validators in one shard.
Noted, we have to use the following command line to test the peer
discovery.
We have to -m <NUM_OF_VALIDATOR_IN_THE_SHARD> to stop leader from
initiating consensus if not all validators are registered. The reason is
new validator may join the shard in the middle of a consensus.
However, we have only one PublicKeys list in leader. It will be updated
once a new validator joined, and it causes inconsistency of the
PublicKeys between leader and validators and it will failure the CoSi
verification.
./deploy.sh -p -m <NUM_OF_VALIDATOR> local_config.txt
Signed-off-by: Leo Chen <leo@harmony.one>
fix a bug to update the bitmap on the leader in account model
Issue:
Can only reach consensus once, and then got the following errors.
Failed to create new block Error="nonce too low"
This is because of new validators joined the shard and their state are
not sync'ed, thus we have not enough nonce.
Signed-off-by: Leo Chen <leo@harmony.one>
All validators should have the identical list of public keys as the
leader. Otherwise, the CoSi will failure to verify.
consensus.publicKeys => consensus.PublicKeys, make it visiable to external modules.
Signed-off-by: Leo Chen <leo@harmony.one>