feat: add chain-agnostic AuthorizedCallers adapter with EVM implementation#2038
Merged
asoliman92 merged 4 commits intoMay 7, 2026
Merged
Conversation
…ation Introduce a registry-backed AuthorizedCallers system mirroring the existing fastcurse pattern: - deployment/authorizedcallers: chain-agnostic interface, registry singleton, and ConfigureAuthorizedCallersChangeset - chains/evm/deployment/v2_1_0/adapters: EVMAuthorizedCallersAdapter backed by injected per-contract generated ops so MCMS metadata (ContractType, ABI) is accurate per target contract - init.go registers (EVM, RMN, v2.1.0); additional contracts follow the same NewEVMAuthorizedCallersAdapter pattern
carte7000
reviewed
May 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a chain-agnostic “AuthorizedCallers” deployment subsystem (registry + changeset) and wires up an EVM implementation for v2.1.0 contracts (starting with RMN), mirroring the existing fastcurse adapter/registry pattern.
Changes:
- Added
deployment/authorizedcallerspackage with adapter interface, singleton registry, andConfigureAuthorizedCallersChangeset. - Added EVM adapter (
EVMAuthorizedCallersAdapter) and v2.1.0 init registration for RMN-backed ops so MCMS metadata is contract-accurate. - Added/updated tests to exercise end-to-end authorized-caller add/remove flow and update EVM chain selector usage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| deployment/authorizedcallers/product.go | Defines adapter interface + singleton registry keyed by (family, contractType, version). |
| deployment/authorizedcallers/common.go | Adds shared types (Caller, CallerUpdate, ApplyInput) for changeset inputs. |
| deployment/authorizedcallers/authorizedcallers.go | Implements the chain-agnostic changeset, including idempotency filtering and batching. |
| chains/evm/deployment/v2_1_0/changesets/configure_rmn_curse_admins_test.go | Updates simulated EVM chain selector used by existing RMN curse admin tests. |
| chains/evm/deployment/v2_1_0/adapters/init.go | Registers the EVM AuthorizedCallers adapter for RMN (v2.1.0) into the global registry. |
| chains/evm/deployment/v2_1_0/adapters/authorizedcallers.go | Adds the EVM implementation of the chain-agnostic AuthorizedCallers adapter. |
| chains/evm/deployment/v2_1_0/adapters/authorizedcallers_test.go | Adds tests covering operator workflow, Force prefiltering, and multi-target validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+40
to
+48
| for _, in := range cfg.Updates { | ||
| family, err := chain_selectors.GetSelectorFamily(in.ChainSelector) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get chain family for selector %d: %w", in.ChainSelector, err) | ||
| } | ||
| if _, ok := reg.GetAdapter(family, in.ContractType, in.Version); !ok { | ||
| return fmt.Errorf("no authorized callers adapter registered for chain family %q, contract type %q, version %s", | ||
| family, in.ContractType, in.Version.String()) | ||
| } |
Comment on lines
+99
to
+101
| if _, exists := grouped[key]; !exists { | ||
| order = append(order, key) | ||
| } |
| // multiple AuthorizedCallers-inheriting contracts may exist for the same | ||
| // chain family and version (e.g. RMN, FeeQuoter, AdvancedPoolHooks). | ||
| func adapterKey(family string, contractType cldf.ContractType, version *semver.Version) string { | ||
| return fmt.Sprintf("%s-%s-%s", family, contractType, version.String()) |
Comment on lines
+91
to
+106
| // Initialize resolves and caches the target contract address from e.DataStore for the given ApplyInput. | ||
| // Called for every changeset invocation; always re-reads the datastore so singleton adapters | ||
| // do not retain an RMN address from a prior Environment (e.g. another test's simulated chain). | ||
| // Must still be invoked before GetAllAuthorizedCallers or ApplyAuthorizedCallerUpdates for a given triple. | ||
| func (a *EVMAuthorizedCallersAdapter) Initialize(e cldf.Environment, in api.ApplyInput) error { | ||
| key := addrCacheKey(in.ChainSelector, in.ContractType, in.Version) | ||
| ref := datastore.AddressRef{ | ||
| Type: datastore.ContractType(in.ContractType), | ||
| Version: in.Version, | ||
| } | ||
| addr, err := datastore_utils.FindAndFormatRef(e.DataStore, ref, in.ChainSelector, evmds.ToEVMAddress) | ||
| if err != nil { | ||
| return fmt.Errorf( | ||
| "failed to resolve %q v%s address on chain %d: %w", | ||
| in.ContractType, in.Version.String(), in.ChainSelector, err) | ||
| } |
carte7000
approved these changes
May 6, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a registry-backed AuthorizedCallers system mirroring the existing fastcurse pattern: