filter

package
v0.37.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: AGPL-3.0 Imports: 2 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

IsConsensusCommitteeMember is an identity filter for all members of the consensus committee. Formally, a Node X is a Consensus Committee Member if and only if X is a consensus node with positive initial weight. This is specified by the EpochSetup Event and remains static throughout the epoch.

IsValidCurrentEpochParticipant is an identity filter for members of the current epoch in good standing. Effective it means that node is an active identity in current epoch and has not been ejected.

IsValidCurrentEpochParticipantOrJoining is an identity filter for members of the current epoch or that are going to join in next epoch.

View Source
var IsValidDKGParticipant = IsConsensusCommitteeMember

IsValidDKGParticipant is an identity filter for all DKG participants. It is equivalent to the filter for consensus committee members, as these are the same group for now.

IsValidProtocolParticipant is an identity filter for all valid protocol participants. A protocol participant is considered valid if and only if the following are both true. 1. The node is not ejected. 2. The node has a weight greater than 0.

IsVotingConsensusCommitteeMember is an identity filter for all members of the consensus committee allowed to vote. Formally, a Node X has authority to vote in the consensus process, if and only if

  1. Node X is an active member of the current epoch AND
  2. X is a consensus node with positive initial weight in the current Epoch. This is specified by the EpochSetup Event for the current epoch and remains static throughout the epoch.

NotEjectedFilter is an identity filter for peers that are not ejected.

Functions

func Adapt added in v0.33.30

Adapt takes an IdentityFilter on the domain of IdentitySkeletons and adapts the filter to the domain of full Identities. In other words, it converts flow.IdentityFilter[flow.IdentitySkeleton] to flow.IdentityFilter[flow.Identity].

func And

func And[T flow.GenericIdentity](filters ...flow.IdentityFilter[T]) flow.IdentityFilter[T]

And combines two or more filters that all need to be true.

func Any

func Any(*flow.Identity) bool

Any will always be true.

func HasInitialWeight added in v0.33.30

func HasInitialWeight[T flow.GenericIdentity](hasWeight bool) flow.IdentityFilter[T]

HasInitialWeight returns a filter for nodes with non-zero initial weight.

func HasNetworkingKey added in v0.21.1

func HasNetworkingKey(keys ...crypto.PublicKey) flow.IdentityFilter[flow.Identity]

HasNetworkingKey returns a filter that returns true for any identity with a networking public key matching any of the inputs.

func HasNodeID

func HasNodeID[T flow.GenericIdentity](nodeIDs ...flow.Identifier) flow.IdentityFilter[T]

HasNodeID returns a filter that returns true for any identity with an ID matching any of the inputs.

func HasParticipationStatus added in v0.33.30

func HasParticipationStatus(status flow.EpochParticipationStatus) flow.IdentityFilter[flow.Identity]

HasParticipationStatus is a filter that returns true if the node epoch participation status matches the input.

func HasRole

func HasRole[T flow.GenericIdentity](roles ...flow.Role) flow.IdentityFilter[T]

HasRole returns a filter for nodes with one of the input roles.

func HasWeightGreaterThanZero added in v0.33.30

func HasWeightGreaterThanZero[T flow.GenericIdentity](identity *T) bool

HasWeightGreaterThanZero returns a filter for nodes with a weight greater than zero.

func In

In returns a filter for identities within the input list. For an input identity i, the filter returns true if and only if i ∈ list. Caution: The filter solely operates on NodeIDs. Other identity fields are not compared. This function is just a compact representation of `HasNodeID[T](list.NodeIDs()...)` which behaves algorithmically the same way.

func Not

Not returns a filter equivalent to the inverse of the input filter.

func Or

Or combines two or more filters and only needs one of them to be true.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL