notarization

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 19 Imported by: 0 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

View Source
var NewEvents = event.CreateGroupConstructor(func() (self *Events) {
	return &Events{
		SlotCommitted:        event.New1[*SlotCommittedDetails](),
		AcceptedBlockRemoved: event.New1[models.BlockID](),
		Error:                event.New1[error](),
	}
})

NewEvents contains the constructor of the Events object (it is generated by a generic factory).

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	IssuerPublicKey  ed25519.PublicKey `serix:"0"`
	IssuingTime      time.Time         `serix:"1"`
	CommitmentID     commitment.ID     `serix:"2"`
	BlockContentHash types.Identifier  `serix:"3"`
	Signature        ed25519.Signature `serix:"4"`
	// contains filtered or unexported fields
}

func NewAttestation

func NewAttestation(block *models.Block, slotTimeProvider *slot.TimeProvider) *Attestation

func (Attestation) Bytes

func (a Attestation) Bytes() (bytes []byte, err error)

func (*Attestation) Compare

func (a *Attestation) Compare(other *Attestation) int

func (*Attestation) FromBytes

func (a *Attestation) FromBytes(bytes []byte) (consumedBytes int, err error)

func (*Attestation) ID

func (a *Attestation) ID() models.BlockID

func (*Attestation) IssuerID

func (a *Attestation) IssuerID() identity.ID

func (*Attestation) VerifySignature

func (a *Attestation) VerifySignature() (valid bool, err error)

type Attestations

type Attestations interface {
	Get(index slot.Index) (attestations *ads.Map[identity.ID, Attestation, *identity.ID, *Attestation], err error)

	traits.Committable
	module.Interface
}

type Events

type Events struct {
	SlotCommitted        *event.Event1[*SlotCommittedDetails]
	AcceptedBlockRemoved *event.Event1[models.BlockID]
	Error                *event.Event1[error]

	event.Group[Events, *Events]
}

Events is a container that acts as a dictionary for the events of the notarization manager.

type Notarization

type Notarization interface {
	Events() *Events

	Attestations() Attestations

	// IsFullyCommitted returns if notarization finished committing all pending slots up to the current acceptance time.
	IsFullyCommitted() bool

	NotarizeAcceptedBlock(block *models.Block) (err error)

	NotarizeOrphanedBlock(block *models.Block) (err error)

	Import(reader io.ReadSeeker) (err error)

	Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)

	PerformLocked(perform func(m Notarization))

	module.Interface
}

type OutputsProvider

type OutputsProvider func(callback func(*mempool.OutputWithMetadata) error) error

type SlotCommittedDetails

type SlotCommittedDetails struct {
	Commitment            *commitment.Commitment
	AcceptedBlocks        *ads.Set[models.BlockID, *models.BlockID]
	AcceptedTransactions  *ads.Set[utxo.TransactionID, *utxo.TransactionID]
	SpentOutputs          OutputsProvider
	CreatedOutputs        OutputsProvider
	ActiveValidatorsCount int
}

SlotCommittedDetails contains the details of a committed slot.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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