event

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// EventID_NodeComponentStarted is triggered when the node starts
	EventID_NodeComponentStarted = "NODE COMPONENT STARTED"
	// EventID_PreexecutionOOC is triggered when an OOC error is detected during the preexecution
	EventID_PreexecutionOOC EventID = "PRE EXECUTION OOC"
	// EventID_PreexecutionOOG is triggered when an OOG error is detected during the preexecution
	EventID_PreexecutionOOG EventID = "PRE EXECUTION OOG"
	// EventID_ExecutorError is triggered when an error is detected during the execution
	EventID_ExecutorError EventID = "EXECUTOR ERROR"
	// EventID_ReprocessFullBatchOOC is triggered when an OOC error is detected during the reprocessing of a full batch
	EventID_ReprocessFullBatchOOC EventID = "REPROCESS FULL BATCH OOC"
	// EventID_ExecutorRLPError is triggered when an RLP error is detected during the execution
	EventID_ExecutorRLPError EventID = "EXECUTOR RLP ERROR"
	// EventID_FinalizerHalt is triggered when the finalizer halts
	EventID_FinalizerHalt EventID = "FINALIZER HALT"
	// EventID_FinalizerRestart is triggered when the finalizer restarts
	EventID_FinalizerRestart EventID = "FINALIZER RESTART"
	// EventID_FinalizerBreakEvenGasPriceBigDifference is triggered when the finalizer recalculates the break even gas price and detects a big difference
	EventID_FinalizerBreakEvenGasPriceBigDifference EventID = "FINALIZER BREAK EVEN GAS PRICE BIG DIFFERENCE"
	// EventID_SynchronizerRestart is triggered when the Synchonizer restarts
	EventID_SynchronizerRestart EventID = "SYNCHRONIZER RESTART"
	// EventID_SynchronizerHalt is triggered when the synchronizer halts
	EventID_SynchronizerHalt EventID = "SYNCHRONIZER HALT"
	// EventID_SequenceSenderHalt is triggered when the SequenceSender halts
	EventID_SequenceSenderHalt EventID = "SEQUENCESENDER HALT"
	// EventID_NodeOOC is triggered when an OOC at node level is detected
	EventID_NodeOOC EventID = "NODE OOC"
	// EventID_UsedZKCountersOverflow is triggered when used ZK counters exceeds remaining batch ZK counters
	EventID_UsedZKCountersOverflow EventID = "USED ZKCOUNTERS OVERFLOW"
	// EventID_ReservedZKCountersOverflow is triggered when reserved ZK counters exceeds remaining batch ZK counters
	EventID_ReservedZKCountersOverflow EventID = "RESERVED ZKCOUNTERS OVERFLOW"
	// Source_Node is the source of the event
	Source_Node Source = "node"

	// Component_RPC is the component that triggered the event
	Component_RPC Component = "rpc"
	// Component_Pool is the component that triggered the event
	Component_Pool Component = "pool"
	// Component_Sequencer is the component that triggered the event
	Component_Sequencer Component = "sequencer"
	// Component_Synchronizer is the component that triggered the event
	Component_Synchronizer Component = "synchronizer"
	// Component_Aggregator is the component that triggered the event
	Component_Aggregator Component = "aggregator"
	// Component_EthTxManager is the component that triggered the event
	Component_EthTxManager Component = "ethtxmanager"
	// Component_GasPricer is the component that triggered the event
	Component_GasPricer Component = "gaspricer"
	// Component_Executor is the component that triggered the event
	Component_Executor Component = "executor"
	// Component_Broadcast is the component that triggered the event
	Component_Broadcast Component = "broadcast"
	// Component_Sequence_Sender is the component that triggered the event
	Component_Sequence_Sender = "seqsender"

	// Level_Emergency is the most severe level
	Level_Emergency Level = "emerg"
	// Level_Alert is the second most severe level
	Level_Alert Level = "alert"
	// Level_Critical is the third most severe level
	Level_Critical Level = "crit"
	// Level_Error is the fourth most severe level
	Level_Error Level = "err"
	// Level_Warning is the fifth most severe level
	Level_Warning Level = "warning"
	// Level_Notice is the sixth most severe level
	Level_Notice Level = "notice"
	// Level_Info is the seventh most severe level
	Level_Info Level = "info"
	// Level_Debug is the least severe level
	Level_Debug Level = "debug"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component string

Component is the component that triggered the event

type Config

type Config struct {
	// DB is the database configuration
	DB db.Config `mapstructure:"DB"`
}

Config for event

type Event

type Event struct {
	Id          big.Int
	ReceivedAt  time.Time
	IPAddress   string
	Source      Source
	Component   Component
	Level       Level
	EventID     EventID
	Description string
	Data        []byte
	Json        interface{}
}

Event represents a event that may be investigated

type EventID

type EventID string

EventID is the ID of the event

type EventLog

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

EventLog is the main struct for the event log

func NewEventLog

func NewEventLog(cfg Config, storage Storage) *EventLog

NewEventLog creates and initializes an instance of EventLog

func (*EventLog) LogEvent

func (e *EventLog) LogEvent(ctx context.Context, event *Event) error

LogEvent is used to store an event for runtime debugging

func (*EventLog) LogExecutorError

func (e *EventLog) LogExecutorError(ctx context.Context, responseError executor.ExecutorError, processBatchRequest *executor.ProcessBatchRequest)

LogExecutorError is used to store Executor error for runtime debugging

func (*EventLog) LogExecutorErrorV2 added in v0.5.0

func (e *EventLog) LogExecutorErrorV2(ctx context.Context, responseError executor.ExecutorError, processBatchRequest *executor.ProcessBatchRequestV2)

LogExecutorErrorV2 is used to store Executor error for runtime debugging

type Level

type Level string

Level is the level of the event

type Source

type Source string

Source is the source of the event

type Storage

type Storage interface {
	// LogEvent logs an event
	LogEvent(ctx context.Context, event *Event) error
}

Storage is the interface for the event storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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