Skip to content

Finish Aptos local CRE read/write parity#21610

Draft
cawthorne wants to merge 37 commits intodevelopfrom
codex/aptos-local-cre-minimal-write-refresh
Draft

Finish Aptos local CRE read/write parity#21610
cawthorne wants to merge 37 commits intodevelopfrom
codex/aptos-local-cre-minimal-write-refresh

Conversation

@cawthorne
Copy link
Copy Markdown
Contributor

Supersedes #21515 to reset PR-scoped CI/cache state.

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 19, 2026

CORA - Pending Reviewers

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

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

For more details, see the full review summary.

@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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Mar 20, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestScripts/health/multi-chain-loopp The test failed because the server did not start or respond on the expected port, causing connection attempts to fail. Logs ↗︎

View Full Report ↗︎Docs

@cawthorne cawthorne force-pushed the codex/aptos-local-cre-minimal-write-refresh branch from 4e4f115 to c76d835 Compare March 20, 2026 14:22
// for tests only, in prod Registry should always be set at this point
opts.CapabilitiesRegistry = capabilities.NewRegistry(globalLogger)
}
if raw := os.Getenv(fakes.EnableFakeStreamsTriggerEnvVar); raw != "" {
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.

This doesn't feel right, why do you need it?

const aptosZeroForwarderHex = "0x0000000000000000000000000000000000000000000000000000000000000000"

// aptosNodeURLWithV1 normalizes an Aptos node URL so the path is /v1 (Aptos REST API base).
func aptosNodeURLWithV1(nodeURL string) string {
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.

why can't we use aptos.NodeURL()? where aptos is instance of Aptos Blockchain from system-tests/lib/cre/environment/blockchains/aptos/aptos.go?

@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