Documentation ¶
Index ¶
- func CompareBlsPublicKey(k1, k2 BlsPublicKey) int
- func CompareCommittee(c1, c2 *Committee) int
- func CompareNodeID(id1, id2 *NodeID) int
- func CompareNodeIDByBLSKey(n1 NodeID, n2 NodeID) int
- func CompareNodeIDList(l1, l2 NodeIDList) int
- func CompareShardState(s1, s2 State) int
- func GetHashFromNodeList(nodeList []NodeID) []byte
- type BlsPublicKey
- type Committee
- type EpochShardState
- type NodeID
- type NodeIDList
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareBlsPublicKey ¶
func CompareBlsPublicKey(k1, k2 BlsPublicKey) int
CompareBlsPublicKey compares two BlsPublicKey, lexicographically.
func CompareCommittee ¶
CompareCommittee compares two committees and their leader/node list.
func CompareNodeIDByBLSKey ¶
CompareNodeIDByBLSKey compares two nodes by their ID; used to sort node list
func CompareNodeIDList ¶
func CompareNodeIDList(l1, l2 NodeIDList) int
CompareNodeIDList compares two node ID lists.
func CompareShardState ¶
CompareShardState compares two State instances.
func GetHashFromNodeList ¶
GetHashFromNodeList will sort the list, then use Keccak256 to hash the list NOTE: do not modify the underlining content for hash
Types ¶
type BlsPublicKey ¶
type BlsPublicKey [48]byte
BlsPublicKey defines the bls public key
func (*BlsPublicKey) FromLibBLSPublicKey ¶
func (pk *BlsPublicKey) FromLibBLSPublicKey(key *bls.PublicKey) error
FromLibBLSPublicKey replaces the key contents with the given key,
func (BlsPublicKey) Hex ¶
func (pk BlsPublicKey) Hex() string
Hex returns the hex string of bls public key
func (BlsPublicKey) IsEmpty ¶
func (pk BlsPublicKey) IsEmpty() bool
IsEmpty returns whether the bls public key is empty 0 bytes
func (*BlsPublicKey) ToLibBLSPublicKey ¶
func (pk *BlsPublicKey) ToLibBLSPublicKey(key *bls.PublicKey) error
ToLibBLSPublicKey copies the key contents into the given key.
type Committee ¶
type Committee struct { ShardID uint32 `json:"shard_id"` NodeList NodeIDList `json:"node_list"` }
Committee contains the active nodes in one shard
type EpochShardState ¶
EpochShardState is the shard state of an epoch
type NodeID ¶
type NodeID struct { EcdsaAddress common.Address `json:"ecdsa_address"` BlsPublicKey BlsPublicKey `json:"bls_pubkey"` }
NodeID represents node id (BLS address)
type NodeIDList ¶
type NodeIDList []NodeID
NodeIDList is a list of NodeIDList.
func (NodeIDList) DeepCopy ¶
func (l NodeIDList) DeepCopy() NodeIDList
DeepCopy returns a deep copy of the receiver.