Documentation
¶
Overview ¶
Package sources implements the driven fact ports of the bridge tracker engine (bridgetracker.BridgeEventSource, GERSource, LERSource, ClaimSource, CertificateSource) over the real backends: the per-network JSON-RPC endpoints and the aggkit bridge service REST API, both resolved per network through the bridgeservicefinder.
Current coverage: L1 -> L2 bridges, plus L2-originated ones (see certificate.go for how CertificateSource matches a bridge to its covering certificate). NotImplementedCertificateSource is kept as the simpler stub for callers that have not wired an agglayer client yet.
Index ¶
- Constants
- type ActivitySource
- func (s *ActivitySource) BridgesFrom(ctx context.Context, fromAddress common.Address, ...) ([]*domain.ScannedBridge, []string, []domain.ActivityWarning, error)
- func (s *ActivitySource) ClaimInfo(ctx context.Context, bridge *domain.ScannedBridge) (*bridgeservicetypes.ClaimResponse, error)
- func (s *ActivitySource) IsClaimed(ctx context.Context, bridge *domain.ScannedBridge) (bool, error)
- func (s *ActivitySource) IsReadyToClaim(ctx context.Context, bridge *domain.ScannedBridge) (bool, error)
- type BridgeEventSource
- type CertificateHeaderClient
- type CertificateSource
- func (s *CertificateSource) CertificateFor(ctx context.Context, bridge *bridgetracker.BridgeInfo) (*trackertypes.CertificateInclusionData, error)
- func (s *CertificateSource) Covers(ctx context.Context, bridge *bridgetracker.BridgeInfo, ler common.Hash) (bool, error)
- func (s *CertificateSource) EarliestSettlementTxCovering(ctx context.Context, bridge *bridgetracker.BridgeInfo, fromBlock uint64, ...) (*common.Hash, *trackertypes.SettlementSearchProgress, error)
- type ClaimChecker
- type ClaimSource
- type EthClientResolver
- type FinderClients
- type GERSource
- func (s *GERSource) FindFirstL1InfoTreeAfterBlock(ctx context.Context, blockNumber uint64, logIndex uint32) (*domain.ResultFindFirstL1InfoTreeAfterBlock, error)
- func (s *GERSource) InjectedGER(ctx context.Context, bridge *bridgetracker.BridgeInfo) (*trackertypes.GERData, error)
- func (s *GERSource) InjectedGERAtIndex(ctx context.Context, bridge *bridgetracker.BridgeInfo, leafIndex uint32) (*trackertypes.GERData, error)
- func (s *GERSource) L1InfoTreeIndexForBridge(ctx context.Context, bridge *bridgetracker.BridgeInfo) (*uint32, error)
- func (s *GERSource) L1InfoTreeIndexForGER(ctx context.Context, bridge *bridgetracker.BridgeInfo, ger common.Hash) (*uint32, error)
- func (s *GERSource) OriginGER(ctx context.Context, bridge *bridgetracker.BridgeInfo) (*trackertypes.GERData, error)
- type LERSource
- type NetworkLister
- type NetworkURLResolver
- type NotImplementedCertificateSource
- type SettlementSource
- type StaticClients
Constants ¶
const MainnetNetworkID = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivitySource ¶
type ActivitySource struct {
// contains filtered or unexported fields
}
ActivitySource implements bridgetracker.ActivityBridgeScanner and ActivityClaimChecker: it scans every network the finder currently knows about for bridges sent by a given address (via each network's own bridge service, plus an optional RPC-based fallback for bridges that service has not indexed yet — see rpc, agglayer/aggkit#1837), and resolves a bridge's claim state on its destination network — isClaimed() on the destination bridge contract as the source of truth, then the destination bridge service's own claim record once claimed.
func NewActivitySource ¶
func NewActivitySource( finder NetworkLister, ethClients EthClientResolver, logger aggkitcommon.Logger, bridgeServiceCfg bridgetracker.ActivitySourceBridgeServiceConfig, rpcCfg bridgetracker.ActivitySourceRPCConfig, ) (*ActivitySource, error)
NewActivitySource returns an ActivitySource resolving bridge services, JSON-RPC clients and destination bridge contract addresses through finder/ethClients (see bridgeservicefinder.Finder.BridgeAddress for how a destination network's contract address is resolved and overridden). bridgeServiceCfg/rpcCfg configure the two ActivityBridgeScanner sources BridgesFrom queries in parallel — the existing bridge-service-backed one and the RPC-based fallback (see bridgetracker.Config.ActivitySourceBridgeService/ActivitySourceRPC); rpcCfg.Enabled false disables the RPC-based fallback entirely, leaving BridgesFrom's behavior unchanged from before it existed.
func (*ActivitySource) BridgesFrom ¶
func (s *ActivitySource) BridgesFrom( ctx context.Context, fromAddress common.Address, known map[string]domain.KnownBridge, ) ([]*domain.ScannedBridge, []string, []domain.ActivityWarning, error)
BridgesFrom implements bridgetracker.ActivityBridgeScanner: it scans every network the finder currently knows about concurrently — up to maxConcurrentNetworkScans of them at once (see bridgetracker.ActivitySourceBridgeServiceConfig.MaxConcurrentNetworkScans), so however many networks the finder reports, the number of networks in flight together — and so the number of simultaneous outbound calls scanNetwork itself fans out to below — stays bounded. Each network runs scanNetwork, which queries that network's own bridge service GET /bridge/v1/bridges filtered by from_address (paging until either a short page or an already-known bridge is reached — see fetchNewBridgesFrom, this relies on the bridge service reporting bridges newest-first) concurrently with the RPC-based fallback scan (see rpc, agglayer/aggkit#1837) over a small, recent block window on that network's own bridge contract — a safety net for a bridge that bridge service has not indexed yet. Once every network's scan has returned, results are merged sequentially (fast, in-memory only — no further I/O) in a second pass, in the same order s.finder.NetworkIDs() returned them, so the outcome does not depend on which network happened to answer first. The two results are merged per network:
- the bridge service failing entirely falls back to the RPC result alone (if the fallback is enabled and it itself succeeded), with a warning that historical activity may not be available for that network;
- the bridge service succeeding keeps its own result, plus whatever bridge the RPC fallback found that is new, or that it already knew about but at a different on-chain location than cached (see appendChangedBridges, domain.KnownBridge) — the latter reconciles a bridge a reorg has since moved to a different block/tx, since this fallback's own recent RPC scan is not itself reorg-protected the way the bridge service's indexed data is. A warning is added only when doing so and networkID's own bridge service is not fully caught up with its network (see isNetworkSynced) — a fully synced bridge service silently absorbs whatever the RPC fallback added or corrected, since that would then be expected (recent or reorg-affected) rather than a sign the bridge service itself is behind;
- the RPC fallback failing, finding nothing new or changed, or being disabled entirely never changes or degrades the bridge-service result.
Independent of the above, whenever the RPC fallback itself succeeds, any bridge it previously reported (Source == domain.ActivitySourceRPC in known) whose BlockNum is still within the window just scanned but that no longer shows up there at all is reported back via invalidated (see invalidatedBridges) — the caller must forget it rather than keep trusting stale data a reorg has since invalidated.
A network whose bridge service cannot be reached at all, and whose RPC fallback cannot help either, is skipped and reported back as a domain.ActivityWarning instead of failing the whole scan, so one misbehaving network never hides every other network's activity.
func (*ActivitySource) ClaimInfo ¶
func (s *ActivitySource) ClaimInfo( ctx context.Context, bridge *domain.ScannedBridge, ) (*bridgeservicetypes.ClaimResponse, error)
ClaimInfo implements bridgetracker.ActivityClaimChecker: it asks bridge's destination network's bridge service for the claim record matching bridge's global index
func (*ActivitySource) IsClaimed ¶
func (s *ActivitySource) IsClaimed(ctx context.Context, bridge *domain.ScannedBridge) (bool, error)
IsClaimed implements bridgetracker.ActivityClaimChecker: it calls isClaimed() on bridge's destination bridge contract. The on-chain sourceBridgeNetwork argument is bridge.NetworkID — the network the bridge-creating tx was actually sent to — never bridge.Bridge.OriginNetwork, which can differ for a re-bridged asset (see domain.ScannedBridge)
func (*ActivitySource) IsReadyToClaim ¶
func (s *ActivitySource) IsReadyToClaim(ctx context.Context, bridge *domain.ScannedBridge) (bool, error)
IsReadyToClaim implements bridgetracker.ActivityClaimChecker: it resolves the L1 info tree leaf covering bridge's own origin deposit (GET /bridge/v1/l1-info-tree-index, queried per bridgeServiceClients.l1InfoTreeIndexClientFor's routing rule — the same one GERSource.L1InfoTreeIndexForBridge uses to build the claim proof), then whether that leaf has already been injected on the destination (GET /bridge/v1/injected-l1-info-leaf, always asked of the destination's own instance). Both must resolve for the bridge to be ready to claim; either one still pending (a 404) reports false, not an error
type BridgeEventSource ¶
type BridgeEventSource struct {
// contains filtered or unexported fields
}
BridgeEventSource implements bridgetracker.BridgeEventSource over the origin network's JSON-RPC endpoint: it fetches the tx receipt and parses the BridgeEvent log
func NewBridgeEventSource ¶
func NewBridgeEventSource( clients EthClientResolver, l1Finality, l2Finality aggkittypes.BlockNumberFinality, bridgeAddrs map[uint32]common.Address, resolver bridgeAddressResolver, ) (*BridgeEventSource, error)
NewBridgeEventSource returns a BridgeEventSource resolving per-network JSON-RPC clients through the given resolver, accepting a tx's receipt only once it reaches l1Finality (for network 0) or l2Finality (for any other network). bridgeAddrs is the static networkID -> canonical bridge contract address override used to reject a BridgeEvent log emitted by an unrelated or malicious contract; a network absent from it falls back to resolver, which is required (fail closed — there is no permissive fallback if neither knows the network's bridge address).
func (*BridgeEventSource) FindBridge ¶
func (s *BridgeEventSource) FindBridge( ctx context.Context, id bridgetracker.TrackingID, ) (*bridgetracker.BridgeInfo, error)
FindBridge implements bridgetracker.BridgeEventSource: it resolves the receipt of the tx on its origin network and extracts the BridgeEvent facts. A missing tx, or one whose receipt has not reached finality yet, is ErrBridgeTxNotFound (the engine retries — the tx may simply not be mined, or not final, yet); a reverted tx or a mined receipt without BridgeEvent logs are both ErrBridgeTxNotABridge, since neither can ever change on retry (the engine fails the bridge immediately for those). Finality is checked before either of those outcomes is decided: a reverted or eventless receipt can be reorged away just as much as a successful one, and a resolved bridge is never re-checked afterward (see TrackingBridgeTx.IsDone), so accepting any outcome from a non-final receipt could leave the tracker permanently wrong
type CertificateHeaderClient ¶
type CertificateHeaderClient interface {
GetCertificateHeader(ctx context.Context, certificateID common.Hash) (*agglayertypes.CertificateHeader, error)
GetLatestSettledCertificateHeader(ctx context.Context, networkID uint32) (*agglayertypes.CertificateHeader, error)
GetLatestPendingCertificateHeader(ctx context.Context, networkID uint32) (*agglayertypes.CertificateHeader, error)
}
CertificateHeaderClient is the slice of the agglayer client CertificateSource needs: the latest settled/pending certificate of a network (certificateIDFor) and a known certificate's current header (status, settlement tx hash — certificateHeaderFor)
type CertificateSource ¶
type CertificateSource struct {
// contains filtered or unexported fields
}
CertificateSource implements bridgetracker.CertificateSource over the agglayer: which certificate covers a bridge (certificateIDFor), and that certificate's current status (certificateHeaderFor)
func NewCertificateSource ¶
func NewCertificateSource( client CertificateHeaderClient, finder NetworkURLResolver, clients EthClientResolver, rollupManagerAddress common.Address, logger aggkitcommon.Logger, ) *CertificateSource
NewCertificateSource returns a CertificateSource fetching certificate headers through client, resolving local exit root positions and settlement history through the per-network bridge service clients finder resolves, and locating settlement txs/logs on L1 (rollupManagerAddress) through clients
func (*CertificateSource) CertificateFor ¶
func (s *CertificateSource) CertificateFor( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*trackertypes.CertificateInclusionData, error)
CertificateFor implements bridgetracker.CertificateSource: it resolves the certificate that covers bridge (see certificateIDFor) and returns its current header, so domain.CertificatePendingResolver can tell when it reaches Settled
func (*CertificateSource) Covers ¶
func (s *CertificateSource) Covers( ctx context.Context, bridge *bridgetracker.BridgeInfo, ler common.Hash, ) (bool, error)
Covers implements domain.SettlementHistorySource: it reports whether ler (a settled or pending certificate's NewLocalExitRoot) already includes bridge -- the local exit tree is append-only, so this holds once ler's resolved deposit-count position (see rootIndexFor) is at or past bridge.DepositCount.
ler == bridgesynctypes.EmptyLER (the network's default initial LER, before its first-ever certificate) or the raw zero hash short-circuits to false without asking the bridge service at all: that root is never written to the local exit tree's root table (bridgesync's processor special-cases it the same way, see its own sanityCheckLatestLER/handleForwardLETEvent), so rootIndexFor would 404 on every retry and leave the caller stuck forever instead of recognizing the empty tree covers no deposit at all.
Known gap: a network configured with a non-default genesis LER (etherman/config. NetworkConfig.InitialLER, e.g. a migrated rollup with a non-zero initial exit tree -- see aggsender/query.lerDataQuerier.GetInitialLocalExitRoot) has an initial LER that is neither of the two values above, so this short-circuit does not cover it: PreviousLER carrying that network-specific value would still 404 the same way. Closing that gap needs the same per-network initial LER CertificateSource does not currently have plumbed in (finder only resolves bridge-service/RPC URLs, not genesis rollup data)
func (*CertificateSource) EarliestSettlementTxCovering ¶
func (s *CertificateSource) EarliestSettlementTxCovering( ctx context.Context, bridge *bridgetracker.BridgeInfo, fromBlock uint64, resume *trackertypes.SettlementSearchProgress, ) (*common.Hash, *trackertypes.SettlementSearchProgress, error)
EarliestSettlementTxCovering implements domain.SettlementHistorySource (see issue #1817): it finds the tx hash of the earliest L1 settlement whose new local exit root already covers bridge -- the one right after the last settlement that does not cover it yet -- rather than whichever certificate certificateIDFor happens to report as "latest settled that covers" by the time WaitL1SettledGERResolver asks. It prefers bridge.NetworkID's own bridge-service history (GET /bridge/v1/settlements), falling back to reading the same VerifyBatchesTrustedAggregator events straight off L1 -- backwards from fromBlock, the currently-tracked (too-recent) certificate's own settlement block -- when that bridge-service instance predates the endpoint, or the exact entry it finds there carries no recorded tx hash (a settlement synced before that field existed either; see l1infotreesync.VerifyBatches.TxHash)
type ClaimChecker ¶
type ClaimChecker struct {
// contains filtered or unexported fields
}
ClaimChecker implements bridgetracker.ClaimChecker over StepWaitingClaim: whether a bridge has been claimed on its destination network, per isClaimed() on the destination bridge contract — the same on-chain check ActivitySource uses for the activity endpoint, applied here to a resolved bridgetracker.BridgeInfo instead of a domain.ScannedBridge
func NewClaimChecker ¶
func NewClaimChecker(finder NetworkLister, ethClients EthClientResolver) *ClaimChecker
NewClaimChecker returns a ClaimChecker resolving bridge contract addresses/clients through finder/ethClients
func (*ClaimChecker) IsClaimed ¶
func (c *ClaimChecker) IsClaimed(ctx context.Context, bridge *bridgetracker.BridgeInfo) (bool, error)
IsClaimed implements bridgetracker.ClaimChecker: it calls isClaimed() on bridge's destination bridge contract. The on-chain sourceBridgeNetwork argument is bridge.NetworkID — the network the bridge-creating tx was actually sent to
type ClaimSource ¶
type ClaimSource struct {
// contains filtered or unexported fields
}
ClaimSource implements bridgetracker.ClaimSource over the destination network's aggkit bridge service claims API, filtered by the bridge's global index
func NewClaimSource ¶
func NewClaimSource(finder NetworkURLResolver) *ClaimSource
NewClaimSource returns a ClaimSource resolving per-network bridge service clients through the given finder
func (*ClaimSource) ClaimFor ¶
func (s *ClaimSource) ClaimFor( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*trackertypes.ClaimResult, error)
ClaimFor implements bridgetracker.ClaimSource: the bridge is claimed once the destination network's bridge service records a claim with the bridge's global index (derived from its origin network + deposit count)
type EthClientResolver ¶
type EthClientResolver interface {
RPCClientFor(ctx context.Context, networkID uint32) (aggkittypes.BaseEthereumClienter, error)
}
EthClientResolver resolves the JSON-RPC client of a network
type FinderClients ¶
type FinderClients struct {
// contains filtered or unexported fields
}
FinderClients is an EthClientResolver that resolves each network's JSON-RPC endpoint through the bridgeservicefinder and dials (and caches, keyed by URL) one client per endpoint. Overrides pin specific networks to pre-built clients — e.g. {0: the binary's L1 client, which carries its own retry configuration} — and are never asked to the finder.
Unlike StaticClients, a network the finder cannot resolve is a transient failure (no bridgetracker.ErrSourceUnavailable): the finder discovers rollups live, so the engine keeps retrying until the network appears or the bridge exhausts its timeout
func NewFinderClients ¶
func NewFinderClients( logger aggkitcommon.Logger, finder NetworkURLResolver, overrides StaticClients, rpcCfg ethermanconfig.RPCClientConfig, ) *FinderClients
NewFinderClients returns a FinderClients resolving per-network JSON-RPC endpoints through finder, with overrides (may be nil) taking precedence. Every dialed client is built from rpcCfg (mode, retry policy, HashFromJSON...) with its URL replaced by the resolved one
func (*FinderClients) RPCClientFor ¶
func (f *FinderClients) RPCClientFor(ctx context.Context, networkID uint32) (aggkittypes.BaseEthereumClienter, error)
RPCClientFor implements EthClientResolver. URLs are re-resolved on every call (the finder refreshes them from on-chain events); the cache only avoids re-dialing a stable URL
type GERSource ¶
type GERSource struct {
ContractGlobalExitRootAddress common.Address
L1BlockFinality aggkittypes.BlockNumberFinality
// contains filtered or unexported fields
}
GERSource implements bridgetracker.GERSource over the destination network's aggkit bridge service: every aggkit bridge service syncs the L1 info tree, and the destination's one is the instance whose injected GERs matter for the claim
func NewGERSource ¶
func NewGERSource( finder NetworkURLResolver, clients EthClientResolver, contractGlobalExitRootAddress common.Address, l1Finality aggkittypes.BlockNumberFinality, l2GERAddrs map[uint32]common.Address, l2InjectionLookbackBlocks uint64, logger aggkitcommon.Logger, ) *GERSource
NewGERSource returns a GERSource resolving per-network bridge service clients through finder, and the L1 (network 0) JSON-RPC client used by FindFirstL1InfoTreeAfterBlock through clients. contractGlobalExitRootAddress is the L1 GlobalExitRoot contract FindFirstL1InfoTreeAfterBlock reads UpdateL1InfoTree/UpdateL1InfoTreeV2 logs and state from; l1Finality caps its search range. l2GERAddrs is the per-network GlobalExitRootManagerL2 contract address map backing findL2InjectionBlockBackwards (see GERSource.l2GERAddrs); nil/empty simply disables that fallback for every network. l2InjectionLookbackBlocks bounds how far back that same fallback scans (see GERSource.l2InjectionLookbackBlocks); a value <= 0 falls back to bridgetracker.DefaultL2InjectionLookbackBlocks
func (*GERSource) FindFirstL1InfoTreeAfterBlock ¶
func (s *GERSource) FindFirstL1InfoTreeAfterBlock( ctx context.Context, blockNumber uint64, logIndex uint32, ) (*domain.ResultFindFirstL1InfoTreeAfterBlock, error)
FindFirstL1InfoTreeAfterBlock returns the L1 info tree leaf index of the earliest UpdateL1InfoTree/UpdateL1InfoTreeV2 event strictly after (blockNumber, logIndex) — i.e. in blockNumber with a log index greater than logIndex, or in any later block up to L1BlockFinality — or nil if none has reached that finality yet
func (*GERSource) InjectedGER ¶
func (s *GERSource) InjectedGER( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*trackertypes.GERData, error)
InjectedGER implements bridgetracker.GERSource: a covering GER is injected on the destination network once `injected-l1-info-leaf` resolves for the covering leaf index. Returns nil while the covering leaf (or a later one) has not been injected
func (*GERSource) InjectedGERAtIndex ¶
func (s *GERSource) InjectedGERAtIndex( ctx context.Context, bridge *bridgetracker.BridgeInfo, leafIndex uint32, ) (*trackertypes.GERData, error)
InjectedGERAtIndex implements bridgetracker.GERSource: reports whether leafIndex (or a later leaf) has been injected on bridge's destination network. Shared by InjectedGER, which derives leafIndex itself from the origin's deposit count, and by StepWaitL1SettledGER's sibling resolver, which already knows leafIndex from the certificate's settlement
func (*GERSource) L1InfoTreeIndexForBridge ¶
func (s *GERSource) L1InfoTreeIndexForBridge( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*uint32, error)
L1InfoTreeIndexForBridge implements bridgetracker.GERSource: resolves the L1 info tree leaf index covering bridge's own origin deposit, per GET /bridge/v1/l1-info-tree-index queried against the bridge-service instance that will actually build the claim proof for it — the origin network's own instance (see docs/bridge_service.md's L2->L2 flow: this same endpoint, queried on the origin, is what bridge_getProof is later called against there too). See bridgeServiceClients.l1InfoTreeIndexClientFor for the routing rule, and coveringLeafIndex/ OriginGER for the same mainnet special case. Returns nil while the queried instance's own L1 info tree sync has not caught up to this deposit yet
func (*GERSource) L1InfoTreeIndexForGER ¶
func (s *GERSource) L1InfoTreeIndexForGER( ctx context.Context, bridge *bridgetracker.BridgeInfo, ger common.Hash, ) (*uint32, error)
L1InfoTreeIndexForGER implements bridgetracker.GERSource: ger is looked up through the destination network's own bridge service — every aggkit bridge service instance embeds the same L1 info tree sync regardless of which network it otherwise serves, the same assumption OriginGER relies on for its own `network_id=0` lookup. Returns nil while ger has not reached that instance's L1 info tree sync yet
func (*GERSource) OriginGER ¶
func (s *GERSource) OriginGER( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*trackertypes.GERData, error)
OriginGER implements bridgetracker.GERSource. Only called for L1-originated bridges: the bridge is covered by a GER update on L1 once some L1 info tree leaf includes it (`l1-info-tree-index` resolves for its origin network + deposit count). Returns nil while not covered.
Once covered, the leaf itself is fetched with a direct index lookup (`network_id=0`, per REFERENCE_API.md) to populate the resulting GER and the block it was updated in
type LERSource ¶
type LERSource struct {
// contains filtered or unexported fields
}
LERSource implements bridgetracker.LERSource over the origin network's JSON-RPC endpoint. Unlike the Global Exit Root (a separate on-chain structure updated asynchronously from the deposit, see GERSource), the bridge contract's Local Exit Root is recomputed synchronously in the very same transaction as the deposit that feeds it (docs/bridgetracker/README.md's L2->Lx sequence diagrams: "BridgeEvent / LER updated"). So the covering LER is simply the contract's GetRoot() read back at the block the BridgeEvent was emitted in: by the time BridgeEventSource has resolved (and finality-checked) the bridge, its LER is already final too
func NewLERSource ¶
func NewLERSource(clients EthClientResolver, resolver bridgeAddressResolver) (*LERSource, error)
NewLERSource returns a LERSource resolving per-network JSON-RPC clients through clients and the origin network's canonical bridge contract address through resolver. Returns an error if resolver is nil (fail closed — there is no permissive fallback for locating the bridge contract).
func (*LERSource) OriginLER ¶
func (s *LERSource) OriginLER( ctx context.Context, bridge *bridgetracker.BridgeInfo, ) (*trackertypes.LERUpdateResult, error)
OriginLER implements bridgetracker.LERSource. It never actually returns nil (see the type doc): the origin network's local exit tree always covers its own deposit by the time the BridgeEvent exists, so this resolves the bridge contract's canonical address and reads GetRoot() at that exact block — bridge.BlockNumber, the very same block bridge.BlockTimestamp already locates, so the result's own BlockTimestamp costs nothing extra to populate
type NetworkLister ¶
type NetworkLister interface {
NetworkURLResolver
// NetworkIDs returns the networkIDs of every network currently resolved
NetworkIDs() []uint32
// BridgeAddress returns the bridge contract address for networkID (see
// bridgeservicefinder.Finder.BridgeAddress for the resolution/override rules)
BridgeAddress(ctx context.Context, networkID uint32) (common.Address, error)
}
NetworkLister widens NetworkURLResolver with network enumeration and bridge contract address resolution: it is the slice of bridgeservicefinder.Finder ActivitySource needs on top of the per-network URL lookup every other source already uses, so it knows which bridge services to scan for a given address (without a fixed config list) and which contract to check isClaimed() against. bridgeservicefinder.Finder satisfies it.
type NetworkURLResolver ¶
type NetworkURLResolver interface {
GetURL(networkID uint32) (bridgeservicefinder.NetworkURLs, error)
}
NetworkURLResolver is the slice of the bridgeservicefinder.Finder the sources need: the per-network bridge service / JSON-RPC endpoints
type NotImplementedCertificateSource ¶
type NotImplementedCertificateSource struct{}
NotImplementedCertificateSource stubs bridgetracker.CertificateSource until the agglayer adapter lands: every call errors, so L2-originated bridges keep being retried by the engine without ever advancing past the certificate steps
func (NotImplementedCertificateSource) CertificateFor ¶
func (NotImplementedCertificateSource) CertificateFor( _ context.Context, _ *bridgetracker.BridgeInfo, ) (*types.CertificateInclusionData, error)
CertificateFor implements bridgetracker.CertificateSource
type SettlementSource ¶
type SettlementSource struct {
// contains filtered or unexported fields
}
SettlementSource implements bridgetracker.SettlementSource over L1's JSON-RPC endpoint (network 0): it fetches the certificate's settlement tx receipt and looks for the events that confirm the settlement propagated to the L1 Global Exit Root
func NewSettlementSource ¶
func NewSettlementSource( clients EthClientResolver, l1Finality aggkittypes.BlockNumberFinality, contractGlobalExitRootAddress common.Address, ) *SettlementSource
NewSettlementSource returns a SettlementSource resolving the L1 (network 0) JSON-RPC client through clients, accepting a settlement tx's receipt only once it reaches l1Finality. contractGlobalExitRootAddress is the L1 GlobalExitRoot contract findEventUpdateL1InfoTreeBackwards searches when a settlement tx's own receipt does not carry an UpdateL1InfoTree event
func (*SettlementSource) SettlementGERUpdate ¶
func (s *SettlementSource) SettlementGERUpdate( ctx context.Context, _ *bridgetracker.BridgeInfo, settlementTxHash common.Hash, ) (*trackertypes.L1SettledGERResult, error)
SettlementGERUpdate implements bridgetracker.SettlementSource: it fetches settlementTxHash's receipt on L1 and reports which of the three events it carries. Returns nil (not yet ready, retried by the engine) while the tx is not mined, has not reached l1Finality, or its receipt does not yet carry both mandatory events (VerifyBatchesTrustedAggregator and UpdateL1InfoTree — UpdateL1InfoTreeV2 is captured but not required)
type StaticClients ¶
type StaticClients map[uint32]aggkittypes.BaseEthereumClienter
StaticClients is a fixed networkID -> client EthClientResolver (e.g. {0: the proxy's L1 client}). The map never changes at runtime, so a network absent from it resolves to a permanent bridgetracker.ErrSourceUnavailable, not retried by the engine
func (StaticClients) RPCClientFor ¶
func (s StaticClients) RPCClientFor(_ context.Context, networkID uint32) (aggkittypes.BaseEthereumClienter, error)
RPCClientFor implements EthClientResolver