Skip to content

feat: add chain-agnostic AuthorizedCallers adapter with EVM implementation#2038

Merged
asoliman92 merged 4 commits into
asoliman/rmn-curse-adminsfrom
asoliman/authorized-callers-adapter
May 7, 2026
Merged

feat: add chain-agnostic AuthorizedCallers adapter with EVM implementation#2038
asoliman92 merged 4 commits into
asoliman/rmn-curse-adminsfrom
asoliman/authorized-callers-adapter

Conversation

@asoliman92
Copy link
Copy Markdown
Contributor

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

asoliman92 added 2 commits May 6, 2026 15:48
…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
Comment thread chains/evm/deployment/v2_1_0/changesets/configure_rmn_curse_admins_test.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/authorizedcallers package with adapter interface, singleton registry, and ConfigureAuthorizedCallersChangeset.
  • 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)
}
Comment thread deployment/authorizedcallers/product.go Outdated
// 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)
}
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Metric asoliman/authorized-callers-adapter asoliman/rmn-curse-admins
Coverage 70.1% 69.8%

@asoliman92 asoliman92 marked this pull request as ready for review May 7, 2026 09:43
@asoliman92 asoliman92 requested review from a team as code owners May 7, 2026 09:43
@asoliman92 asoliman92 requested review from agusaldasoro, b-gopalswami, makramkd, matYang, ogtownsend, tt-cll and winder and removed request for a team May 7, 2026 09:44
@asoliman92 asoliman92 merged commit 682e043 into asoliman/rmn-curse-admins May 7, 2026
30 of 46 checks passed
@asoliman92 asoliman92 deleted the asoliman/authorized-callers-adapter branch May 7, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants