Skip to content

Finish Aptos local CRE read/write parity#21515

Closed
cawthorne wants to merge 14 commits intodevelopfrom
feature/aptos-local-cre-minimal-write
Closed

Finish Aptos local CRE read/write parity#21515
cawthorne wants to merge 14 commits intodevelopfrom
feature/aptos-local-cre-minimal-write

Conversation

@cawthorne
Copy link
Copy Markdown
Contributor

@cawthorne cawthorne commented Mar 13, 2026

Summary

  • finish Aptos local CRE read/write parity on the rebased dependency stack
  • keep the PR narrow to Aptos local CRE wiring plus the small core/job changes needed to support it
  • pass Aptos runtime config through CapabilityConfig.SpecConfig instead of the CapReg OCR3-config side channel

What changed

  • added the Aptos local CRE write path in system-tests/lib/cre/features/aptos:
    • deploy and cache the Aptos platform forwarder
    • patch node TOML with the forwarder address
    • configure the forwarder after contract DON IDs are resolved
    • propose and approve Aptos worker jobs in local CRE
  • persisted Aptos forwarder addresses into saved local CRE state so the same forwarder is reused across setup and test phases
  • added Aptos smoke workflows for:
    • Aptos_Read
    • Aptos_Write
    • Aptos_Write_Read_Roundtrip
    • Aptos_Write_Expected_Failure
  • import Aptos keys from local secrets at node startup and thread the Aptos account into CRE pre-start metadata
  • build p2pToTransmitterMap from pre-start metadata instead of reading it from started worker node OCR config
  • register Aptos capability config directly in PreEnvStartup
  • remove the now-dead PostDONStartup hook and scaffolding
  • keep PostEnvStartup only for the parts that still depend on configured contract state (forwarder config + worker job approval)
  • update job proposal logic so Aptos ReadContract worker jobs still generate the oracle-factory block they need
  • narrow private plugin refs so only the Aptos-related capability pin stays on the feature branch

Why

Two things needed to be fixed for the rebased local CRE stack:

  1. Forwarder state had to be stable across the full end-to-end flow.
    Before this change, startup could configure worker jobs against one Aptos forwarder while later setup rebuilt state and used a different forwarder.

  2. Aptos runtime config needed to follow the current capability-manager contract.
    p2pToTransmitterMap, scheduling, and similar Aptos-specific runtime inputs now flow through CapabilityConfig.SpecConfig, which is merged into dependencies config before capability initialisation, instead of being smuggled through OCR3 config.

Scope notes

  • this PR keeps the existing Aptos read-capability baseline and completes the missing local CRE write-side wiring on top of it
  • it intentionally does not keep unrelated preventative test-infra changes
  • it intentionally removes the temporary local CRE post-DON phase once Aptos no longer needs it

Testing

  • cd system-tests/lib && GOWORK=off go test ./cre/don/secrets ./cre ./cre/features/aptos ./cre/environment -count=1
  • cd system-tests/lib && GOWORK=off go test ./cre ./cre/contracts ./cre/environment ./cre/features/aptos ./cre/features/read_contract -count=1
  • cd system-tests/tests && GOWORK=off go test ./smoke/cre -run TestDoesNotExist -count=1
  • cd deployment && GOWORK=off go test ./cre/jobs/... -run TestDoesNotExist -count=1
  • go test ./core/config/toml ./core/services/chainlink ./core/cmd -run TestDoesNotExist -count=1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Mar 13, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cawthorne cawthorne changed the title cre aptos: finish local CRE read/write parity Finish Aptos local CRE read/write parity Mar 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 14, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 46 @smartcontractkit/foundations, @smartcontractkit/core
/core/capabilities/ 3 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
/core/services/standardcapabilities 2 @smartcontractkit/keystone
/deployment/cre 2 @smartcontractkit/keystone, @smartcontractkit/operations-platform
/.github/** 💬 1 @smartcontractkit/devex-cicd, @smartcontractkit/devex-tooling, @smartcontractkit/core
go.md 1 @smartcontractkit/core, @smartcontractkit/foundations
go.mod 6 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 5 @smartcontractkit/core, @smartcontractkit/foundations

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

cawthorne added a commit that referenced this pull request Mar 16, 2026
Same as PR #21515 (feature/aptos-local-cre-minimal-write) except the
recreate path no longer calls hydrateRecreatedEnvironmentImageEnv or
sets CTF_JD_IMAGE/CTF_CHAINLINK_IMAGE before env start. Removes
hydrate helpers and their tests to verify whether CI passes without them.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

testLogger.Info().Msgf("PostDONStartup for feature %s executed successfully", feature.Flag())
}
}
fmt.Print(libformat.PurpleText("%s", input.StageGen.WrapAndNext("Features applied in %.2f seconds", input.StageGen.Elapsed().Seconds())))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this work? In the past this needed to happened once capability registry was configured, since some changesets were pulling don info from that contract.

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

Risk Rating: HIGH

Completes Aptos local CRE read/write parity by adding Aptos write-side wiring (forwarder deploy/config/state persistence), introducing Aptos smoke workflows, and adjusting CRE environment/capability-registry plumbing to support Aptos signer families and oracle-factory generation where needed.

Changes:

  • Added Aptos smoke workflows (read, write, write→read roundtrip) and test-suite entry/CI topology mapping.
  • Implemented Aptos local CRE write-side integration across environment startup, node/worker config generation, JD chain config creation, and capability registry configuration (incl. per-capability extra signer families).
  • Bumped/realigned CRE SDK + protos + related deps across multiple test/workflow modules and plugin refs.

Areas requiring scrupulous human review

  • system-tests/lib/cre/environment/environment.go and system-tests/lib/cre/contracts/keystone.go: new Post-DON startup feature hook + capability-to-signer-family mapping materially affects OCR3 config generation and DON/capability registration ordering.
  • system-tests/lib/cre/features/aptos/aptos.go + system-tests/lib/cre/don/config/config.go: forwarder lifecycle, config patching, and URL normalization—high impact on determinism and state reuse.
  • core/services/chainlink/application.go + core/capabilities/fakes/*: env-var-gated capability registration in core app init path (ensure this can’t accidentally impact prod deployments).

Reviewer recommendations

  • Request review from the CODEOWNERS responsible for:
    • system-tests/lib/cre/** (CRE environment + features + contracts wiring)
    • core/services/chainlink/** and core/capabilities/** (core application startup + capability registry)
    • deployment/cre/** (job spec proposal/oracle-factory generation logic)

Reviewed changes

Copilot reviewed 89 out of 120 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
system-tests/tests/test-helpers/t_helpers.go Adds Aptos workflow config types to helper factory.
system-tests/tests/test-helpers/before_suite.go Refactors env start invocation into helper.
system-tests/tests/smoke/cre/solana/solwrite/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/smoke/cre/solana/solwrite/go.sum Updates checksums for bumped deps.
system-tests/tests/smoke/cre/httpaction/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/smoke/cre/httpaction/go.sum Updates checksums for bumped deps.
system-tests/tests/smoke/cre/evm/logtrigger/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/smoke/cre/evm/logtrigger/go.sum Updates checksums for bumped deps.
system-tests/tests/smoke/cre/evm/evmread/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/smoke/cre/evm/evmread/go.sum Updates checksums for bumped deps.
system-tests/tests/smoke/cre/cre_suite_test.go Adds Aptos v2 smoke suite entry.
system-tests/tests/smoke/cre/aptos/aptosread/main.go New Aptos read WASM workflow.
system-tests/tests/smoke/cre/aptos/aptosread/config/config.go Config schema for Aptos read workflow.
system-tests/tests/smoke/cre/aptos/aptosread/go.mod Module for Aptos read workflow.
system-tests/tests/smoke/cre/aptos/aptosread/go.sum Checksums for Aptos read workflow module.
system-tests/tests/smoke/cre/aptos/aptoswrite/main.go New Aptos write WASM workflow.
system-tests/tests/smoke/cre/aptos/aptoswrite/config/config.go Config schema for Aptos write workflow.
system-tests/tests/smoke/cre/aptos/aptoswrite/go.mod Module for Aptos write workflow.
system-tests/tests/smoke/cre/aptos/aptoswrite/go.sum Checksums for Aptos write workflow module.
system-tests/tests/smoke/cre/aptos/aptoswriteroundtrip/main.go New Aptos write→read roundtrip WASM workflow.
system-tests/tests/smoke/cre/aptos/aptoswriteroundtrip/config/config.go Config schema for Aptos roundtrip workflow.
system-tests/tests/smoke/cre/aptos/aptoswriteroundtrip/go.mod Module for Aptos roundtrip workflow.
system-tests/tests/smoke/cre/aptos/aptoswriteroundtrip/go.sum Checksums for Aptos roundtrip workflow module.
system-tests/tests/regression/cre/httpaction-negative/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/httpaction-negative/go.sum Updates checksums for bumped deps.
system-tests/tests/regression/cre/http/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/http/go.sum Updates checksums for bumped deps.
system-tests/tests/regression/cre/evm/logtrigger-negative/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/evm/logtrigger-negative/go.sum Updates checksums for bumped deps.
system-tests/tests/regression/cre/evm/evmwrite-negative/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/evm/evmwrite-negative/go.sum Updates checksums for bumped deps.
system-tests/tests/regression/cre/evm/evmread-negative/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/evm/evmread-negative/go.sum Updates checksums for bumped deps.
system-tests/tests/regression/cre/consensus/go.mod Bumps CRE SDK/protos deps.
system-tests/tests/regression/cre/consensus/go.sum Updates checksums for bumped deps.
system-tests/tests/go.mod Adds Aptos workflow modules + bumps common deps.
system-tests/tests/canaries_sentinels/proof-of-reserve/cron-based/go.mod Bumps common/CRE deps for canary module.
system-tests/lib/go.mod Adds aptos-go-sdk + chainlink-aptos + bumps protos/framework.
system-tests/lib/cre/types.go Adds write-aptos flag + per-capability signer families + PostDONStartup hook.
system-tests/lib/cre/ocr_signer_families.go New helpers for non-EVM signer family discovery/mapping.
system-tests/lib/cre/flags/provider.go Includes write-aptos in default capability flags.
system-tests/lib/cre/flags/flags.go Treats write-aptos as requiring forwarder contract.
system-tests/lib/cre/flags/flags_test.go Adds tests for forwarder-required logic.
system-tests/lib/cre/features/sets/sets.go Registers Aptos feature in default feature set.
system-tests/lib/cre/features/aptos/aptos_test.go Adds unit tests for Aptos capability config + helpers.
system-tests/lib/cre/features/read_contract/read_contract.go Adds Aptos family handling + label logic + skip when Aptos write owns registration.
system-tests/lib/cre/features/read_contract/read_contract_test.go Adds tests for Aptos post-env skip logic.
system-tests/lib/cre/features/solana/v2/solana.go Migrates to per-capability signer families output.
system-tests/lib/cre/features/evm/v2/evm.go Uses NonEVMOCRSignerFamilies for OCR3 signer selection.
system-tests/lib/cre/features/consensus/v2/consensus.go Adds Aptos selector inputs + better Aptos key error messaging + signer families.
system-tests/lib/cre/features/web_api_trigger/web_api_trigger.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/web_api_target/web_api_target.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/vault/vault.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/mock/mock.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/log_event_trigger/log_event_trigger.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/http_trigger/http_trigger.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/http_action/http_action.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/evm/v1/evm.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/don_time/don_time.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/custom_compute/custom_compute.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/cron/cron.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/features/consensus/v1/consensus.go Embeds NoopPostDONStartup for new interface compliance.
system-tests/lib/cre/environment/environment.go Adds PostDONStartup phase + per-capability signer families + Aptos funding.
system-tests/lib/cre/environment/dons.go Adds Aptos address support for node funding.
system-tests/lib/cre/environment/blockchains/sets/sets.go Adds Aptos blockchain deployer.
system-tests/lib/cre/don/config/config.go Injects Aptos chain config (node URL /v1 + forwarder addr) into node configs.
system-tests/lib/cre/don.go Caches Aptos addresses + adds Aptos JD chain config fields/deduping.
system-tests/lib/cre/contracts/ocr3.go Sets default OCR3 request timeout.
system-tests/lib/cre/contracts/keystone.go Wires per-capability signer families into cap-reg v2 config embedding.
plugins/plugins.public.yaml Updates chainlink-aptos plugin ref.
plugins/plugins.private.yaml Updates capability plugin refs + adds aptos chain capability plugin.
integration-tests/go.mod Bumps chainlink-aptos/common/protos/otel deps.
integration-tests/load/go.mod Bumps chainlink-aptos/common/protos/otel deps.
go.mod Bumps chainlink-aptos, cre-sdk-go, chainlink-common, protos, otel versions.
go.md Updates dependency graph for new Aptos workflow modules.
devenv/go.mod Bumps chainlink-common/protos deps.
devenv/go.sum Updates checksums for bumped deps.
deployment/go.mod Bumps chainlink-aptos/common/protos/otel deps.
deployment/cre/jobs/propose_job_spec.go Enables oracle-factory generation for Aptos via ReadContract path.
deployment/cre/jobs/propose_job_spec_test.go Adds test ensuring Aptos readcontract job includes oracle factory.
core/services/standardcapabilities/conversions/conversions.go Adds Aptos command↔capability ID conversion support.
core/services/standardcapabilities/conversions/conversions_test.go Adds tests for Aptos conversion behavior.
core/services/chainlink/application.go Adds env-var-gated registration of fake streams trigger capability.
core/capabilities/fakes/streams_trigger.go Switches fake trigger signers to deterministic ECDSA keys.
core/capabilities/fakes/register.go Adds helper to register fake streams trigger + env var name.
core/capabilities/fakes/register_test.go Adds tests for fake trigger registration + determinism.
core/scripts/go.mod Updates scripts module deps/structure + replace directives.
core/scripts/cre/environment/mock/trigger_types.go Uses chainlink-common cron legacy payload type.
core/scripts/cre/environment/examples/workflows/v2/time_consensus/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/time_consensus/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v2/time/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/time/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v2/proof-of-reserve/cron-based/go.mod Bumps chainlink-common/CRE deps and indirect additions.
core/scripts/cre/environment/examples/workflows/v2/node-mode/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/node-mode/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v2/http_simple/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/http_simple/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v2/http/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/http/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v2/cron/go.mod Bumps CRE SDK/protos deps.
core/scripts/cre/environment/examples/workflows/v2/cron/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/web-trigger-based/go.mod Bumps chainlink-common/protos deps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/web-trigger-based/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/cron-based/go.mod Bumps chainlink-common/protos deps.
core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/cron-based/go.sum Updates checksums for bumped deps.
core/scripts/cre/environment/configs/workflow-gateway-don-aptos.toml New Aptos local CRE topology config.
core/scripts/cre/environment/configs/capability_defaults.toml Adds defaults for write-aptos capability config.
.github/workflows/cre-system-tests.yaml Adds Aptos suite/topology mapping to CI workflow.

You can also share your feedback on Copilot code review. Take the survey.

@cl-sonarqube-production
Copy link
Copy Markdown

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