bridge

package
v1.4.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricsNamespace string = "op_indexer_bridge"
)

Functions

func L1ProcessFinalizedBridgeEvents

func L1ProcessFinalizedBridgeEvents(log log.Logger, db *database.DB, metrics L1Metricer, l1Contracts config.L1Contracts, fromHeight, toHeight *big.Int) error

L1ProcessFinalizedBridgeEvent will query the database for all the finalization markers for all initiated bridge events. This covers every part of the multi-layered stack:

  1. OptimismPortal (Bedrock prove & finalize steps)
  2. L1CrossDomainMessenger (relayMessage marker)
  3. L1StandardBridge (no-op, since this is simply a wrapper over the L1CrossDomainMessenger)

func L1ProcessInitiatedBridgeEvents

func L1ProcessInitiatedBridgeEvents(log log.Logger, db *database.DB, metrics L1Metricer, l1Contracts config.L1Contracts, fromHeight, toHeight *big.Int) error

L1ProcessInitiatedBridgeEvents will query the database for bridge events that have been initiated between the specified block range. This covers every part of the multi-layered stack:

  1. OptimismPortal
  2. L1CrossDomainMessenger
  3. L1StandardBridge

func L2ProcessFinalizedBridgeEvents

func L2ProcessFinalizedBridgeEvents(log log.Logger, db *database.DB, metrics L2Metricer, l2Contracts config.L2Contracts, fromHeight, toHeight *big.Int) error

L2ProcessFinalizedBridgeEvent will query the database for all the finalization markers for all initiated bridge events. This covers every part of the multi-layered stack:

  1. L2CrossDomainMessenger (relayMessage marker)
  2. L2StandardBridge (no-op, since this is simply a wrapper over the L2CrossDomainMEssenger)

NOTE: Unlike L1, there's no L2ToL1MessagePasser stage since transaction deposits are apart of the block derivation process.

func L2ProcessInitiatedBridgeEvents

func L2ProcessInitiatedBridgeEvents(log log.Logger, db *database.DB, metrics L2Metricer, l2Contracts config.L2Contracts, fromHeight, toHeight *big.Int) error

L2ProcessInitiatedBridgeEvents will query the database for bridge events that have been initiated between the specified block range. This covers every part of the multi-layered stack:

  1. OptimismPortal
  2. L2CrossDomainMessenger
  3. L2StandardBridge

func LegacyL1ProcessFinalizedBridgeEvents

func LegacyL1ProcessFinalizedBridgeEvents(log log.Logger, db *database.DB, metrics L1Metricer, l1Contracts config.L1Contracts, fromHeight, toHeight *big.Int) error

LegacyL1ProcessFinalizedBridgeEvents will query for bridge events within the specified block range according to the pre-bedrock protocol. This follows:

  1. L1CrossDomainMessenger
  2. L1StandardBridge

func LegacyL1ProcessInitiatedBridgeEvents

func LegacyL1ProcessInitiatedBridgeEvents(log log.Logger, db *database.DB, metrics L1Metricer, l1Contracts config.L1Contracts, fromHeight, toHeight *big.Int) error

LegacyL1ProcessInitiatedEvents will query the data for bridge events within the specified block range according the pre-bedrock protocol. This follows:

  1. CanonicalTransactionChain
  2. L1CrossDomainMessenger
  3. L1StandardBridge

func LegacyL2ProcessFinalizedBridgeEvents

func LegacyL2ProcessFinalizedBridgeEvents(log log.Logger, db *database.DB, metrics L2Metricer, l2Contracts config.L2Contracts, fromHeight, toHeight *big.Int) error

LegacyL2ProcessFinalizedBridgeEvents will query for bridge events within the specified block range according to the pre-bedrock protocol. This follows:

  1. L2CrossDomainMessenger
  2. L2StandardBridge

func LegacyL2ProcessInitiatedBridgeEvents

func LegacyL2ProcessInitiatedBridgeEvents(log log.Logger, db *database.DB, metrics L2Metricer, preset int, l2Contracts config.L2Contracts, fromHeight, toHeight *big.Int) error

LegacyL2ProcessInitiatedEvents will query the data for bridge events within the specified block range according the pre-bedrock protocol. This follows:

  1. L2CrossDomainMessenger - The LegacyMessagePasser contract cannot be used as entrypoint to bridge transactions from L2. The protocol only allows the L2CrossDomainMessenger as the sole sender when relaying a bridged message.
  2. L2StandardBridge

Types

type L1Metricer added in v1.2.0

type L1Metricer interface {
	RecordL1Interval() (done func(err error))
	RecordL1LatestHeight(height *big.Int)
	RecordL1LatestFinalizedHeight(height *big.Int)

	RecordL1TransactionDeposits(size int, mintedETH float64)
	RecordL1ProvenWithdrawals(size int)
	RecordL1FinalizedWithdrawals(size int)

	RecordL1CrossDomainSentMessages(size int)
	RecordL1CrossDomainRelayedMessages(size int)

	RecordL1SkippedOVM1ProvenWithdrawals(size int)
	RecordL1SkippedOVM1FinalizedWithdrawals(size int)
	RecordL1SkippedOVM1CrossDomainRelayedMessages(size int)

	RecordL1InitiatedBridgeTransfers(token common.Address, size int)
	RecordL1FinalizedBridgeTransfers(token common.Address, size int)
}

type L2Metricer added in v1.2.0

type L2Metricer interface {
	RecordL2Interval() (done func(err error))
	RecordL2LatestHeight(height *big.Int)
	RecordL2LatestFinalizedHeight(height *big.Int)

	RecordL2TransactionWithdrawals(size int, withdrawnETH float64)

	RecordL2CrossDomainSentMessages(size int)
	RecordL2CrossDomainRelayedMessages(size int)

	RecordL2InitiatedBridgeTransfers(token common.Address, size int)
	RecordL2FinalizedBridgeTransfers(token common.Address, size int)
}

type Metricer added in v1.2.0

type Metricer interface {
	L1Metricer
	L2Metricer
}

func NewMetrics added in v1.2.0

func NewMetrics(registry *prometheus.Registry) Metricer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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