feat(operations-gen): add deploy_contract_types for same-ABI multi-label deploy#1056
Conversation
🦋 Changeset detectedLatest commit: 4addbe3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds support in operations-gen for registering multiple ContractType labels for a single EVM contract entry (same ABI/bytecode) via a new deploy_contract_types YAML field, enabling role-based multi-deploy patterns (e.g., proposer/bypasser/canceller) without duplicating generated packages.
Changes:
- Introduces
deploy_contract_typesin EVM contract config/IR/template-data and uses it to emit multipleBytecodeByTypeAndVersionentries for one contract. - Updates the EVM operations template to generate extra
<Label>ContractTypevars and to key deploy bytecode by those labels. - Adds tests, updates README + fixtures/golden output, and includes a changeset for the feature release.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/operations-gen/testdata/evm/operations_gen_mcms_config.yaml | Adds deploy_contract_types example to MCMS fixture config. |
| tools/operations-gen/testdata/evm/many_chain_multi_sig.golden.go | Updates golden output to include role contract types + bytecode map keys. |
| tools/operations-gen/README.md | Documents deploy_contract_types, rules, and usage example. |
| tools/operations-gen/internal/families/evm/evm_test.go | Adds generation + validation error tests for deploy_contract_types. |
| tools/operations-gen/internal/families/evm/contract.go | Threads DeployContractTypes through IR and adds validation hook. |
| tools/operations-gen/internal/families/evm/config.go | Adds YAML decoding field deploy_contract_types. |
| tools/operations-gen/internal/families/evm/codegen.go | Passes DeployContractTypes into template data. |
| tools/operations-gen/generate/templates/evm/operations.tmpl | Emits extra ContractType vars and deploy bytecode entries per label. |
| .changeset/long-times-divide.md | Declares a minor version bump for the feature. |
Files not reviewed (1)
- tools/operations-gen/testdata/evm/many_chain_multi_sig.golden.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7a6e7d6 to
f1a3b08
Compare
…bel deploy Adds a new `deploy_contract_types` field to the EVM contract config that allows a single contract entry to register multiple ContractType labels (e.g. ProposerManyChainMultiSig, BypasserManyChainMultiSig, CancellerManyChainMultiSig) in the generated BytecodeByTypeAndVersion map. When set, only the listed labels appear as bytecode map keys — the base contract_name type is excluded. Each label also gets an exported `var <Label>ContractType` declaration so callers can reference types without hardcoding strings. This replaces the previous pattern of duplicating the same contract three times in YAML with different package_name overrides, which produced three near-identical generated files and still broke on the TypeAndVersion lookup since the bytecode map only contained the base type key. Validation rejects: empty labels, duplicates, a label equal to the base contract_name, and combining with omit_deploy.
f1a3b08 to
4addbe3
Compare
|


Currently operations-gen does not support generating operation with the same contract byte code but each with different contract types (MCMS setup - proposer,canceller,bypasser).
Adds a new
deploy_contract_typesfield to the EVM contract config that allows a single contract entry to register multiple ContractType labels (e.g. ProposerManyChainMultiSig, BypasserManyChainMultiSig, CancellerManyChainMultiSig) in the generated BytecodeByTypeAndVersion map.will generate