ConfirmedBlockChannelchan*types.Block// Channel to receive confirmed blocks
ConfirmedBlockChannelchan*types.Block// Channel to receive confirmed blocks
PRndChannelchan[]byte// Channel to send pRnd (preimage of randomness resulting from combined vrf randomnesses) to consensus. The first 32 bytes are randomness, the rest is for bitmap.
PRndChannelchan[]byte// Channel to send pRnd (preimage of randomness resulting from combined vrf randomnesses) to consensus. The first 32 bytes are randomness, the rest is for bitmap.
// global consensus mutex
mutexsync.Mutex
// map of nodeID to validator Peer object
// map of nodeID to validator Peer object
// FIXME: should use PubKey of p2p.Peer as the hashkey
// FIXME: should use PubKey of p2p.Peer as the hashkey
validatorssync.Map// key is uint16, value is p2p.Peer
validatorssync.Map// key is uint16, value is p2p.Peer
@ -40,6 +46,10 @@ type DRand struct {
// private/public keys of current node
// private/public keys of current node
priKey*bls.SecretKey
priKey*bls.SecretKey
pubKey*bls.PublicKey
pubKey*bls.PublicKey
// VRF private and public key
// TODO: directly use signature signing key (BLS) for vrf
vrfPriKey*vrf.PrivateKey
vrfPubKey*vrf.PublicKey
// Whether I am leader. False means I am validator
// Whether I am leader. False means I am validator