slashing

package
v0.27.3-debug-prune-he... Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: AGPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer added in v0.27.3

type Consumer struct {
	// contains filtered or unexported fields
}

Consumer is a struct that logs a message for any slashable offences. This struct will be updated in the future when slashing is implemented.

func NewSlashingViolationsConsumer

func NewSlashingViolationsConsumer(log zerolog.Logger) *Consumer

NewSlashingViolationsConsumer returns a new Consumer

func (*Consumer) OnInvalidMsgError added in v0.27.3

func (c *Consumer) OnInvalidMsgError(violation *Violation)

OnInvalidMsgError logs an error for messages that contained payloads that could not

// be unmarshalled into the message type denoted by message code byte.

func (*Consumer) OnSenderEjectedError added in v0.27.3

func (c *Consumer) OnSenderEjectedError(violation *Violation)

OnSenderEjectedError logs an error for sender ejected error

func (*Consumer) OnUnAuthorizedSenderError added in v0.27.3

func (c *Consumer) OnUnAuthorizedSenderError(violation *Violation)

OnUnAuthorizedSenderError logs an error for unauthorized sender error

func (*Consumer) OnUnknownMsgTypeError added in v0.27.3

func (c *Consumer) OnUnknownMsgTypeError(violation *Violation)

OnUnknownMsgTypeError logs an error for unknown message type error

type Violation added in v0.27.3

type Violation struct {
	Identity  *flow.Identity
	PeerID    string
	MsgType   string
	Channel   network.Channel
	IsUnicast bool
	Err       error
}

type ViolationsConsumer added in v0.27.3

type ViolationsConsumer interface {
	// OnUnAuthorizedSenderError logs an error for unauthorized sender error
	OnUnAuthorizedSenderError(violation *Violation)

	// OnUnknownMsgTypeError logs an error for unknown message type error
	OnUnknownMsgTypeError(violation *Violation)

	// OnInvalidMsgError logs an error for messages that contained payloads that could not
	// be unmarshalled into the message type denoted by message code byte.
	OnInvalidMsgError(violation *Violation)

	// OnSenderEjectedError logs an error for sender ejected error
	OnSenderEjectedError(violation *Violation)
}

Jump to

Keyboard shortcuts

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