@@ -8,19 +8,9 @@ import (
88 "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives"
99)
1010
11- // ChainFeeComponents redeclares the ChainFeeComponents type from the chainlink-common/pkg/types to avoid
12- // a cyclic dependency caused by provider_ccip_ocr3.go importing this package.
13- type ChainFeeComponents struct {
14- // The cost of executing transaction in the chain's EVM (or the L2 environment).
15- ExecutionFee * big.Int
16-
17- // The cost associated with an L2 posting a transaction's data to the L1.
18- DataAvailabilityFee * big.Int
19- }
20-
21- // ChainAccessor for all direct chain access. The accessor is responsible for
22- // in addition to direct access to the chain, this interface also translates
23- // onchain representations of data to the plugin representation.
11+ // ChainAccessor is responsible for direct access to the chain. In addition
12+ // to direct access, this interface also translates onchain representations
13+ // of data to the plugin representation.
2414type ChainAccessor interface {
2515 AllAccessors
2616 SourceAccessor
@@ -29,12 +19,10 @@ type ChainAccessor interface {
2919 PriceReader
3020}
3121
32- // AllAccessors contains functionality that is available to all types of accessors.
22+ // AllAccessors contains functionality that is available to all types of accessors (source and dest) .
3323type AllAccessors interface {
34- // GetContractAddress returns the contract address that is registered for the provided contract name and chain.
35- // WARNING: This function will fail if the oracle does not support the requested chain.
36- //
37- // TODO(NONEVM-1865): do we want to mark this as deprecated in favor of Metadata()?
24+ // GetContractAddress returns the contract address that is registered for the provided contract name
25+ // on the chain associated with the specific accessor implementation.
3826 GetContractAddress (contractName string ) ([]byte , error )
3927
4028 // GetAllConfig is the next iteration of GetAllConfigsLegacy(). Instead of returning a large snapshot
@@ -49,19 +37,18 @@ type AllAccessors interface {
4937 // GetAllConfigsLegacy returns a snapshot of all chain configurations for this chain using the legacy
5038 // config structs.
5139 //
52- // destChainSelector is used to determine whether or not destination chain specific configs should be fetched.
53- // sourceChainSelectors is used to determine which source chain configs should be fetched.
40+ // When called on a destination chain accessor:
41+ // - destChainSelector should match the accessor's chain
42+ // - sourceChainSelectors determines which source chain configs to fetch from the OffRamp
43+ // - Returns ChainConfigSnapshot with OffRamp, FeeQuoter, RMNProxy, RMNRemote, CurseInfo configs
44+ // - Returns map of SourceChainConfig for each requested source chain
5445 //
55- // This includes the following contracts:
56- // - Router
57- // - OffRamp
58- // - OnRamp
59- // - FeeQuoter
60- // - RMNProxy
61- // - RMNRemote
62- // - CurseInfo
46+ // When called on a source chain accessor:
47+ // - destChainSelector is used to fetch OnRamp dest chain specific configs
48+ // - sourceChainSelectors will likely be empty and/or ignored by the accessor impl
49+ // - Returns ChainConfigSnapshot with OnRamp, FeeQuoter, Router configs
50+ // - Returns empty map for source chain configs
6351 //
64- // Access Type: Method(many, see code)
6552 // Contract: Many
6653 // Confidence: Unconfirmed
6754 GetAllConfigsLegacy (
@@ -70,24 +57,24 @@ type AllAccessors interface {
7057 sourceChainSelectors []ChainSelector ,
7158 ) (ChainConfigSnapshot , map [ChainSelector ]SourceChainConfig , error )
7259
73- // GetChainFeeComponents Returns all fee components for given chains if corresponding
74- // chain writer is available.
60+ // GetChainFeeComponents returns all fee components for the chain.
7561 //
76- // Access Type: ChainWriter
7762 // Contract: N/A
7863 // Confidence: N/A
7964 GetChainFeeComponents (ctx context.Context ) (ChainFeeComponents , error )
8065
81- // Sync can be used to perform frequent syncing operations inside the reader implementation.
82- // Returns an error if the sync operation failed.
66+ // Sync binds a contract to the accessor implementation by contract name and address so the accessor
67+ // can use the contract addresses for subsequent calls. This is used to dynamically discover and bind
68+ // contracts (e.g., OnRamps, FeeQuoter, RMNRemote).
69+ // Returns an error if the bind operation failed.
8370 Sync (ctx context.Context , contractName string , contractAddress UnknownAddress ) error
8471}
8572
86- // DestinationAccessor contains all functions typically associated by the destination chain.
73+ // DestinationAccessor contains all functions typically associated with the destination chain.
8774type DestinationAccessor interface {
8875
8976 // CommitReportsGTETimestamp reads CommitReportAccepted events starting from a given timestamp.
90- // The number of results are limited according to limit.
77+ // The number of results is limited according to the limit parameter .
9178 //
9279 // Access Type: Event(CommitReportAccepted)
9380 // Contract: OffRamp
@@ -113,31 +100,32 @@ type DestinationAccessor interface {
113100 confidence primitives.ConfidenceLevel ,
114101 ) (map [ChainSelector ][]SeqNum , error )
115102
116- // NextSeqNum reads the source chain config to get the next expected
117- // sequence number for the given source chains.
103+ // NextSeqNum reads the source chain config from the OffRamp to get the next expected
104+ // sequence number (MinSeqNr) for the given source chains.
118105 //
119- // Access Type: Method(NextSeqNum )
106+ // Access Type: Method(GetSourceChainConfig )
120107 // Contract: OffRamp
121108 // Confidence: Unconfirmed
122109 NextSeqNum (ctx context.Context , sources []ChainSelector ) (map [ChainSelector ]SeqNum , error )
123110
124- // Nonces for all provided selector/address pairs. Addresses must be encoded
111+ // Nonces returns nonces for all provided selector/address pairs. Addresses must be encoded
125112 // according to the source chain requirements by using the AddressCodec.
126113 //
127114 // Access Type: Method(GetInboundNonce)
128115 // Contract: NonceManager
129116 // Confidence: Unconfirmed
130117 Nonces (ctx context.Context , addresses map [ChainSelector ][]UnknownEncodedAddress ) (map [ChainSelector ]map [string ]uint64 , error )
131118
132- // GetChainFeePriceUpdate Gets latest chain fee price update for the provided chains.
119+ // GetChainFeePriceUpdate returns the latest chain fee price update for the provided selectors. This queries
120+ // the FeeQuoter contract on the chain accociated with this accessor.
133121 //
134122 // Access Type: Method(GetChainFeePriceUpdate)
135123 // Contract: FeeQuoter
136124 // Confidence: Unconfirmed
137125 GetChainFeePriceUpdate (ctx context.Context , selectors []ChainSelector ) (map [ChainSelector ]TimestampedUnixBig , error )
138126
139127 // GetLatestPriceSeqNr returns the latest price sequence number for the destination chain.
140- // Not to confuse with the sequence number of the messages. This is the OCR sequence number.
128+ // Not to be confused with the sequence number of the messages. This is the OCR sequence number.
141129 //
142130 // Access Type: Method(GetLatestPriceSequenceNumber)
143131 // Contract: OffRamp
@@ -164,23 +152,20 @@ type SourceAccessor interface {
164152 LatestMessageTo (ctx context.Context , dest ChainSelector ) (SeqNum , error )
165153
166154 // GetExpectedNextSequenceNumber returns the expected next sequence number
167- // messages being sent to the provided destination.
155+ // for messages being sent to the provided destination.
168156 //
169157 // Access Type: Method(GetExpectedNextSequenceNumber)
170158 // Contract: OnRamp
171159 // Confidence: Unconfirmed
172160 GetExpectedNextSequenceNumber (ctx context.Context , dest ChainSelector ) (SeqNum , error )
173161
174- // GetTokenPriceUSD looks up a token price in USD. The address value should
175- // be retrieved from a configuration cache (i.e. ConfigPoller).
162+ // GetTokenPriceUSD looks up a token price in USD for the provided address.
163+ // Serves as a general price interface for fetching both LINK price and wrapped
164+ // native token price in USD.
176165 //
177166 // Access Type: Method(GetTokenPrice)
178167 // Contract: FeeQuoter
179168 // Confidence: Unconfirmed
180- //
181- // Notes: This function is new and serves as a general price interface for
182- // both LinkPriceUSD and GetWrappedNativeTokenPriceUSD.
183- // See Design Doc (Combined Token Price Helper) for notes.
184169 GetTokenPriceUSD (ctx context.Context , address UnknownAddress ) (TimestampedUnixBig , error )
185170
186171 // GetFeeQuoterDestChainConfig returns the fee quoter destination chain config.
@@ -222,3 +207,13 @@ type PriceReader interface {
222207 tokensBytes []UnknownAddress ,
223208 ) (map [UnknownEncodedAddress ]TimestampedUnixBig , error )
224209}
210+
211+ // ChainFeeComponents redeclares the ChainFeeComponents type from the chainlink-common/pkg/types to avoid
212+ // a cyclic dependency caused by provider_ccip_ocr3.go importing this package.
213+ type ChainFeeComponents struct {
214+ // The cost of executing transaction in the chain's EVM (or the L2 environment).
215+ ExecutionFee * big.Int
216+
217+ // The cost associated with an L2 posting a transaction's data to the L1.
218+ DataAvailabilityFee * big.Int
219+ }
0 commit comments