fix(cre): wire ChainWrite.TargetsLimit to non-EVM WriteReport capabilities - #23257
fix(cre): wire ChainWrite.TargetsLimit to non-EVM WriteReport capabilities#23257cawthorne wants to merge 1 commit into
Conversation
|
👋 cawthorne, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
✅ No conflicts with other open PRs targeting |
|
I see you updated files related to
|
|
050ba19 to
4d694a8
Compare
|
This breaks the Stellar ReadContract test: c.c. @yashnevatia @ilija42 |
Added a new TOML for this test which bumps the CallLimit. May not be the leanest approach, open to feedback @yashnevatia @ilija42 |
ilija42
left a comment
There was a problem hiding this comment.
Why not just set the limit in the existing toml config?
Happy to. I was just unsure if the existing one should be left alone. Will do that now. |
Done. |
The callLimiters map in capability_executor.go only wired EVM
capability methods to the ChainReadCalls and ChainWriteTargets limiters.
Aptos, Solana, and Stellar read/write calls were silently unthrottled —
the limiter lookup returned ok=false and the call proceeded unchecked,
regardless of the ChainRead.CallLimit or ChainWrite.TargetsLimit settings.
The settings schema (chainlink-common cresettings) already defines
these limits as chain-family-agnostic per-workflow limits. The wiring
just never connected them to non-EVM capability methods.
Read methods added:
aptos: View
solana: GetAccountInfoWithOpts, GetBalance, GetBlock, GetFeeForMessage,
GetMultipleAccountsWithOpts, GetSignatureStatuses, GetSlotHeight,
GetTransaction
stellar: GetLatestLedger, ReadContract
Write methods added:
aptos: WriteReport
solana: WriteReport
stellar: WriteReport
All map to the same limiter objects already used for EVM
(limiters.ChainReadCalls / limiters.ChainWriteTargets).
Discovered while debugging fire-drill transmit_fault scenarios in
chainlink-data-feeds: we investigated whether ChainWrite.TargetsLimit=0
could replace the bad-contract-address fault (hot-reloadable, no
re-register), but found Aptos writes bypassed the limiter entirely.
eebf489 to
04e939a
Compare
|





Summary
ChainWrite.TargetsLimitin CRE settings was silently unthrottled for non-EVM chains. ThecallLimitersmap incapability_executor.goonly wiredChainWriteTargetsto{"evm", "WriteReport"}— Aptos, Solana, and StellarWriteReportcalls bypassed the limiter entirely.The gap
The lookup at
capability_executor.go:101:For an Aptos write,
ParseID("aptos:ChainSelector:4457093679053095497@1.0.0")returnsname="aptos". The map only had{"evm", "WriteReport"}— sook=falseand the call proceeded unchecked.WriteReportexists?callLimiters(before)callLimiters(after)evmaptossolanastellarThe fix
Add new map entries — the limiter object (
limiters.ChainWriteTargets) and settings schema (cresettings.chainWrite.TargetsLimit) already exist and are chain-family-agnostic:{"aptos", "View"}: limiters.ChainReadCalls, {"solana", "GetAccountInfoWithOpts"}: limiters.ChainReadCalls, {"solana", "GetBalance"}: limiters.ChainReadCalls, {"solana", "GetBlock"}: limiters.ChainReadCalls, {"solana", "GetFeeForMessage"}: limiters.ChainReadCalls, {"solana", "GetMultipleAccountsWithOpts"}: limiters.ChainReadCalls, {"solana", "GetSignatureStatuses"}: limiters.ChainReadCalls, {"solana", "GetSlotHeight"}: limiters.ChainReadCalls, {"solana", "GetTransaction"}: limiters.ChainReadCalls, {"stellar", "GetLatestLedger"}: limiters.ChainReadCalls, {"stellar", "ReadContract"}: limiters.ChainReadCalls, {"evm", "WriteReport"}: limiters.ChainWriteTargets, {"aptos", "WriteReport"}: limiters.ChainWriteTargets, {"solana", "WriteReport"}: limiters.ChainWriteTargets, {"stellar", "WriteReport"}: limiters.ChainWriteTargets,Production impact
Any production workflow writing to Aptos/Solana/Stellar has unlimited write targets today, regardless of
ChainWrite.TargetsLimitin the org-level CRE settings. With this fix,TargetsLimit=0correctly blocks all chain writes, not just EVM.How discovered
While debugging fire-drill
transmit_faultscenarios inchainlink-data-feeds. We investigated whetherChainWrite.TargetsLimit=0could replace the bad-contract-address fault (hot-reloadable, no re-register), but found Aptos writes bypassed the limiter — leading to this fix.Test plan
go test ./core/services/workflows/v2/...passes (verified locally)ChainWrite.TargetsLimit = 0on an Aptos-targeted workflow, verify writes are now blocked (previously: writes succeeded)