Skip to content

Commit f288b74

Browse files
committed
Update DefaultAccessor GetFeeQuoterTokenUpdates
1 parent 1508d80 commit f288b74

File tree

8 files changed

+768
-1895
lines changed

8 files changed

+768
-1895
lines changed

chains/evm/deployment/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/Masterminds/semver/v3 v3.4.0
1717
github.com/ethereum/go-ethereum v1.16.2
1818
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250320090719-315440f5b0a7
19-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3
19+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76
2020
github.com/smartcontractkit/chainlink-deployments-framework v0.37.1
2121
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3
2222
github.com/smartcontractkit/mcms v0.21.1
@@ -218,8 +218,8 @@ require (
218218
github.com/smartcontractkit/chainlink-aptos v0.0.0-20250414155853-651b4e583ee9 // indirect
219219
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250805210128-7f8a0f403c3a // indirect
220220
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250805210128-7f8a0f403c3a // indirect
221-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 // indirect
222-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1 // indirect
221+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 // indirect
222+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 // indirect
223223
github.com/smartcontractkit/chainlink-protos/job-distributor v0.12.0 // indirect
224224
github.com/smartcontractkit/chainlink-testing-framework/framework v0.10.15 // indirect
225225
github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2 // indirect

chains/evm/deployment/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -664,16 +664,16 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250805210128-7
664664
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250805210128-7f8a0f403c3a/go.mod h1:Ve1xD71bl193YIZQEoJMmBqLGQJdNs29bwbuObwvbhQ=
665665
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250805210128-7f8a0f403c3a h1:38dAlTPRUQHZus5dCnBnQyf/V4oYn0p2svWlbPgHDQ4=
666666
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250805210128-7f8a0f403c3a/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg=
667-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3 h1:dMvSvJ7nRAQViYSjdfj/vRGLULY7mJ3X4UgsPMmXgOI=
668-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3/go.mod h1:1diMLMwfIACeqJFt7ySGaBrJIeUwHTLhVVYlb41EyKk=
669-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 h1:ca2z5OXgnbBPQRxpwXwBLJsUA1+cAp5ncfW4Ssvd6eY=
670-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1/go.mod h1:NZv/qKYGFRnkjOYBouajnDfFoZ+WDa6H2KNmSf1dnKc=
667+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76 h1:Slnws8RoXRUYGgEMYK6X2yYzjZwNgVb93PxU45VEObQ=
668+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76/go.mod h1:1r3aM96KHAESfnayJ3BTHCkP1qJS1BEG1r4czeoaXlA=
669+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 h1:hvqATtrZ0iMRTI80cpBot/3JFbjz2j+2tvpfooVhRHw=
670+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4/go.mod h1:eKGyfTKzr0/PeR7qKN4l2FcW9p+HzyKUwAfGhm/5YZc=
671671
github.com/smartcontractkit/chainlink-deployments-framework v0.37.1 h1:GqqcSz0egZGS6HGk9CnswvONwVAQsP3VWGpLGj8DR7M=
672672
github.com/smartcontractkit/chainlink-deployments-framework v0.37.1/go.mod h1:nvsOomMe/u/T4vekY7sd10HEGDbvadEw6bUMEblPDP0=
673673
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3 h1:SRMNzCdQnF2x6+QlL5YSzVeWyJb/BXqMrg+zSGaBPVg=
674674
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q=
675-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1 h1:HZt/80mhcNw6/MlYBIRracxfHWNqFF0iZ5nZEVZBUgo=
676-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
675+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 h1:1/KdO5AbUr3CmpLjMPuJXPo2wHMbfB8mldKLsg7D4M8=
676+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
677677
github.com/smartcontractkit/chainlink-protos/job-distributor v0.12.0 h1:/bhoALRzNXZkdzxBkNM505pMofNy0K0eW1nCzXw+AUI=
678678
github.com/smartcontractkit/chainlink-protos/job-distributor v0.12.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE=
679679
github.com/smartcontractkit/chainlink-testing-framework/framework v0.10.15 h1:OyX2Z68z6VDY4aadqMXjwSTE/0misA5fk8Iq710nxkk=

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/prometheus/client_golang v1.22.0
1313
github.com/prometheus/client_model v0.6.2
1414
github.com/smartcontractkit/chain-selectors v1.0.67
15-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3
15+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76
1616
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6
1717
github.com/smartcontractkit/libocr v0.0.0-20250707144819-babe0ec4e358
1818
github.com/stretchr/testify v1.10.0
@@ -82,8 +82,8 @@ require (
8282
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
8383
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
8484
github.com/shopspring/decimal v1.4.0 // indirect
85-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 // indirect
86-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1 // indirect
85+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 // indirect
86+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 // indirect
8787
github.com/stephenlacy/go-ethereum-hdwallet v0.0.0-20230913225845-a4fa94429863 // indirect
8888
github.com/stretchr/objx v0.5.2 // indirect
8989
github.com/supranational/blst v0.3.14 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp
263263
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
264264
github.com/smartcontractkit/chain-selectors v1.0.67 h1:gxTqP/JC40KDe3DE1SIsIKSTKTZEPyEU1YufO1admnw=
265265
github.com/smartcontractkit/chain-selectors v1.0.67/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8=
266-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3 h1:dMvSvJ7nRAQViYSjdfj/vRGLULY7mJ3X4UgsPMmXgOI=
267-
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250910201107-cb4c31b624d3/go.mod h1:1diMLMwfIACeqJFt7ySGaBrJIeUwHTLhVVYlb41EyKk=
268-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 h1:ca2z5OXgnbBPQRxpwXwBLJsUA1+cAp5ncfW4Ssvd6eY=
269-
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1/go.mod h1:NZv/qKYGFRnkjOYBouajnDfFoZ+WDa6H2KNmSf1dnKc=
270-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1 h1:HZt/80mhcNw6/MlYBIRracxfHWNqFF0iZ5nZEVZBUgo=
271-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250905211734-167560f092c1/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
266+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76 h1:Slnws8RoXRUYGgEMYK6X2yYzjZwNgVb93PxU45VEObQ=
267+
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76/go.mod h1:1r3aM96KHAESfnayJ3BTHCkP1qJS1BEG1r4czeoaXlA=
268+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 h1:hvqATtrZ0iMRTI80cpBot/3JFbjz2j+2tvpfooVhRHw=
269+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4/go.mod h1:eKGyfTKzr0/PeR7qKN4l2FcW9p+HzyKUwAfGhm/5YZc=
270+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 h1:1/KdO5AbUr3CmpLjMPuJXPo2wHMbfB8mldKLsg7D4M8=
271+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
272272
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 h1:L6KJ4kGv/yNNoCk8affk7Y1vAY0qglPMXC/hevV/IsA=
273273
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6/go.mod h1:FRwzI3hGj4CJclNS733gfcffmqQ62ONCkbGi49s658w=
274274
github.com/smartcontractkit/libocr v0.0.0-20250707144819-babe0ec4e358 h1:+NVzR5LZVazRUunzVn34u+lwnpmn6NTVPCeZOVyQHLo=

mocks/chainlink_common/ccipocr3/chain_accessor.go

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/chainaccessor/default_price_reader.go

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,33 +107,21 @@ func normalizePrice(price *big.Int, decimals uint8) *big.Int {
107107

108108
func (l *DefaultAccessor) GetFeeQuoterTokenUpdates(
109109
ctx context.Context,
110-
tokens []ccipocr3.UnknownEncodedAddress,
111-
chain ccipocr3.ChainSelector,
110+
tokenBytes []ccipocr3.UnknownAddress,
112111
) (map[ccipocr3.UnknownEncodedAddress]ccipocr3.TimestampedUnixBig, error) {
113112
lggr := logutil.WithContextValues(ctx, l.lggr)
114-
byteTokens := make([][]byte, 0, len(tokens))
115-
for _, token := range tokens {
116-
tokenAddressBytes, err := l.addrCodec.AddressStringToBytes(string(token), chain)
117-
if err != nil {
118-
lggr.Warnw("failed to convert token address to bytes", "token", token, "err", err)
119-
continue
120-
}
121-
122-
byteTokens = append(byteTokens, tokenAddressBytes)
123-
}
124-
125113
feeQuoterAddress, err := l.GetContractAddress(consts.ContractNameFeeQuoter)
126114
if err != nil {
127115
return nil, fmt.Errorf("failed to get fee quoter address: %w", err)
128116
}
129117

130-
feeQuoterAddressStr, err := l.addrCodec.AddressBytesToString(feeQuoterAddress[:], chain)
118+
feeQuoterAddressStr, err := l.addrCodec.AddressBytesToString(feeQuoterAddress[:], l.chainSelector)
131119
if err != nil {
132-
lggr.Warnw("failed to convert fee quoter address to string", "chain", chain, "err", err)
120+
lggr.Warnw("failed to convert fee quoter address to string", "chain", l.chainSelector, "err", err)
133121
return make(map[ccipocr3.UnknownEncodedAddress]ccipocr3.TimestampedUnixBig), nil
134122
}
135123

136-
updates := make([]ccipocr3.TimestampedUnixBig, len(tokens))
124+
updates := make([]ccipocr3.TimestampedUnixBig, len(tokenBytes))
137125
boundContract := types.BoundContract{
138126
Address: feeQuoterAddressStr,
139127
Name: consts.ContractNameFeeQuoter,
@@ -147,24 +135,27 @@ func (l *DefaultAccessor) GetFeeQuoterTokenUpdates(
147135
boundContract.ReadIdentifier(consts.MethodNameFeeQuoterGetTokenPrices),
148136
primitives.Unconfirmed,
149137
map[string]any{
150-
"tokens": byteTokens,
138+
"tokens": tokenBytes,
151139
},
152140
&updates,
153141
); err != nil {
154142
return nil, fmt.Errorf("failed to get fee quoter token updates: %w", err)
155143
}
156144

157145
updateMap := make(map[ccipocr3.UnknownEncodedAddress]ccipocr3.TimestampedUnixBig)
158-
for i, token := range tokens {
146+
for i, token := range tokenBytes {
147+
tokenAddressStr, err := l.addrCodec.AddressBytesToString(token[:], l.chainSelector)
148+
if err != nil {
149+
lggr.Errorw("failed to convert token address to string", "token", token, "chain", l.chainSelector, "err", err)
150+
continue
151+
}
152+
159153
// token not available on fee quoter
160154
if updates[i].Timestamp == 0 || updates[i].Value == nil || updates[i].Value.Cmp(big.NewInt(0)) == 0 {
161-
lggr.Debugw("empty fee quoter update found",
162-
"chain", chain,
163-
"token", token,
164-
)
155+
lggr.Debugw("empty fee quoter update found", "chain", l.chainSelector, "token", tokenAddressStr)
165156
continue
166157
}
167-
updateMap[token] = updates[i]
158+
updateMap[ccipocr3.UnknownEncodedAddress(tokenAddressStr)] = updates[i]
168159
}
169160

170161
return updateMap, nil

0 commit comments

Comments
 (0)