Skip to content

[CLD-1777]: feat(operations-gen): add evm support#910

Open
graham-chainlink wants to merge 1 commit intomainfrom
ggoh/cld-1777/evm-support-operations-gen
Open

[CLD-1777]: feat(operations-gen): add evm support#910
graham-chainlink wants to merge 1 commit intomainfrom
ggoh/cld-1777/evm-support-operations-gen

Conversation

@graham-chainlink
Copy link
Copy Markdown
Collaborator

Add evm support for the operations-gen cli, basically ported the code from https://github.com/smartcontractkit/chainlink-ccip/blob/main/chains/evm/cmd/operations-gen/main.go and adapted it to the new design

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-1777

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: e94ae22

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Collaborator Author

@graham-chainlink graham-chainlink Apr 3, 2026

Choose a reason for hiding this comment

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

file mainly copied from https://github.com/smartcontractkit/chainlink-ccip/blob/main/chains/evm/cmd/operations-gen/main.go and adapted to the new design and added tests.

I will update the ported code in chainlink-ccip to point to this one when this PR is merged.

@graham-chainlink graham-chainlink changed the title feat(operations-gen): add evm support [CLD-1777]: feat(operations-gen): add evm support Apr 3, 2026
@graham-chainlink graham-chainlink marked this pull request as ready for review April 3, 2026 02:28
@graham-chainlink graham-chainlink requested a review from a team as a code owner April 3, 2026 02:28
Copilot AI review requested due to automatic review settings April 3, 2026 02:28
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

Adds EVM support to the tools/operations-gen CLI so it can generate type-safe Go operation wrappers from Solidity ABIs/bytecode, using an EVM-specific handler and template.

Changes:

  • Registers the evm chain-family handler and introduces EVM extraction/generation logic.
  • Adds an EVM operations template plus supporting utilities (type mapping, ABI parsing, overload handling).
  • Adds documentation and unit tests for key EVM helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
tools/operations-gen/README.md Documents the CLI, config schema, and input/output layouts for EVM generation.
tools/operations-gen/main.go Enables EVM by registering evmHandler in chainFamilies.
tools/operations-gen/evm.go Implements EVM handler: config decoding, ABI/bytecode reading, ABI parsing, template data preparation, and codegen helpers.
tools/operations-gen/evm_test.go Adds unit tests for EVM naming/type mapping utilities and overload handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from 3df479d to 0d43e7b Compare April 3, 2026 02:49
Comment on lines +23 to +26
var nameOverrides = map[string]string{
"OnRamp": "onramp",
"OffRamp": "offramp",
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we actually want to support this product specific overrides. Can ythey do it in configuration instead?

Copy link
Copy Markdown
Collaborator Author

@graham-chainlink graham-chainlink Apr 7, 2026

Choose a reason for hiding this comment

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

good point, i was thinking to not make any breaking change in order to let existing users have a smooth migration.

Removed it, after looking at the code, user can override the package name by specifying the package_name field

Copy link
Copy Markdown
Collaborator

@jkongie jkongie left a comment

Choose a reason for hiding this comment

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

We should add more documentation to this

Comment on lines +9 to +11
```bash
task generate:operations CONFIG=/path/to/operations_gen_config.yaml
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this applicable? task seems like a repo specific wrapper

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i was thinking it could be used to test the cli locally, but i can live without it too, will remove it !

Comment on lines +29 to +33
input:
base_path: "." # Directory containing abi/ and bytecode/ subdirectories

output:
base_path: "." # Directory where generated operations/ folders are written
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we always assume that the contracts will be in a single base path?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmmm, hard to say, but users can move them into a single base path if it is not? Or do you think is it worth supporting multiple base path? I was also thinking to avoid many breaking user facing changes with the existing cli too.

@graham-chainlink
Copy link
Copy Markdown
Collaborator Author

graham-chainlink commented Apr 7, 2026

We should add more documentation to this

@jkongie do you think the current readme is lacking any other information? I also plan to add something to the https://docs.cld.cldev.sh/ too.

Copilot AI review requested due to automatic review settings April 7, 2026 07:30
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from 0d43e7b to 8a090ef Compare April 7, 2026 07:30
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch 2 times, most recently from 340cea6 to 4924b93 Compare April 7, 2026 07:32
desc: Generate mocks for interfaces
cmds:
- mockery

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed per discussion as taskfile is more of a repo wide command

@graham-chainlink graham-chainlink requested a review from jkongie April 7, 2026 07:34
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

taskfiles/generate/Taskfile.yml:12

  • generate:operations was removed, but tools/operations-gen/README.md still documents task generate:operations .... This will break the documented workflow; either re-add an operations task here (wrapping go run ./tools/operations-gen -config ...) or update the README to match the new invocation.
tasks:
  mocks:
    desc: Generate mocks for interfaces
    cmds:
      - mockery


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from 4924b93 to e63b65b Compare April 7, 2026 11:40
Copilot AI review requested due to automatic review settings April 8, 2026 14:43
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from e63b65b to e6bcc9a Compare April 8, 2026 14:43
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

taskfiles/generate/Taskfile.yml:12

  • This change removes the generate:operations task entirely. If contributors rely on task generate:operations CONFIG=... (especially since the task handled resolving relative CONFIG paths from the repo root), this is a workflow regression and it’s not mentioned in the PR description. Consider keeping the task (or replacing it with an equivalent) so there remains a documented, one-command way to run operations-gen from the repo root.
tasks:
  mocks:
    desc: Generate mocks for interfaces
    cmds:
      - mockery


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from e6bcc9a to e94ae22 Compare April 8, 2026 15:02
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

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