set up leveldb to store explorer info
add storage
adding dumping new block logic into db
add fake data and structs for fake data
explorer backend service with fake data
clean something up
set up leveldb to store explorer info
add logic for blockinfo & refactor code
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>