ceremonyclient/consensus/consensus_sync.go

21 lines
670 B
Go

package consensus
import (
"context"
"source.quilibrium.com/quilibrium/monorepo/consensus/models"
)
// SyncProvider handles synchronization management
type SyncProvider[StateT models.Unique] interface {
// Performs synchronization to set internal state. Note that it is assumed
// that errors are transient and synchronization should be reattempted on
// failure. If some other process for synchronization is used and this should
// be bypassed, send nil on the error channel. Provided context may be
// canceled, should be used to halt long-running sync operations.
Synchronize(
ctx context.Context,
existing *StateT,
) (<-chan *StateT, <-chan error)
}