services

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIgnore                          = errors.New("ignore") // ErrIgnore is used to indicate that the message should be ignored.
	ErrBlockYoungerThanParent          = errors.New("block is younger than parent")
	ErrInvalidCommitmentsCount         = errors.New("invalid commitments count")
	ErrCommitmentsInclusionProofFailed = errors.New("commitments inclusion proof failed")
	ErrInvalidSidecarSlot              = errors.New("invalid sidecar slot")
	ErrBlobIndexOutOfRange             = errors.New("blob index out of range")
)
View Source
var ErrInvalidBlsSignature = errors.New("invalid bls signature")
View Source
var (
	ErrInvalidSignature = errors.New("invalid signature")
)

Functions

func AggregateAndProofSignature

func AggregateAndProofSignature(
	state *state.CachingBeaconState,
	aggregate *cltypes.AggregateAndProof,
) ([]byte, []byte, []byte, error)

func AggregateMessageSignature

func AggregateMessageSignature(
	s *state.CachingBeaconState,
	aggregateAndProof *cltypes.SignedAggregateAndProof,
	attestingIndicies []uint64,
) ([]byte, []byte, []byte, error)

func AggregatorSignature

func AggregatorSignature(
	state *state.CachingBeaconState,
	aggregate *cltypes.SignedAggregateAndProof,
) ([]byte, []byte, []byte, error)

func NewProposerSlashingService

func NewProposerSlashingService(
	operationsPool pool.OperationsPool,
	syncedDataManager synced_data.SyncedData,
	beaconCfg *clparams.BeaconChainConfig,
	ethClock eth_clock.EthereumClock,
	emitters *beaconevents.EventEmitter,
) *proposerSlashingService

Types

type AggregateAndProofService

type AggregateAndProofService Service[*cltypes.SignedAggregateAndProofData]

func NewAggregateAndProofService

func NewAggregateAndProofService(
	ctx context.Context,
	syncedDataManager *synced_data.SyncedDataManager,
	forkchoiceStore forkchoice.ForkChoiceStorage,
	beaconCfg *clparams.BeaconChainConfig,
	opPool pool.OperationsPool,
	test bool,
	batchSignatureVerifier *BatchSignatureVerifier,
) AggregateAndProofService

type AggregateVerificationData

type AggregateVerificationData struct {
	Signatures [][]byte
	SignRoots  [][]byte
	Pks        [][]byte
	F          func()
	GossipData *sentinel.GossipData
}

each AggregateVerification request has sentinel.SentinelClient and *sentinel.GossipData to make sure that we can validate it separately and in case of failure we ban corresponding GossipData.Peer or simply run F and publish GossipData in case signature verification succeeds.

func GetSignaturesOnAggregate

func GetSignaturesOnAggregate(
	s *state.CachingBeaconState,
	aggregateAndProof *cltypes.SignedAggregateAndProof,
	attestingIndicies []uint64,
) (*AggregateVerificationData, error)

type AttestationService

type AttestationService Service[*AttestationWithGossipData]

func NewAttestationService

func NewAttestationService(
	ctx context.Context,
	forkchoiceStore forkchoice.ForkChoiceStorage,
	committeeSubscribe committee_subscription.CommitteeSubscribe,
	ethClock eth_clock.EthereumClock,
	syncedDataManager synced_data.SyncedData,
	beaconCfg *clparams.BeaconChainConfig,
	netCfg *clparams.NetworkConfig,
	emitters *beaconevents.EventEmitter,
	batchSignatureVerifier *BatchSignatureVerifier,
) AttestationService

type AttestationWithGossipData

type AttestationWithGossipData struct {
	Attestation *solid.Attestation
	GossipData  *sentinel.GossipData
	// ImmediateProcess indicates whether the attestation should be processed immediately or able to be scheduled for later processing.
	ImmediateProcess bool
}

AttestationWithGossipData type represents attestation with the gossip data where it's coming from.

type BLSToExecutionChangeService

type BLSToExecutionChangeService Service[*cltypes.SignedBLSToExecutionChangeWithGossipData]

func NewBLSToExecutionChangeService

func NewBLSToExecutionChangeService(
	operationsPool pool.OperationsPool,
	emitters *beaconevents.EventEmitter,
	syncedDataManager synced_data.SyncedData,
	beaconCfg *clparams.BeaconChainConfig,
	batchSignatureVerifier *BatchSignatureVerifier,
) BLSToExecutionChangeService

type BatchSignatureVerifier

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

func NewBatchSignatureVerifier

func NewBatchSignatureVerifier(ctx context.Context, sentinel sentinel.SentinelClient) *BatchSignatureVerifier

func (*BatchSignatureVerifier) AsyncVerifyAggregateProof

func (b *BatchSignatureVerifier) AsyncVerifyAggregateProof(data *AggregateVerificationData)

func (*BatchSignatureVerifier) AsyncVerifyAttestation

func (b *BatchSignatureVerifier) AsyncVerifyAttestation(data *AggregateVerificationData)

AsyncVerifyAttestation schedules new verification

func (*BatchSignatureVerifier) AsyncVerifyBlsToExecutionChange

func (b *BatchSignatureVerifier) AsyncVerifyBlsToExecutionChange(data *AggregateVerificationData)

func (*BatchSignatureVerifier) ImmediateVerification

func (b *BatchSignatureVerifier) ImmediateVerification(data *AggregateVerificationData) error

func (*BatchSignatureVerifier) Start

func (b *BatchSignatureVerifier) Start()

type BlobSidecarsService

type BlobSidecarsService Service[*cltypes.BlobSidecar]

func NewBlobSidecarService

func NewBlobSidecarService(
	ctx context.Context,
	beaconCfg *clparams.BeaconChainConfig,
	forkchoiceStore forkchoice.ForkChoiceStorage,
	syncedDataManager *synced_data.SyncedDataManager,
	ethClock eth_clock.EthereumClock,
	emitters *beaconevents.EventEmitter,
	test bool,
) BlobSidecarsService

NewBlobSidecarService creates a new blob sidecar service

type BlockService

type BlockService Service[*cltypes.SignedBeaconBlock]

type ProposerSlashingService

type ProposerSlashingService Service[*cltypes.ProposerSlashing]

type Service

type Service[T any] interface {
	ProcessMessage(ctx context.Context, subnet *uint64, msg T) error
}

func NewBlockService

NewBlockService creates a new block service

type SyncCommitteeMessagesService

type SyncCommitteeMessagesService Service[*cltypes.SyncCommitteeMessage]

func NewSyncCommitteeMessagesService

func NewSyncCommitteeMessagesService(
	beaconChainCfg *clparams.BeaconChainConfig,
	ethClock eth_clock.EthereumClock,
	syncedDataManager *synced_data.SyncedDataManager,
	syncContributionPool sync_contribution_pool.SyncContributionPool,
	test bool,
) SyncCommitteeMessagesService

NewSyncCommitteeMessagesService creates a new sync committee messages service

type SyncContributionService

type SyncContributionService Service[*cltypes.SignedContributionAndProof]

func NewSyncContributionService

func NewSyncContributionService(
	syncedDataManager *synced_data.SyncedDataManager,
	beaconCfg *clparams.BeaconChainConfig,
	syncContributionPool sync_contribution_pool.SyncContributionPool,
	ethClock eth_clock.EthereumClock,
	emitters *beaconevents.EventEmitter,
	test bool,
) SyncContributionService

NewSyncContributionService creates a new sync contribution service

type VoluntaryExitService

type VoluntaryExitService Service[*cltypes.SignedVoluntaryExit]

func NewVoluntaryExitService

func NewVoluntaryExitService(
	operationsPool pool.OperationsPool,
	emitters *beaconevents.EventEmitter,
	syncedDataManager synced_data.SyncedData,
	beaconCfg *clparams.BeaconChainConfig,
	ethClock eth_clock.EthereumClock,
) VoluntaryExitService

Directories

Path Synopsis
Package mock_services is a generated GoMock package.
Package mock_services is a generated GoMock package.

Jump to

Keyboard shortcuts

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