de

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_DE_BATCH_SIZE = int64(50)
View Source
const (
	MaxDuplicateDEAttempts = 5
)

Variables

This section is empty.

Functions

func CountAssignedSignings added in v3.0.1

func CountAssignedSignings(events sdk.StringEvents, address string) int64

CountAssignedSignings counts the number of assigned signings for the given address.

func GenerateDEs

func GenerateDEs(n uint64, secret tss.Scalar, db DEGetter) (privDEs []store.DE, err error)

GenerateDEs generates n pairs of DE by using secret value as a random factor

Types

type DE

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

DE is a worker responsible for managing own nonce (DE) that being used for signing process

func New

func New(ctx *context.Context) (*DE, error)

New creates a new instance of the DE-related workers. It initializes the necessary components and returns the created DE instance or an error if initialization fails.

func (*DE) GetResponseReceivers added in v3.0.1

func (de *DE) GetResponseReceivers() []*msg.ResponseReceiver

GetResponseReceivers returns the message response receivers of the worker.

func (*DE) Start

func (de *DE) Start()

Start starts the DE-related workers.

func (*DE) Stop

func (de *DE) Stop() error

Stop stops DE-related workers.

type DECounter added in v3.0.1

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

DECounter tracks the number of vacant and pending DEs. It estimates the expected on-chain DE count, assuming all MsgSubmitDE transactions are eventually committed.

func NewDECounter added in v3.0.1

func NewDECounter() *DECounter

NewDECounter creates a new DECounter.

func (*DECounter) AfterDEsCommitted added in v3.0.1

func (dec *DECounter) AfterDEsCommitted(numDE int64)

AfterDEsCommitted updates internal counters after DEs are successfully committed.

func (*DECounter) AfterDEsRejected added in v3.0.1

func (dec *DECounter) AfterDEsRejected(numDE int64)

AfterDEsRejected updates internal counters after DEs are rejected.

func (*DECounter) AfterSyncWithChain added in v3.0.1

func (dec *DECounter) AfterSyncWithChain(
	existing uint64,
	expectedDESize uint64,
	blockHeight int64,
) int64

AfterSyncWithChain syncs local state with actual on-chain DE count and updates internal counters.

func (*DECounter) EvaluateDECreationFromUsage added in v3.0.1

func (dec *DECounter) EvaluateDECreationFromUsage(
	deUsed int64,
	threshold uint64,
	blockHeight int64,
) int64

EvaluateDECreationFromUsage updates the internal counters based on the usage data. and return the number of DEs that needs to be created based on the given threshold.

func (*DECounter) String added in v3.0.1

func (dec *DECounter) String() string

type DEGetter

type DEGetter interface {
	HasDE(de types.DE) bool
}

type DeleteDE

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

DeleteDE is a worker responsible for deleting DEs from the store once being triggered by the related chain events

func NewDeleteDE

func NewDeleteDE(ctx *context.Context) (*DeleteDE, error)

NewDeleteDE creates a new DeleteDE worker.

func (*DeleteDE) GetResponseReceivers added in v3.0.1

func (d *DeleteDE) GetResponseReceivers() []*msg.ResponseReceiver

GetResponseReceivers returns the message response receivers of the worker.

func (*DeleteDE) Start

func (d *DeleteDE) Start()

Start starts the DeleteDE worker.

func (*DeleteDE) Stop

func (d *DeleteDE) Stop() error

Stop stops the DeleteDE worker.

type PubDE

type PubDE struct {
	PubDE types.DE
}

PubDE represents the data structure for public D,E being retrieved from events.

func ParsePubDEFromEvents

func ParsePubDEFromEvents(events sdk.StringEvents, eventType string) ([]PubDE, error)

ParsePubDEFromEvents parses the events into PubDE struct from the given events and event type. It extracts the public D and E from the log and returns the parsed Events or an error if parsing fails.

type UpdateDE

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

UpdateDE is a worker responsible for updating DEs in the store and chains

func NewUpdateDE

func NewUpdateDE(ctx *context.Context) (*UpdateDE, error)

NewUpdateDE creates a new UpdateDE worker.

func (*UpdateDE) GetResponseReceivers added in v3.0.1

func (u *UpdateDE) GetResponseReceivers() []*msg.ResponseReceiver

GetResponseReceivers returns the message response receivers of the worker.

func (*UpdateDE) Start

func (u *UpdateDE) Start()

Start starts the UpdateDE worker.

func (*UpdateDE) Stop

func (u *UpdateDE) Stop() error

Stop stops the UpdateDE worker.

Jump to

Keyboard shortcuts

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