Skip to content

[DO NOT MERGE] Add cap-dev branch#422

Draft
yashnevatia wants to merge 10 commits into
mainfrom
capabilities-development
Draft

[DO NOT MERGE] Add cap-dev branch#422
yashnevatia wants to merge 10 commits into
mainfrom
capabilities-development

Conversation

@yashnevatia
Copy link
Copy Markdown
Collaborator

@yashnevatia yashnevatia commented May 12, 2026

1. Created capabilities-development branch on cre-cli

  • Created branch off main and pushed to remote.

2. Tagged cre-sdk-go cap-dev for Go module compatibility

Because chainlink/v2 requires cre-sdk-go >= v1.5.0, and cap-dev's squash-merged history doesn't contain the original v1.5.0v1.8.0 tags from main, we created new tags on cap-dev:

  • v1.9.0-capdev.1 (root module)
  • capabilities/blockchain/evm/v1.0.0-beta.10-capdev.1
  • capabilities/networking/http/v1.4.0-capdev.1
  • capabilities/scheduler/cron/v1.4.0-capdev.1

3. Updated go.mod dependencies on cre-cli cap-dev

Bumped the three target dependencies to capabilities-development:

  • github.com/smartcontractkit/chainlink-protos/cre/go -> cap-dev pseudo-version
  • github.com/smartcontractkit/cre-sdk-go -> v1.9.0-capdev.1
  • github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm -> v1.0.0-beta.10-capdev.1

Also updated the test project at test/test_project/por_workflow/go.mod with the same + sub-module deps (http, cron, confidentialhttp).

4. Fixed transitive dependency breakage

  • chainlink/v2: Kept pinned at v2.29.1-cre-beta.0.0.20260422181348-efa818697ce5 (same as main). Bumping cre-sdk-go tried to pull in v2.46.0 which broke everything.
  • chainlink-aptos: The fakes package moved from chainlink-aptos/fakes to chainlink-aptos/capabilities/fakes. Updated 3 files:
    • cmd/workflow/simulate/chain/aptos/capabilities.go
    • cmd/workflow/simulate/chain/aptos/health.go
    • cmd/workflow/simulate/chain/aptos/chaintype.go
  • chainlink-evm / chainlink-framework: The newer chainlink-framework/multinode (pulled transitively by cre-sdk-go) was incompatible with the pinned chainlink-evm. Pinned chainlink-framework modules back to main's versions to keep them in sync.

5. Created CI workflows

Two new files in .github/workflows/:

  • validate-protos-version.yml — reuses the org shared action smartcontractkit/.github/actions/validate-protos-version@v1.0.0 to verify chainlink-protos/cre/go pseudo-versions point to commits on capabilities-development.

  • validate-sdk-version.yml — custom workflow that validates all cre-sdk-go dependencies in go.mod are on capabilities-development. Handles both pseudo-versions (extracts 12-char hex commit hash) and tagged versions (resolves tag to commit via git rev-list, building the full tag path for sub-modules).

6. Branch protection

Configured via GitHub UI — requiring at least 1 approving review before merging to capabilities-development.

@yashnevatia yashnevatia requested a review from a team as a code owner May 12, 2026 09:35
@yashnevatia yashnevatia self-assigned this May 12, 2026
@yashnevatia yashnevatia marked this pull request as draft May 12, 2026 09:35
@github-actions
Copy link
Copy Markdown

👋 yashnevatia, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

yashnevatia and others added 9 commits May 12, 2026 11:22
* feat(simulate): Aptos chain family for `cre workflow simulate`

Wires an Aptos chain type into `cre workflow simulate` so workflows
targeting `aptos:ChainSelector:N@1.0.0` can be exercised locally
against testnet RPCs + a user-published mock forwarder.

chain/aptos plugin:
- chaintype.go — registers `aptos` via chain.Register; implements
  ChainType (Name, SupportedChains, ResolveClients, ResolveKey,
  RegisterCapabilities, RunHealthCheck, ParseTriggerChainSelector,
  etc.). No trigger surface on Aptos.
- capabilities.go — AptosChainCapabilities wires FakeAptosChain per
  selector and registers with the capability registry.
- limited_capabilities.go — LimitedAptosChain enforces chain-write
  size + Aptos MaxGasAmount via caperrors.ResourceExhausted.
- supported_chains.go — mainnet + testnet selectors.
- health.go — RunRPCHealthCheck probes GetChainId per client.

chain/evm refactor: extracts the EVM-specific pieces out of simulate.go
so the simulate command delegates per-chain work through a chain-type
registry (EVM + Aptos siblings). Trigger handling, registry, types,
utils moved to chain/*. evm/trigger.go carries manual-log-trigger glue.

Settings + limits:
- CRE_APTOS_PRIVATE_KEY plumbing (Ed25519 hex seed); sentinel seed
  allowed non-broadcast with ui.Warning; hard-fail under --broadcast
  for unparseable or sentinel key.
- ChainWriteAptosMaxGasAmount in SimulationLimits.

Tests:
- Unit: chaintype / capabilities / limited / supported_chains / health.
- 30-scenario CLI end-to-end suite (simulator_scenarios_test.go).
- test/aptos_cli_scenarios_test.go integration.
- test_project/aptos_smoke/ example workflow for manual smoke.

PLEX-2751

* test(simulate/aptos): extend scenarios from 30 to 100

Broadens TestSimulatorScenarios_100 to cover the full behavioural
surface of the Aptos chain plugin + FakeAptosChain:

- 31-45: AptosChainType surface (Name, SupportedChains, HasSelector,
  ParseTriggerChainSelector, ExecuteTrigger/ResolveTriggerData stubs,
  ResolveKey hex/0x/uppercase/whitespace/short-seed rejections).
- 46-52: RegisterCapabilities rejects wrong client, key, and limits
  types; accepts unknown (experimental) selectors; skips selectors
  without forwarders; surfaces bad forwarder hex; interface assert.
- 53-62: View TypeTag coverage — BOOL, U8, U16, U32, U64, U128, U256,
  ADDRESS round-trips; SIGNER and VECTOR rejected.
- 63-72: read-path edges — all-zero/all-ones addresses, empty result,
  multi-return, integer return, SDK timeout, nil pagination, nil-entry
  drop, nil request validation.
- 73-82: WriteReport broadcast paths — SUCCESS, VM failure, nil pending,
  forwarder error, WaitForTransaction error, nil-final fallback,
  multi-sig, empty sigs, 64KiB report, zero gas accepted.
- 83-90: LimitedAptosChain — exact/over/under size and gas limits,
  zero-limit disables check, View/TransactionByHash delegation.
- 91-100: lifecycle + info — ChainSelector, Description, Info ID format,
  Name embedding, Initialise/Register/Unregister/Execute no-ops,
  HealthReport shape, AptosChainCapabilities Start/Close, constructor
  nil guards.

PLEX-2751

* build(deps): pin chainlink-aptos to PLEX-2751 PR head

Drops the local `replace ../chainlink-aptos` directive (breaks CI
sibling-dir lookup) and pins chainlink-aptos to the PLEX-2751
feature-branch pseudo-version v0.0.0-20260421125752-47d9d126c005
so unit, tidy, gendoc, and e2e jobs can resolve the `fakes` import.

Will be re-pinned to the merged SHA once smartcontractkit/chainlink-aptos#442
lands on develop.

PLEX-2751

* test(cli): extend aptos CLI scenarios from 30 to 100

Broadens the e2e cre-binary suite (gated by CRE_APTOS_CLI_E2E=1) with
70 additional scenarios covering:

- 31-40: balance fan-out across address shapes (high bit, low bit,
  max_u256, fan-out lanes).
- 41-50: view coin::balance edges (all-zero, all-0x01, all-0xff,
  canonical aligned-byte addresses).
- 51-60: tx-by-hash randomised nonexistent hashes (routing proof).
- 61-70: account-transactions fan-out.
- 71-80: wrong selector / experimental-chain rejection (EVM mainnet,
  Solana, 0, 1, max uint64, Aptos mainnet without wiring, experimental
  99999999 for each read op, baseline testnet selector unchanged).
- 81-90: UI + flag variations (--limits none/default, --help global and
  workflow simulate scoped, missing wasm/config error messages, invalid
  --trigger-index, empty CRE_TARGET env).
- 91-100: broadcast + key edge cases (--broadcast with sentinel /
  unparseable / short-hex keys — all must hard-fail with
  CRE_APTOS_PRIVATE_KEY in the error message, dry-run sentinel warning,
  dry-run with valid key success, follow-up routing regression cases).

Runner rewritten to handle three scenario shapes:
- standard simulator dry-run (config + args),
- help/no-config invocations (skip simulator markers),
- mustFail scenarios (process exit non-zero, expect substring in
  combined output).

Scenario padding widened to %03d to fit 100 cases.

PLEX-2751

* chore(simulate/aptos): address audit feedback

- ResolveKey: split hex-decode vs length-mismatch errors; align wording
  with EVM's CRE_*_PRIVATE_KEY message.
- ParseTriggerChainSelector: strict prefix+suffix+ParseUint, rejects
  trailing garbage after @1.0.0.
- --broadcast flag help: chain-agnostic wording (no longer EVM-only).
- LimitsSummary: include Aptos gas limit alongside EVM; test updated.
- aptos_cli_scenarios_test: use t.TempDir() for per-subtest config
  paths instead of /tmp/apcfg_%03d.json.

* test(aptos): use /tmp for config path to satisfy 97-char limit

TempDir() paths exceed ConfigPath validation (max=97) on macOS.
Restore /tmp/apcfg_NNN.json with defer os.Remove; add
APTOS_SMOKE_WASM env override for WASM location.

* feat(simulate/aptos): support experimental-chains + align view test expectations

- Add chain-type discriminator to ExperimentalChain; empty defaults to evm
- Aptos ResolveClients picks up chain-type: aptos entries
- EVM skips non-evm experimental entries
- Use corekeys.Aptos / ct.Name() for chain-type strings
- Update project.yaml.tpl example
- Align View/WriteReport test assertions with pinned FakeAptosChain semantics

* refactor(settings): consolidate chain signing keys behind ChainType (#399)

Replace EthPrivateKey / AptosPrivateKey fields on UserSettings with a
single PrivateKeys map keyed by ChainType.Name, and introduce a
ChainType struct that bundles each family's name + signing-key env var.
Names are derived from corekeys.EVM / corekeys.Aptos so the canonical
upstream identifiers are the single source of truth.

Adding a new chain family is now one entry in AllChainTypes instead of
a new field, constant, and loader branch. Remove unused EthUrl and
simplify the project.yaml experimental-chains example comment.

* refactor(settings): dispatch chain name lookup by family prefix

chain-selectors has no AptosChainIdFromName; previous fallback scanned
the Aptos map with a double lookup. Switch on FamilyAptos prefix and
iterate AptosALL directly, reading Name/Selector off the struct.

* chore(test): untrack local-only Aptos smoke scaffolding

Remove aptos_cli_scenarios_test.go and test/test_project/aptos_smoke/
from version control and ignore them going forward. Files remain on
disk for local iteration.

* refactor(simulate): centralize chain limits, untrack local Aptos scenarios

Move per-family Limits struct definition into chain package as the shared
type used by EVM and Aptos plugin wrappers. Each plugin keeps its own
ExtractLimits to populate the struct from cresettings.Workflows. Aptos's
GasLimit field maps to max_gas_amount.

Untrack local Aptos simulator_scenarios_test.go (kept on disk via
.gitignore) — these scenarios are local-only smoke fixtures.

* refactor(simulate): per-family ChainWrite limits and engine cfg parity

Move ReportSizeLimit and gas defaults into per-family EVM/Aptos blocks
in limits.json (upstream top-level ChainWrite.ReportSizeLimit is
deprecated). Split ChainWriteReportSizeLimit() getter into
EVM/AptosChainWriteReportSizeLimit(), update LimitsSummary to render
evm_report/evm_gas/aptos_report/aptos_gas, and read per-family fields
in chain/{evm,aptos}/limits.go.

Apply ChainWrite.{EVM,Aptos} report+gas to engine cfg in both
applyEngineLimits and disableEngineLimits for symmetry and future
hardening (current sim enforcement runs via Limited{EVM,Aptos}Chain
wrappers reading SimulationLimits directly). Drop deprecated
EVM.TransactionGasLimit. Tighten broadcast/ChainType doc comments.

* test(simulate): add per-family gas-limit getters and assertions

Mirror the per-family ReportSize getters with EVMChainWriteGasLimit
and AptosChainWriteGasLimit. Cover them in default, custom-load,
resolve, and applyEngineLimits tests for parity with ReportSize.

* test(simulate): drop redundant chain ExtractLimits override tests

Override path is covered by simulate/limits_test.go via the
EVM/AptosChainWriteGasLimit getters which read the same fields. Keep
the default-mapping smoke tests as chain-package unit anchors.

* test(simulate/aptos): align supported_chains tests with EVM parity

Add selector non-zero/unique, forwarder hex validity (64-hex for Aptos
object addresses), selector family resolution, no-empty-forwarder, and
SupportedChains() return-parity tests. Keep existing mainnet/testnet
presence check.

* test(simulate): cover zero-limit and nil sub-message passthrough

Add parity coverage to LimitedAptosChain and LimitedEVMChain wrappers
for the --limits none equivalent (zero chain.Limits delegates oversized
input) and nil GasConfig / nil Report inputs (no panic, delegates).

* refactor(simulate/aptos): drop dead-defensive nil input guard

gRPC server stubs guarantee a non-nil top-level WriteReportRequest, so
'input != nil' was unreachable. Align with the EVM wrapper which only
guards on the optional Report and GasConfig sub-messages.

* test(simulate/aptos): cover mixed known + experimental health check

Mirror EVM TestHealthCheck_MixedKnownAndExperimental: a healthy named
selector plus an experimental selector that errors should report the
experimental label and omit the healthy one.

* test(simulate/aptos): align chaintype coverage with EVM

Add parity tests: ResolveTriggerData/ExecuteTrigger return the
'no trigger surface' contract, RegisterCapabilities surfaces wrong
client type and constructs empty on no clients, RunHealthCheck
propagates invalid client type, init() registers under chain.Names,
CollectCLIInputs returns empty.

* chore(simulate/aptos): log when experimental forwarder matches supported

Mirror EVM's debug log in ResolveClients so the no-override branch is
observable; aligns Aptos with the existing EVM behaviour.

* refactor(simulate/aptos): delegate ParseTriggerChainSelector to shared helper

Use chain.ParseTriggerChainSelector(ct.Name(), triggerID) like EVM,
removing the bespoke prefix/suffix parsing and its local test (already
covered by chain/trigger_test.go's Aptos cases).

* chore(simulate/evm): wrap registry.Add error with selector context

Match the Aptos error wrap so capability-registration failures point at
the offending chain selector instead of bubbling a bare error.

* fix(simulate/aptos): improve Aptos config guidance

Clarify Aptos simulator errors and generated environment setup so users get the same remediation cues as EVM without adding extra address normalization.

Made-with: Cursor

* Reset gitignore

* chore: tidy go.sum (drop stale chainlink-aptos entry)

Made-with: Cursor

* fix(ci): post-merge fixes for ci-test-unit, ci-lint, gendoc

- handler_test.go: replace removed UserSettings.EthPrivateKey with PrivateKeys map (test build was failing typecheck)
- docs/cre_workflow_simulate.md: regenerate via 'make gendoc' to match updated --broadcast flag help text

* fix(lint): gci import grouping in simulate pkg

* fix(lint): gci import grouping in simulate/chain/aptos

---------

Co-authored-by: Michael Fletcher <michael.fletcher153@gmail.com>
Co-authored-by: Michael Fletcher <36506122+Fletch153@users.noreply.github.com>
…ractkit/cre-cli into capabilities-development
Upstream chainlink-aptos PR 442 dropped the aptosfakes.AptosClient
named-interface re-export and the NewAptosClient wrapper as part of
parity-audit cleanup, since both were thin shims around aptos-go-sdk's
own aptos.AptosRpcClient and aptos.NewClient. After bef9e78 + c544e62
bumped the dep to the merged SHA and patched the import path, the
type references still pointed at the removed symbols and CI on PRs
targeting main broke at compile.

Switch the simulate Aptos chain to construct the RPC client via
aptos.NewClient(NetworkConfig{NodeUrl}) directly and assert against
aptos.AptosRpcClient. FakeAptosChain still owns the fake capability
surface; only the wrapper indirection is removed.
@github-actions
Copy link
Copy Markdown

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.17.0
Latest Upstream null

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to null

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

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