vouch/services/submitter/service.go

69 lines
3.0 KiB
Go
Raw Permalink Normal View History

2021-07-17 23:49:38 -07:00
// Copyright © 2020, 2021 Attestant Limited.
2020-09-27 23:46:00 -07:00
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package submitter
import (
"context"
2020-10-28 08:09:51 -07:00
api "github.com/attestantio/go-eth2-client/api/v1"
2021-07-17 23:49:38 -07:00
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/altair"
"github.com/attestantio/go-eth2-client/spec/phase0"
2020-09-27 23:46:00 -07:00
)
// Service is the submitter service.
type Service interface{}
2020-11-26 12:32:04 -08:00
// AttestationsSubmitter is the interface for a submitter of attestations.
type AttestationsSubmitter interface {
// SubmitAttestations submits multiple attestations.
SubmitAttestations(ctx context.Context, attestations []*phase0.Attestation) error
2020-09-27 23:46:00 -07:00
}
// BeaconBlockSubmitter is the interface for a submitter of beacon blocks.
type BeaconBlockSubmitter interface {
// SubmitBeaconBlock submits a block.
2021-07-17 23:49:38 -07:00
SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) error
2020-09-27 23:46:00 -07:00
}
// BeaconCommitteeSubscriptionsSubmitter is the interface for a submitter of beacon committee subscriptions.
type BeaconCommitteeSubscriptionsSubmitter interface {
// SubmitBeaconCommitteeSubscription submits a batch of beacon committee subscriptions.
2020-10-28 08:09:51 -07:00
SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscriptions []*api.BeaconCommitteeSubscription) error
2020-09-27 23:46:00 -07:00
}
// AggregateAttestationsSubmitter is the interface for a submitter of aggregate attestations.
type AggregateAttestationsSubmitter interface {
// SubmitAggregateAttestations submits aggregate attestations.
SubmitAggregateAttestations(ctx context.Context, aggregateAttestations []*phase0.SignedAggregateAndProof) error
2020-09-27 23:46:00 -07:00
}
2021-07-17 23:49:38 -07:00
// SyncCommitteeMessagesSubmitter is the interface for a submitter of sync committee messages.
type SyncCommitteeMessagesSubmitter interface {
// SubmitSyncCommitteeMessages submits sync committee messages.
SubmitSyncCommitteeMessages(ctx context.Context, messages []*altair.SyncCommitteeMessage) error
}
// SyncCommitteeSubscriptionsSubmitter is the interface for a submitter of sync committee subscriptions.
type SyncCommitteeSubscriptionsSubmitter interface {
// SubmitSyncCommitteeSubscription submits a batch of sync committee subscriptions.
SubmitSyncCommitteeSubscriptions(ctx context.Context, subscriptions []*api.SyncCommitteeSubscription) error
}
// SyncCommitteeContributionsSubmitter is the interface for a submitter of sync committee contributions.
type SyncCommitteeContributionsSubmitter interface {
// SubmitSyncCommitteeContributions submits sync committee contributions.
SubmitSyncCommitteeContributions(ctx context.Context, contributionAndProofs []*altair.SignedContributionAndProof) error
}