identities

package
v1.7.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EquivocationSet added in v1.6.1

func EquivocationSet(db sql.Executor, id types.NodeID) ([]types.NodeID, error)

EquivocationSet returns all node IDs that are married to the given node ID including itself.

func EquivocationSetByMarriageATX

func EquivocationSetByMarriageATX(db sql.Executor, atx types.ATXID) ([]types.NodeID, error)

func GetBlobSizes added in v1.4.1

func GetBlobSizes(db sql.Executor, ids [][]byte) (sizes []int, err error)

GetBlobSizes returns the sizes of the blobs corresponding to malfeasance proofs for the specified identities. For non-existent proofs, the corresponding items are set to -1.

func GetMalicious

func GetMalicious(db sql.Executor) (ids []types.NodeID, err error)

GetMalicious retrieves malicious node IDs from the database.

func IsMalicious

func IsMalicious(db sql.Executor, nodeID types.NodeID) (bool, error)

IsMalicious returns true if identity is known to be malicious.

func IterateMalicious added in v1.4.1

func IterateMalicious(
	db sql.Executor,
	callback func(total int, id types.NodeID) error,
) error

IterateMalicious invokes the specified callback for each malicious node ID. It stops if the callback returns an error.

func IterateMarriages

func IterateMarriages(db sql.Executor, cb func(id types.NodeID, data *MarriageData) bool) error

func LoadMalfeasanceBlob added in v1.4.1

func LoadMalfeasanceBlob(_ context.Context, db sql.Executor, nodeID []byte, blob *sql.Blob) error

LoadMalfeasanceBlob returns the malfeasance proof in raw bytes for the given identity.

func MarriageATX

func MarriageATX(db sql.Executor, id types.NodeID) (types.ATXID, error)

MarriageATX obtains the marriage ATX for given ID.

func SetMalicious

func SetMalicious(db sql.Executor, nodeID types.NodeID, proof []byte, received time.Time) error

SetMalicious records identity as malicious.

func SetMarriage added in v1.6.1

func SetMarriage(db sql.Executor, id types.NodeID, m *MarriageData) error

Set marriage inserts marriage data for given identity. If identity doesn't exist - create it.

Types

type MarriageData

type MarriageData struct {
	ATX       types.ATXID
	Index     int
	Target    types.NodeID // ID that was married to
	Signature types.EdSignature
}

func Marriage

func Marriage(db sql.Executor, id types.NodeID) (*MarriageData, error)

Jump to

Keyboard shortcuts

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