eventstore

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 4 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 Store

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

Store provides database access for TSS events.

func NewStore

func NewStore(db *gorm.DB, logger zerolog.Logger) *Store

NewStore creates a new event store.

func (*Store) CountInProgress added in v0.0.14

func (s *Store) CountInProgress() (int64, error)

CountInProgress returns the number of events with status IN_PROGRESS. Used by the coordinator to cap how many new events to fetch.

func (*Store) GetBroadcastedSignEvents added in v0.0.16

func (s *Store) GetBroadcastedSignEvents(limit int) ([]store.Event, error)

GetBroadcastedSignEvents returns SIGN events with status BROADCASTED (for receipt check).

func (*Store) GetEvent

func (s *Store) GetEvent(eventID string) (*store.Event, error)

GetEvent retrieves an event by ID.

func (*Store) GetExpiredConfirmedEvents added in v0.0.16

func (s *Store) GetExpiredConfirmedEvents(currentBlock uint64, limit int) ([]store.Event, error)

GetExpiredConfirmedEvents returns CONFIRMED events past their expiry block.

func (*Store) GetInFlightSignEvents added in v0.0.16

func (s *Store) GetInFlightSignEvents() ([]store.Event, error)

GetInFlightSignEvents returns SIGN events that are currently IN_PROGRESS or SIGNED. BROADCASTED events are excluded because they are already submitted to chain; the pending nonce RPC accounts for them in the mempool, and including them here would make the coordinator wait for the resolver unnecessarily.

func (*Store) GetNonExpiredConfirmedEvents added in v0.0.16

func (s *Store) GetNonExpiredConfirmedEvents(currentBlock, minBlockConfirmation uint64, limit int) ([]store.Event, error)

GetNonExpiredConfirmedEvents returns confirmed events ready to be processed. Events must be at least minBlockConfirmation blocks old and not past expiry.

func (*Store) GetSignedSignEvents added in v0.0.16

func (s *Store) GetSignedSignEvents(limit int) ([]store.Event, error)

GetSignedSignEvents returns SIGN events with status SIGNED (ready to be broadcast).

func (*Store) ResetInProgressEventsToConfirmed added in v0.0.13

func (s *Store) ResetInProgressEventsToConfirmed() (int64, error)

ResetInProgressEventsToConfirmed resets all IN_PROGRESS events to CONFIRMED status. Called on node startup to recover from crashes mid-session.

func (*Store) Update added in v0.0.16

func (s *Store) Update(eventID string, fields map[string]any) error

Update applies field updates to an event by ID. Returns an error if the event is not found.

Example usage:

s.Update(id, map[string]any{"status": store.StatusInProgress})
s.Update(id, map[string]any{"status": store.StatusConfirmed, "block_height": newHeight})
s.Update(id, map[string]any{"broadcasted_tx_hash": txHash})

Jump to

Keyboard shortcuts

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