Documentation ¶
Index ¶
- Variables
- func DecodeMessageData(eventData []byte, value *big.Int) (EventType, CanonicalToken, *big.Int, error)
- func DecodeRevertReason(hexStr string) (string, error)
- func IsInSlice[T comparable](v T, s []T) bool
- 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 DB
- type DBConnectionOpts
- type Event
- type EventRepository
- type EventStatus
- type EventType
- type FindAllByAddressOpts
- type SaveEventOpts
- type SignalService
- type SuspendTransactionOpts
- type SuspendedTransaction
- type SuspendedTransactionRepository
- type TokenVault
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") ErrNotReceived = errors.BadRequest.NewWithKeyAndDetail( "ERR_NOT_RECEIVED", "Message not received on destination chain", ) )
var ( EventNameMessageSent = "MessageSent" EventNameMessageStatusChanged = "MessageStatusChanged" EventNameMessageReceived = "MessageReceived" EventNameChainDataSynced = "ChainDataSynced" )
var ( 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", }) 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", }) MessageReceivedEventsIndexingErrors = promauto.NewCounter(prometheus.CounterOpts{ Name: "message_received_events_indexing_errors_ops_total", Help: "The total number of errors indexing MessageReceived 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", }) BlocksProcessed = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_processed_ops_total", Help: "The total number of processed blocks", }) TransactionsSuspended = promauto.NewCounter(prometheus.CounterOpts{ Name: "transactions_suspended_ops_total", Help: "The total number of suspended transactions", }) BlocksScanned = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_scanned_ops_total", Help: "The total number of scanned blocks. Acts as heartbeat metric.", }) BlocksScannedError = promauto.NewCounter(prometheus.CounterOpts{ Name: "blocks_scanned_error_ops_total", Help: "The total number of scanned block errors.", }) 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", }) ErrorsEncounteredDuringSubscription = promauto.NewCounter(prometheus.CounterOpts{ Name: "errors_encountered_during_subscription_opts_total", Help: "The total number of errors that occurred during active subscription", }) )
var ( ZeroHash = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000") ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") )
var (
ErrNoDB = errors.Validation.NewWithKeyAndDetail("ERR_NO_DB", "DB is required")
)
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.
func IsInSlice ¶
func IsInSlice[T comparable](v T, s []T) bool
IsInSlice determines whether v is in slice s
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) FilterMessageReceived(opts *bind.FilterOpts, msgHash [][32]byte) (*bridge.BridgeMessageReceivedIterator, error) MessageStatus(opts *bind.CallOpts, msgHash [32]byte) (uint8, error) ProcessMessage(opts *bind.TransactOpts, _message bridge.IBridgeMessage, _proof []byte) (*types.Transaction, error) ProveMessageReceived(opts *bind.CallOpts, _message bridge.IBridgeMessage, _proof []byte) (bool, error) FilterMessageStatusChanged( opts *bind.FilterOpts, msgHash [][32]byte, ) (*bridge.BridgeMessageStatusChangedIterator, error) ParseMessageSent(log types.Log) (*bridge.BridgeMessageSent, error) ProofReceipt(opts *bind.CallOpts, msgHash [32]byte) (struct { ReceivedAt uint64 PreferredExecutor common.Address }, error) GetInvocationDelays(opts *bind.CallOpts) (struct { InvocationDelay *big.Int InvocationExtraDelay *big.Int }, error) SuspendMessages(opts *bind.TransactOpts, _msgHashes [][32]byte, _toSuspend bool) (*types.Transaction, 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 DBConnectionOpts ¶
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"` }
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 { Save(ctx context.Context, opts SaveEventOpts) (*Event, error) UpdateStatus(ctx context.Context, id int, status EventStatus) 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( 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 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 SuspendTransactionOpts ¶
type SuspendedTransaction ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
bindings
|
|
Package docs Code generated by swaggo/swag.
|
Package docs Code generated by swaggo/swag. |
pkg
|
|