Documentation ¶
Index ¶
- Variables
- func DecodeMessageData(eventData []byte, value *big.Int) (EventType, CanonicalToken, *big.Int, error)
- func DecodeRevertReason(hexStr string) (string, error)
- func WaitConfirmations(ctx context.Context, confirmer confirmer, confirmations uint64, ...) error
- func WaitReceipt(ctx context.Context, confirmer confirmer, txHash common.Hash) (*types.Receipt, error)
- type Bridge
- type Caller
- type CanonicalERC20
- type CanonicalNFT
- type CanonicalToken
- type Event
- type EventRepository
- type EventStatus
- type EventType
- type FindAllByAddressOpts
- type QuotaManager
- type SaveEventOpts
- type SignalService
- type TokenVault
- type UpdateFeesAndProfitabilityOpts
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoEthClient = errors.Validation.NewWithKeyAndDetail("ERR_NO_ETH_CLIENT", "EthClient is required") ErrNoECDSAKey = errors.Validation.NewWithKeyAndDetail("ERR_NO_ECDSA_KEY", "ECDSAKey is required") ErrNoBridgeAddress = errors.Validation.NewWithKeyAndDetail("ERR_NO_BRIDGE_ADDRESS", "BridgeAddress is required") ErrNoEventRepository = errors.Validation.NewWithKeyAndDetail("ERR_NO_EVENT_REPOSITORY", "EventRepository is required") ErrNoBlockRepository = errors.Validation.NewWithKeyAndDetail( "ERR_NO_BLOCK_REPOSITORY", "BlockRepository is required", ) ErrNoCORSOrigins = errors.Validation.NewWithKeyAndDetail("ERR_NO_CORS_ORIGINS", "CORS Origins are required") ErrNoProver = errors.Validation.NewWithKeyAndDetail("ERR_NO_PROVER", "Prover is required") ErrNoRPCClient = errors.Validation.NewWithKeyAndDetail("ERR_NO_RPC_CLIENT", "RPCClient is required") ErrNoBridge = errors.Validation.NewWithKeyAndDetail("ERR_NO_BRIDGE", "Bridge is required") ErrNoTaikoL2 = errors.Validation.NewWithKeyAndDetail("ERR_NO_TAIKO_L2", "TaikoL2 is required") ErrInvalidConfirmations = errors.Validation.NewWithKeyAndDetail( "ERR_INVALID_CONFIRMATIONS", "Confirmations amount is invalid, must be numerical and > 0", ) ErrInvalidConfirmationsTimeoutInSeconds = errors.Validation.NewWithKeyAndDetail( "ERR_INVALID_CONFIRMATIONS_TIMEOUT_IN_SECONDS", "ConfirmationsTimeoutInSeconds amount is invalid, must be numerical and > 0", ) ErrInvalidMode = errors.Validation.NewWithKeyAndDetail("ERR_INVALID_MODE", "Mode not supported") ErrUnprofitable = errors.Validation.NewWithKeyAndDetail("ERR_UNPROFITABLE", "Transaction is unprofitable to process") )
var ( EventNameMessageSent = "MessageSent" EventNameMessageStatusChanged = "MessageStatusChanged" EventNameMessageProcessed = "MessageProcessed" EventNameChainDataSynced = "ChainDataSynced" )
var ( BlocksScanned = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_scanned_ops_total", Help: "The total number of blocks scanned", }) QueueMessageAcknowledged = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_message_acknowledged_ops_total", Help: "The total number of acknowledged queue events", }) QueueMessageNegativelyAcknowledged = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_message_negatively_acknowledged_ops_total", Help: "The total number of negatively acknowledged queue events", }) QueueChannelNotifyClosed = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_channel_notify_closed_ops_total", Help: "The total number of times a queue channel was notified as closed", }) QueueConnectionNotifyClosed = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_connection_notify_closed_ops_total", Help: "The total number of times a queue connection was notified as closed", }) QueueMessagePublished = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_message_published_ops_total", Help: "The total number of times a queue message was published", }) QueueMessagePublishedErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_message_published_errors_ops_total", Help: "The total number of times a queue message was published with an error", }) QueueConnectionInstantiated = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_connection_instantiated_ops_total", Help: "The total number of times a queue connection was instantiated", }) QueueConnectionInstantiatedErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "queue_connection_instantiated_errors_ops_total", Help: "The total number of times a queue connection was instantiated with an error", }) ChainDataSyncedEventsIndexed = promauto.NewCounter(prometheus.CounterOpts{ Name: "chain_data_synced_events_indexed_ops_total", Help: "The total number of ChainDataSynced indexed events", }) MessageSentEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_processed_ops_total", Help: "The total number of MessageSent processed events", }) MessageSentEventsProcessedReverted = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_processed_reverted_ops_total", Help: "The total number of MessageSent processed events that reverted", }) MessageSentEventsIndexed = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_indexed_ops_total", Help: "The total number of MessageSent indexed events", }) MessageSentEventsIndexingErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_indexing_errors_ops_total", Help: "The total number of errors indexing MessageSent events", }) MessageSentEventsRetries = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_retries_ops_total", Help: "The total number of MessageSent events retries", }) MessageSentEventsMaxRetriesReached = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_max_retries_reached_ops_total", Help: "The total number of MessageSent events that reached max retries", }) MessageProcessedEventsIndexingErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_processed_events_indexing_errors_ops_total", Help: "The total number of errors indexing MessageProcessed events", }) MessageStatusChangedEventsIndexed = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_status_changed_events_indexed_ops_total", Help: "The total number of MessageStatusChanged indexed events", }) MessageStatusChangedEventsIndexingErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_status_changed_events_indexing_errors_ops_total", Help: "The total number of errors indexing MessageStatusChanged events", }) ChainDataSyncedEventsIndexingErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "chain_data_synced_events_indexing_errors_ops_total", Help: "The total number of errors indexing ChainDataSynced events", }) UnprofitableMessagesDetected = promauto.NewCounter(prometheus.CounterOpts{ Name: "unprofitable_messages_detected", Help: "The total number of messages deemed unprofitable", }) BlocksProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_processed_ops_total", Help: "The total number of processed blocks", }) BridgeMessageNotSent = promauto.NewCounter(prometheus.CounterOpts{ Name: "bridge_message_not_sent_opt_total", Help: "The total number of times a bridge message has not been sent but has been processed", }) BridgePaused = promauto.NewCounter(prometheus.CounterOpts{ Name: "bridge_paused_ops_total", Help: "The total number of times the bridge has been paused", }) BridgePausedErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "bridge_paused_errors_ops_total", Help: "The total number of times the bridge has encountered an error while attempting to have been paused", }) RetriableEvents = promauto.NewCounter(prometheus.CounterOpts{ Name: "events_processed_retriable_status_ops_total", Help: "The total number of processed events that ended up in Retriable status", }) DoneEvents = promauto.NewCounter(prometheus.CounterOpts{ Name: "events_processed_done_status_ops_total", Help: "The total number of processed events that ended up in Done status", }) ErrorEvents = promauto.NewCounter(prometheus.CounterOpts{ Name: "events_processed_error_ops_total", Help: "The total number of processed events that failed due to an error", }) MessagesNotReceivedOnDestChain = promauto.NewCounter(prometheus.CounterOpts{ Name: "messages_not_received_on_dest_chain_opts_total", Help: "The total number of messages that were not received on the destination chain", }) ProfitableMessageAfterTransacting = promauto.NewCounter(prometheus.CounterOpts{ Name: "profitable_message_after_transacting_ops_total", Help: "The total number of processed events that ended up profitable", }) UnprofitableMessageAfterTransacting = promauto.NewCounter(prometheus.CounterOpts{ Name: "unprofitable_message_after_transacting_ops_total", Help: "The total number of processed events that ended up unprofitable", }) MessageSentEventsAfterRetryErrorCount = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_sent_events_after_retry_error_count", Help: "The total number of errors logged for MessageSent events after retries", }) MessageStatusChangedEventsAfterRetryErrorCount = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_status_changed_events_after_retry_error_count", Help: "The total number of errors logged for MessageStatusChanged events after retries", }) ChainDataSyncedEventsAfterRetryErrorCount = promauto.NewCounter(prometheus.CounterOpts{ Name: "chain_data_synced_events_after_retry_error_count", Help: "The total number of errors logged for ChainDataSynced events after retries", }) MessageProcessedEventsAfterRetryErrorCount = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_processed_events_after_retry_error_count", Help: "The total number of errors logged for MessageProcessed events after retries", }) RelayerKeyBalanceGauge = promauto.NewGauge(prometheus.GaugeOpts{ Name: "relayer_key_balance", Help: "Current balance of the relayer key", }) )
var ( ZeroHash = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000") ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") )
Functions ¶
func DecodeMessageData ¶
func DecodeMessageData(eventData []byte, value *big.Int) (EventType, CanonicalToken, *big.Int, error)
DecodeMessageData tries to tell if it's an ETH, ERC20, ERC721, or ERC1155 bridge, which lets the processor look up whether the contract has already been deployed or not, to help better estimate gas needed for processing the message.
func DecodeRevertReason ¶
DecodeRevertReason decodes a hex-encoded revert reason from an Ethereum transaction.
Types ¶
type Bridge ¶
type Bridge interface { IsMessageSent(opts *bind.CallOpts, _message bridge.IBridgeMessage) (bool, error) FilterMessageSent(opts *bind.FilterOpts, msgHash [][32]byte) (*bridge.BridgeMessageSentIterator, error) FilterMessageProcessed(opts *bind.FilterOpts, msgHash [][32]byte) (*bridge.BridgeMessageProcessedIterator, error) MessageStatus(opts *bind.CallOpts, msgHash [32]byte) (uint8, error) ProcessMessage(opts *bind.TransactOpts, _message bridge.IBridgeMessage, _proof []byte) (*types.Transaction, error) FilterMessageStatusChanged( opts *bind.FilterOpts, msgHash [][32]byte, ) (*bridge.BridgeMessageStatusChangedIterator, error) ParseMessageSent(log types.Log) (*bridge.BridgeMessageSent, error) IsMessageReceived(opts *bind.CallOpts, _message bridge.IBridgeMessage, _proof []byte) (bool, error) SendMessage(opts *bind.TransactOpts, _message bridge.IBridgeMessage) (*types.Transaction, error) Paused(opts *bind.CallOpts) (bool, error) }
type CanonicalERC20 ¶
type CanonicalERC20 struct { // nolint ChainId uint64 `json:"chainId"` Addr common.Address `json:"addr"` Decimals uint8 `json:"decimals"` Symbol string `json:"symbol"` Name string `json:"name"` }
func (CanonicalERC20) Address ¶
func (c CanonicalERC20) Address() common.Address
func (CanonicalERC20) ChainID ¶
func (c CanonicalERC20) ChainID() uint64
func (CanonicalERC20) ContractName ¶
func (c CanonicalERC20) ContractName() string
func (CanonicalERC20) ContractSymbol ¶
func (c CanonicalERC20) ContractSymbol() string
func (CanonicalERC20) TokenDecimals ¶
func (c CanonicalERC20) TokenDecimals() uint8
type CanonicalNFT ¶
type CanonicalNFT struct { // nolint ChainId uint64 `json:"chainId"` Addr common.Address `json:"addr"` Symbol string `json:"symbol"` Name string `json:"name"` }
func (CanonicalNFT) Address ¶
func (c CanonicalNFT) Address() common.Address
func (CanonicalNFT) ChainID ¶
func (c CanonicalNFT) ChainID() uint64
func (CanonicalNFT) ContractName ¶
func (c CanonicalNFT) ContractName() string
func (CanonicalNFT) ContractSymbol ¶
func (c CanonicalNFT) ContractSymbol() string
func (CanonicalNFT) TokenDecimals ¶
func (c CanonicalNFT) TokenDecimals() uint8
type CanonicalToken ¶
type Event ¶
type Event struct { ID int `json:"id"` Name string `json:"name"` Data datatypes.JSON `json:"data"` Status EventStatus `json:"status"` EventType EventType `json:"eventType"` ChainID int64 `json:"chainID"` DestChainID int64 `json:"destChainID"` SyncedChainID uint64 `json:"syncedChainID"` EmittedBlockID uint64 `json:"emittedBlockID"` BlockID uint64 `json:"blockID"` SyncedInBlockID uint64 `json:"syncedInBlockID"` SyncData string `json:"syncData"` Kind string `json:"kind"` CanonicalTokenAddress string `json:"canonicalTokenAddress"` CanonicalTokenSymbol string `json:"canonicalTokenSymbol"` CanonicalTokenName string `json:"canonicalTokenName"` CanonicalTokenDecimals uint8 `json:"canonicalTokenDecimals"` Amount string `json:"amount"` MsgHash string `json:"msgHash"` MessageOwner string `json:"messageOwner"` Event string `json:"event"` ClaimedBy string `json:"claimedBy" gorm:"-"` ProcessedTxHash string `json:"processedTxHash" gorm:"-"` Fee *uint64 `json:"fee"` DestChainBaseFee *uint64 `json:"destChainBaseFee"` GasTipCap *uint64 `json:"gasTipCap"` GasLimit *uint64 `json:"gasLimit"` IsProfitable *bool `json:"isProfitable"` EstimatedOnchainFee *uint64 `json:"estimatedOnchainFee"` IsProfitableEvaluatedAt *time.Time `json:"isProfitableEvaluatedAt"` }
Event represents a stored EVM event. The fields will be serialized into the Data field to be unmarshalled into a concrete struct dependant on the name of the event
type EventRepository ¶
type EventRepository interface { Close() error Save(ctx context.Context, opts *SaveEventOpts) (*Event, error) UpdateStatus(ctx context.Context, id int, status EventStatus) error UpdateFeesAndProfitability(ctx context.Context, id int, opts *UpdateFeesAndProfitabilityOpts) error FindAllByAddress( ctx context.Context, req *http.Request, opts FindAllByAddressOpts, ) (*paginate.Page, error) FirstByMsgHash( ctx context.Context, msgHash string, ) (*Event, error) FirstByEventAndMsgHash( ctx context.Context, event string, msgHash string, ) (*Event, error) Delete(ctx context.Context, id int) error ChainDataSyncedEventByBlockNumberOrGreater( ctx context.Context, srcChainId uint64, syncedChainId uint64, blockNumber uint64, ) (*Event, error) LatestChainDataSyncedEvent( ctx context.Context, srcChainId uint64, syncedChainId uint64, ) (uint64, error) DeleteAllAfterBlockID(blockID uint64, srcChainID uint64, destChainID uint64) error FindLatestBlockID( ctx context.Context, event string, srcChainID uint64, destChainID uint64, ) (uint64, error) }
EventRepository is used to interact with events in the store
type EventStatus ¶
type EventStatus int
EventStatus is used to indicate whether processing has been attempted for this particular event, and it's success
const ( EventStatusNew EventStatus = iota EventStatusRetriable EventStatusDone EventStatusFailed EventStatusRecalled )
func (EventStatus) String ¶
func (e EventStatus) String() string
String returns string representation of an event status for logging
type FindAllByAddressOpts ¶
type QuotaManager ¶
type SaveEventOpts ¶
type SaveEventOpts struct { Name string Data string ChainID *big.Int DestChainID *big.Int Status EventStatus EventType EventType CanonicalTokenAddress string CanonicalTokenSymbol string CanonicalTokenName string CanonicalTokenDecimals uint8 Amount string MsgHash string MessageOwner string Event string SyncedChainID uint64 BlockID uint64 EmittedBlockID uint64 SyncData string Kind string SyncedInBlockID uint64 }
SaveEventOpts
type SignalService ¶
type SignalService interface { GetSignalSlot(opts *bind.CallOpts, _chainId uint64, _app common.Address, _signal [32]byte) ([32]byte, error) FilterChainDataSynced( opts *bind.FilterOpts, chainid []uint64, blockId []uint64, kind [][32]byte, ) (*signalservice.SignalServiceChainDataSyncedIterator, error) GetSyncedChainData(opts *bind.CallOpts, _chainId uint64, _kind [32]byte, _blockId uint64) (struct { BlockId uint64 ChainData [32]byte }, error) }
type TokenVault ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
bindings
|
|
Package docs Code generated by swaggo/swag.
|
Package docs Code generated by swaggo/swag. |
pkg
|
|