bls

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SrStartRound defines ID of Subround "Start round"
	SrStartRound = iota
	// SrBlock defines ID of Subround "block"
	SrBlock
	// SrSignature defines ID of Subround "signature"
	SrSignature
	// SrEndRound defines ID of Subround "End round"
	SrEndRound
)
View Source
const (
	// MtUnknown defines ID of a message that has unknown data inside
	MtUnknown consensus.MessageType = iota
	// MtBlockBodyAndHeader defines ID of a message that has a block body and a block header inside
	MtBlockBodyAndHeader
	// MtBlockBody defines ID of a message that has a block body inside
	MtBlockBody
	// MtBlockHeader defines ID of a message that has a block header inside
	MtBlockHeader
	// MtSignature defines ID of a message that has a Signature inside
	MtSignature
	// MtBlockHeaderFinalInfo defines ID of a message that has a block header final info inside
	// (aggregate signature, bitmap and seal leader signature for the proposed and accepted header)
	MtBlockHeaderFinalInfo
	// MtInvalidSigners defines ID of a message that has a invalid signers p2p messages inside
	MtInvalidSigners
)
View Source
const (
	// BlockBodyAndHeaderStringValue represents the string to be used to identify a block body and a block header
	BlockBodyAndHeaderStringValue = "(BLOCK_BODY_AND_HEADER)"

	// BlockBodyStringValue represents the string to be used to identify a block body
	BlockBodyStringValue = "(BLOCK_BODY)"

	// BlockHeaderStringValue represents the string to be used to identify a block header
	BlockHeaderStringValue = "(BLOCK_HEADER)"

	// BlockSignatureStringValue represents the string to be used to identify a block's signature
	BlockSignatureStringValue = "(SIGNATURE)"

	// BlockHeaderFinalInfoStringValue represents the string to be used to identify a block's header final info
	BlockHeaderFinalInfoStringValue = "(FINAL_INFO)"

	// BlockUnknownStringValue represents the string to be used to identify an unknown block
	BlockUnknownStringValue = "(UNKNOWN)"

	// BlockDefaultStringValue represents the message to identify a message that is undefined
	BlockDefaultStringValue = "Undefined message type"
)
View Source
const DefaultMaxNumOfMessageTypeAccepted = uint32(1)

DefaultMaxNumOfMessageTypeAccepted represents the maximum number of the same message type accepted in one round to be received from the same public key for the default message types

View Source
const MaxNumOfMessageTypeSignatureAccepted = uint32(2)

MaxNumOfMessageTypeSignatureAccepted represents the maximum number of the signature message type accepted in one round to be received from the same public key

View Source
const PeerMaxMessagesPerSec = uint32(6)

PeerMaxMessagesPerSec defines how many messages can be propagated by a pid in a round. The value was chosen by following the next premises:

  1. a leader can propagate as maximum as 3 messages per round: proposed header block + proposed body + final info;
  2. due to the fact that a delayed signature of the proposer (from previous round) can be received in the current round adds an extra 1 to the total value, reaching value 4;
  3. Because the leader might be selected in the next round and might have an empty data pool, it can send the newly empty proposed block at the very beginning of the next round. One extra message here, yielding to a total of 5.
  4. If we consider the forks that can appear on the system wee need to add one more to the value.

Validators only send one signature message in a round, treating the edge case of a delayed message, will need at most 2 messages per round (which is ok as it is below the set value of 5)

Variables

This section is empty.

Functions

func GetStringValue added in v1.9.0

func GetStringValue(msgType consensus.MessageType) string

GetStringValue returns the string value of a given MessageType

func GetSubroundName added in v1.9.0

func GetSubroundName(subroundId int) string

GetSubroundName returns the name of each Subround from a given Subround ID

func NewConsensusService

func NewConsensusService() (*worker, error)

NewConsensusService creates a new worker object

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