Documentation ¶
Index ¶
- Variables
- func PubsubTopicID(fraudType, networkID string) string
- type ProofService
- func (f *ProofService[H]) AddVerifier(proofType fraud.ProofType, verifier fraud.Verifier[H]) error
- func (f *ProofService[H]) Broadcast(ctx context.Context, p fraud.Proof[H]) error
- func (f *ProofService[H]) Get(ctx context.Context, proofType fraud.ProofType) ([]fraud.Proof[H], error)
- func (f *ProofService[H]) Start(context.Context) error
- func (f *ProofService[H]) Stop(context.Context) (err error)
- func (f *ProofService[H]) Subscribe(proofType fraud.ProofType) (_ fraud.Subscription[H], err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var GossibSubScore = pubsub.TopicScoreParams{ SkipAtomicValidation: true, TopicWeight: 0.1, TimeInMeshWeight: 0.0002778, TimeInMeshQuantum: time.Second, TimeInMeshCap: 1, FirstMessageDeliveriesWeight: 50, FirstMessageDeliveriesDecay: pubsub.ScoreParameterDecay(10 * time.Hour), FirstMessageDeliveriesCap: math.MaxFloat64, InvalidMessageDeliveriesWeight: 0, }
GossibSubScore provides a set of recommended parameters for header GossipSub topic, a.k.a FraudSub. TODO(@Wondertan): We should disable mesh on publish for this topic to minimize chances of censoring FPs by eclipsing nodes producing them.
Functions ¶
func PubsubTopicID ¶
Types ¶
type ProofService ¶
type ProofService[H header.Header[H]] struct {
// contains filtered or unexported fields
}
ProofService is responsible for validating and propagating Fraud Proofs. It implements the Service interface.
func NewProofService ¶
func (*ProofService[H]) AddVerifier ¶ added in v0.1.1
func (f *ProofService[H]) AddVerifier(proofType fraud.ProofType, verifier fraud.Verifier[H]) error
func (*ProofService[H]) Broadcast ¶
func (f *ProofService[H]) Broadcast(ctx context.Context, p fraud.Proof[H]) error
func (*ProofService[H]) Get ¶
func (f *ProofService[H]) Get(ctx context.Context, proofType fraud.ProofType) ([]fraud.Proof[H], error)
func (*ProofService[H]) Start ¶
func (f *ProofService[H]) Start(context.Context) error
Start joins fraud proofs topics, sets the stream handler for fraudProtocolID and starts syncing if syncer is enabled.
func (*ProofService[H]) Stop ¶
func (f *ProofService[H]) Stop(context.Context) (err error)
Stop removes the stream handler and cancels the underlying ProofService
func (*ProofService[H]) Subscribe ¶
func (f *ProofService[H]) Subscribe(proofType fraud.ProofType) (_ fraud.Subscription[H], err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.