Skip to content

vault: default qualifier, shared MCMS per chain, migration changeset#21232

Draft
poke1994 wants to merge 1 commit intodevelopfrom
feat/vault-default-qualifier-shared-mcms
Draft

vault: default qualifier, shared MCMS per chain, migration changeset#21232
poke1994 wants to merge 1 commit intodevelopfrom
feat/vault-default-qualifier-shared-mcms

Conversation

@poke1994
Copy link
Collaborator

  • Add DefaultTimelockQualifier ("default") and timelockQualifierFromConfig for first timelock when qualifier omitted; duplicate (chain,qualifier) check.
  • DeployTimelockInput + DeployMCMSWithTimelockV2FromInput with SharedMCMSPerChain: reuse existing MCMS, deploy only RBACTimelock+CallProxy for new qualifier when full set exists in datastore.
  • FindQualifierWithFullMCMSSet + RequiredMCMSContractTypes in state/evm; persist existing Bypasser/Canceller/Proposer to address book in timelock-only path.
  • MigrateAddressRefsToDefaultQualifier changeset for one-off migration of address refs to qualifier "default".
  • Vault: GetContractAddressWithQualifier treats empty qualifier as "default"; batch_native, set_whitelist, transfer_erc20 support timelock_id/qualifier.
  • prod_oev_mainnet unchanged (uses DeployMCMSWithTimelockV2, no qualifier).

Requires

Supports

- Add DefaultTimelockQualifier ("default") and timelockQualifierFromConfig for
  first timelock when qualifier omitted; duplicate (chain,qualifier) check.
- DeployTimelockInput + DeployMCMSWithTimelockV2FromInput with
  SharedMCMSPerChain: reuse existing MCMS, deploy only RBACTimelock+CallProxy
  for new qualifier when full set exists in datastore.
- FindQualifierWithFullMCMSSet + RequiredMCMSContractTypes in state/evm;
  persist existing Bypasser/Canceller/Proposer to address book in timelock-only path.
- MigrateAddressRefsToDefaultQualifier changeset for one-off migration of
  address refs to qualifier "default".
- Vault: GetContractAddressWithQualifier treats empty qualifier as "default";
  batch_native, set_whitelist, transfer_erc20 support timelock_id/qualifier.
- prod_oev_mainnet unchanged (uses DeployMCMSWithTimelockV2, no qualifier).

Co-authored-by: Cursor <cursoragent@cursor.com>
@cl-sonarqube-production
Copy link

@trunk-io
Copy link

trunk-io bot commented Feb 18, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestDeployMCMSWithTimelockV2WithFewExistingContracts The deployment process failed, likely due to an error during the execution or confirmation of a transaction. Logs ↗︎
TestGrantRoleInTimeLock The test failed because the data store was not available when applying a changeset. Logs ↗︎
TestDeployMCMSWithTimelockV2FailsWhenProposerBypasserCancellerMissing The deployment failed because the transaction was reverted on chain due to an 'OutOfBoundsNumOfSigners' error. Logs ↗︎
TestTranslateEVM2EVMOnRampsToFeeQuoterChangeset The test failed without a specific error message, likely due to an issue during the deployment or configuration of smart contracts. Logs ↗︎

... and 1 more

View Full Report ↗︎Docs

}
byQualifier[q][datastore.ContractType(ref.Type)] = true
}
for q, typesSet := range byQualifier {
Copy link
Contributor

@ChrisAmora ChrisAmora Feb 19, 2026

Choose a reason for hiding this comment

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

I think we will need to skip the "" qualifier here if you keep this approach

WhitelistByChain map[uint64][]WhitelistAddress `json:"whitelist_by_chain"`
// WhitelistByChain maps chain selector to the list of whitelisted addresses for that chain (legacy, default timelock).
// Use when only one timelock per chain or for the default/empty qualifier.
WhitelistByChain map[uint64][]WhitelistAddress `json:"whitelist_by_chain,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove this. It will be a bit of work but the code will become simpler

// on the given chains with qualifier DefaultTimelockQualifier ("default"). When the framework
// merges this into the environment, lookups by qualifier "default" will find these refs.
// Run once per environment; safe to run multiple times (adds refs, may duplicate if already migrated).
func MigrateAddressRefsToDefaultQualifier(env cldf.Environment, input MigrateAddressRefsToDefaultQualifierInput) (cldf.ChangesetOutput, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could remove the whole complexity of adding this:
We could do: existing contracts are looked up by chain + type, new contracts get the new explicit qualifiers.

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.

2 participants