shutter

package
v1.9.7-0...-8dbb83f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: LGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolVersion     = "/shutter/0.1.0"
	DecryptionKeysTopic = "decryptionKeys"
)

Variables

View Source
var (
	ErrInstanceIdMismatch     = errors.New("instance id mismatch")
	ErrMissingGnosisExtraData = errors.New("missing gnosis extra data")
	ErrSlotTooLarge           = errors.New("slot too large")
	ErrSlotInThePast          = errors.New("slot in the past")
	ErrSlotInTheFuture        = errors.New("slot in the future")
	ErrTxPointerTooLarge      = errors.New("tx pointer too large")
	ErrEonTooLarge            = errors.New("eon too large")
	ErrCurrentEonUnavailable  = errors.New("current eon unavailable")
	ErrEonInThePast           = errors.New("eon in the past")
	ErrEonInTheFuture         = errors.New("eon in the future")
	ErrEmptyKeys              = errors.New("empty keys")
	ErrTooManyKeys            = errors.New("too many keys")
	ErrIgnoreMsg              = errors.New("ignoring msg")
)
View Source
var ErrTimestampBeforeGenesis = errors.New("timestamp before genesis")

Functions

func NewDecryptionKeysP2pValidatorEx

func NewDecryptionKeysP2pValidatorEx(logger log.Logger, config Config, sc SlotCalculator, et EonTracker) pubsub.ValidatorEx

Types

type BeaconChainSlotCalculator

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

func NewBeaconChainSlotCalculator

func NewBeaconChainSlotCalculator(genesisTimestamp uint64, secondsPerSlot uint64) BeaconChainSlotCalculator

func (BeaconChainSlotCalculator) CalcCurrentSlot

func (sc BeaconChainSlotCalculator) CalcCurrentSlot() uint64

func (BeaconChainSlotCalculator) CalcSlot

func (sc BeaconChainSlotCalculator) CalcSlot(timestamp uint64) (uint64, error)

func (BeaconChainSlotCalculator) CalcSlotAge

func (sc BeaconChainSlotCalculator) CalcSlotAge(slot uint64) time.Duration

type BlockEvent

type BlockEvent struct {
	BlockNum uint64
	Unwind   bool
}

type BlockListener

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

func NewBlockListener

func NewBlockListener(logger log.Logger, stateChangesClient stateChangesClient) BlockListener

func (BlockListener) RegisterObserver

func (bl BlockListener) RegisterObserver(o event.Observer[BlockEvent]) event.UnregisterFunc

func (BlockListener) Run

func (bl BlockListener) Run(ctx context.Context) error

type Config

type Config struct {
	P2pConfig
	Enabled                          bool
	InstanceId                       uint64
	BeaconChainGenesisTimestamp      uint64
	SecondsPerSlot                   uint64
	SequencerContractAddress         string
	ValidatorRegistryContractAddress string
	KeyBroadcastContractAddress      string
	KeyperSetManagerContractAddress  string
	MaxNumKeysPerMessage             uint64
	MaxRecentEons                    int
}

func ConfigByChainName

func ConfigByChainName(chainName string) Config

type DecryptionKeysListener

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

func NewDecryptionKeysListener

func NewDecryptionKeysListener(logger log.Logger, config Config, sc SlotCalculator, et EonTracker) DecryptionKeysListener

func (DecryptionKeysListener) RegisterObserver

func (DecryptionKeysListener) Run

type DecryptionKeysProcessor

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

func NewDecryptionKeysProcessor

func NewDecryptionKeysProcessor(logger log.Logger) DecryptionKeysProcessor

func (DecryptionKeysProcessor) Enqueue

func (dkp DecryptionKeysProcessor) Enqueue(msg *proto.DecryptionKeys)

func (DecryptionKeysProcessor) Run

type DecryptionKeysValidator

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

func NewDecryptionKeysValidator

func NewDecryptionKeysValidator(config Config, sc SlotCalculator, et EonTracker) DecryptionKeysValidator

func (DecryptionKeysValidator) Validate

type Eon

type Eon struct {
	Index           EonIndex
	ActivationBlock uint64
	Key             []byte
	Threshold       uint64
	Members         []libcommon.Address
}

type EonIndex

type EonIndex uint64

type EonTracker

type EonTracker interface {
	Run(ctx context.Context) error
	CurrentEon() (Eon, bool)
	RecentEon(index EonIndex) (Eon, bool)
}

type KsmEonTracker

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

func NewKsmEonTracker

func NewKsmEonTracker(config Config, blockListener BlockListener, contractBackend bind.ContractBackend) *KsmEonTracker

func (*KsmEonTracker) CurrentEon

func (et *KsmEonTracker) CurrentEon() (Eon, bool)

func (*KsmEonTracker) RecentEon

func (et *KsmEonTracker) RecentEon(index EonIndex) (Eon, bool)

func (*KsmEonTracker) Run

func (et *KsmEonTracker) Run(ctx context.Context) error

type P2pConfig

type P2pConfig struct {
	PrivateKey     *ecdsa.PrivateKey
	ListenPort     uint64
	BootstrapNodes []string
}

func (P2pConfig) BootstrapNodesAddrInfo

func (c P2pConfig) BootstrapNodesAddrInfo() ([]peer.AddrInfo, error)

type Pool

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

func NewPool

func NewPool(
	logger log.Logger,
	config Config,
	secondaryTxnProvider txnprovider.TxnProvider,
	contractBackend bind.ContractBackend,
	stateChangesClient stateChangesClient,
) *Pool

func (Pool) ProvideTxns

func (p Pool) ProvideTxns(ctx context.Context, opts ...txnprovider.ProvideOption) ([]types.Transaction, error)

func (Pool) Run

func (p Pool) Run(ctx context.Context) error

type SlotCalculator

type SlotCalculator interface {
	CalcSlot(timestamp uint64) (uint64, error)
	CalcSlotAge(slot uint64) time.Duration
	CalcCurrentSlot() uint64
}

Directories

Path Synopsis
internal
testhelpers
Package testhelpers is a generated GoMock package.
Package testhelpers is a generated GoMock package.

Jump to

Keyboard shortcuts

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