Documentation ¶
Overview ¶
Package faultdetector implements Optimism fault detector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFirstUnfinalizedOutputIndex ¶
func FindFirstUnfinalizedOutputIndex(ctx context.Context, logger log.Logger, fpw uint64, oracleAccessor OracleAccessor, l2RpcApi ChainAPIClient) (uint64, error)
FindFirstUnfinalizedOutputIndex finds and returns the first L2 output index that has not yet passed the fault proof window.
func NewFaultDetectorMetrics ¶
func NewFaultDetectorMetrics(reg prometheus.Registerer) *faultDetectorMetrics
NewFaultDetectorMetrics returns [FaultDetectorMetrics] with initialized metrics and registering to prometheus registry.
Types ¶
type ChainAPIClient ¶
type FaultDetector ¶
type FaultDetector struct {
// contains filtered or unexported fields
}
FaultDetector contains all the RPC providers/contract accessors and holds state information.
func GetFaultDetector ¶
func GetFaultDetector(ctx context.Context, logger log.Logger, l1RpcApi *chain.ChainAPIClient, l2RpcApi *chain.ChainAPIClient, oracleContractAccessor OracleAccessor, faultProofWindow uint64, currentOutputIndex uint64, metrics *faultDetectorMetrics, notification *notification.Notification, diverged bool, wg *sync.WaitGroup, errorChan chan error, mutex *sync.RWMutex) *FaultDetector
GetFaultDetector create FaultDetector instance from input values.
func NewFaultDetector ¶
func NewFaultDetector(ctx context.Context, logger log.Logger, errorChan chan error, wg *sync.WaitGroup, faultDetectorConfig *config.FaultDetectorConfig, metricRegistry *prometheus.Registry, notification *notification.Notification) (*FaultDetector, error)
NewFaultDetector will return FaultDetector with the initialized providers and configuration.
func (*FaultDetector) IsFaultDetected ¶
func (fd *FaultDetector) IsFaultDetected() bool
IsFaultDetected returns status of the fault detector.
func (*FaultDetector) Start ¶
func (fd *FaultDetector) Start()
Start will start the fault detector service by invoking the service every given interval.