Skip to content

Feature/cre aptos v2.35.0#21321

Draft
cawthorne wants to merge 4 commits intodevelopfrom
feature/cre-aptos-v2.35.0
Draft

Feature/cre aptos v2.35.0#21321
cawthorne wants to merge 4 commits intodevelopfrom
feature/cre-aptos-v2.35.0

Conversation

@cawthorne
Copy link
Contributor

@cawthorne cawthorne commented Feb 27, 2026

This is currently a proof of concept demo, not an intention to merge.

Code quality and conventions need combing through.


// ensureLocalDepsDockerignore writes a temporary .dockerignore in parentDir so the Docker build
// context includes only chainlink, chainlink-common, capabilities, and optionally chainlink-aptos
// (avoids sending the entire parent dir, e.g. 22GB+ and I/O errors). Caller must run the returned cleanup.
Copy link
Contributor

Choose a reason for hiding this comment

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

curious about this... I had the same problem, it should be fixed now that I added .git to the main .dockerignore. Can you check if yours contains .git?


// ensureLocalDepsNodeImage builds the chainlink node image when node specs use docker_file and
// docker_ctx for the local-deps Dockerfile (context ".."). The framework corrupts absolute paths
// (e.g. produces "../Users"), so we build the image ourselves with correct paths and then set
Copy link
Contributor

Choose a reason for hiding this comment

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

could you expand on that?

}
fmt.Print(libformat.PurpleText("\tCapabilities: %s\n", capabilitiesDesc))
fmt.Print(libformat.PurpleText("\tDON Types: %s\n\n", strings.Join(nodeSet.DONTypes, ", ")))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need that if we have this?

DONs
+-------------------+-------------------+-------+------------+---------------------+
| DON               | Types             | Nodes | EVM Chains | Attributes          |
+-------------------+-------------------+-------+------------+---------------------+
| bootstrap-gateway | bootstrap,gateway | 1     | 1337, 2337 | -                   |
| capabilities      | capabilities      | 4     | 1337, 2337 | remote-capabilities |
| workflow          | workflow          | 4     | 1337, 2337 | -                   |
+-------------------+-------------------+-------+------------+---------------------+

Capability Matrix
+-----------------+-------------------+-----------------------+--------------+
| Capability      | bootstrap-gateway | capabilities          | workflow     |
+-----------------+-------------------+-----------------------+--------------+
| consensus       | -                 | -                     | local        |
| cron            | -                 | -                     | local        |
| custom-compute  | -                 | -                     | local        |
| don-time        | -                 | -                     | local        |
| evm             | -                 | remote-exposed (2337) | local (1337) |
| http-action     | -                 | -                     | local        |
| http-trigger    | -                 | -                     | local        |
| ocr3            | -                 | -                     | local        |
| read-contract   | -                 | remote-exposed (2337) | local (1337) |
| vault           | -                 | remote-exposed        | -            |
| web-api-target  | -                 | remote-exposed        | -            |
| web-api-trigger | -                 | -                     | local        |
| write-evm       | -                 | remote-exposed (2337) | local (1337) |

Features: features,
GatewayWhitelistConfig: gatewayWhitelistConfig,
BlockchainDeployers: blockchains_sets.NewDeployerSet(testLogger, in.Infra),
AptosForwarderAddresses: in.AptosForwarderAddresses,
Copy link
Contributor

Choose a reason for hiding this comment

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

where does this come from? any reason for passing it here instead of deploying it in pre/post startup hook? or if this is some static value per chainID you could pass it via capabilities values as map of map[chainID]address.

return "", fmt.Errorf("failed to resolve docker context path: %w", err)
}
}
args := []string{"build", "-t", c.LocalImage, "-f", dockerfilePath, ctxPath}
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand this is a temporary helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep.

for target in "$@"; do
run_target "$target"
done

Copy link
Contributor

Choose a reason for hiding this comment

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

is this file a temporary helper? if not, I think this should go GNUMakefile

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep.

require (
github.com/smartcontractkit/chainlink/deployment v0.0.0-20251021194914-c0e3fec1a97c
github.com/smartcontractkit/chainlink/v2 v2.32.0
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

@@ -10,21 +10,19 @@ defaults:
plugins:
aptos:
- moduleURI: "github.com/smartcontractkit/chainlink-aptos"
gitRef: "v0.0.0-20260217195306-9fec97c5dfbd"
gitRef: "v0.0.0-20260226223744-e59e9b1ad93f"
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the diff between that public and private plugin?

"Workflow": map[string]any{"ForwarderAddress": ac.ForwarderAddress},
"Nodes": []map[string]any{{"Name": "default", "URL": ac.NodeURL}},
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be done in features/aptos... the reason we have EVM here is that it is required for node to function, but aptos is optional and dependent on whether a DON has this capability or not

@@ -65,7 +65,9 @@ type Config struct {
FakeHTTP *fake.Input `toml:"fake_http" validate:"required"`
S3ProviderInput *s3provider.Input `toml:"s3provider"`
CapabilityConfigs map[string]cre.CapabilityConfig `toml:"capability_configs"` // capability flag -> capability config
Addresses []string `toml:"addresses"`
// Optional map of Aptos chain selector -> forwarder address used for Aptos write capability runtime config.
AptosForwarderAddresses map[uint64]string `toml:"aptos_forwarder_addresses"`
Copy link
Contributor

Choose a reason for hiding this comment

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

this should go to the default aptos capability config toml

}

return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

all of that code should go to features/aptos, it deffo doesn't belong here

// the Capability Registry (required for Aptos and other topologies where nodes have multiple chains).
if waitErr := waitForWorkflowNodesEVMChainConfig(ctx, deployKeystoneContractsOutput.Env.Offchain, dons, testLogger); waitErr != nil {
return nil, pkgerrors.Wrap(waitErr, "failed waiting for workflow nodes to register EVM chain config with Job Distributor")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed? once nodes are registered with JD this must be true... afaik this is not an async operation.

aptosForwarderAddresses,
); cfgErr != nil {
return nil, fmt.Errorf("failed to configure Aptos forwarders: %w", cfgErr)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

features/aptos

Copy link
Contributor

Choose a reason for hiding this comment

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

sure we don't need it any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was a git merge error. Will revert. I did not intend to touch this code.

return fmt.Errorf("no OCR2 key bundle id found for node %s", n.Name)
// Best-effort self-heal: create missing OCR2 key bundle for this chain type,
// then re-fetch the bundle ID from GraphQL.
if n.Clients.RestClient == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is the bundle be missing in the first place?

@@ -1264,6 +1272,11 @@ func (c *NodeSet) chainCapabilityIDs() []uint64 {
return out
}

// ChainCapabilityChainIDs returns the set of chain IDs supported by this node set's chain-scoped capabilities (e.g. read-contract-4, write-aptos-4).
func (c *NodeSet) ChainCapabilityChainIDs() []uint64 {
return c.chainCapabilityIDs()
Copy link
Contributor

Choose a reason for hiding this comment

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

why not make it public instead?

t.Run("[v2] Aptos Write Expected Failure", func(t *testing.T) {
ExecuteAptosWriteExpectedFailureOnlyTest(t, testEnv)
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

in the final version we'd probably only want to keep roundtrip + failure so that execution time in CI doesn't explode, would that be possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can do yeah.

userLogsCh := make(chan *workflowevents.UserLogs, 1000)
baseMessageCh := make(chan *commonevents.BaseMessage, 1000)

server := t_helpers.StartChipTestSink(t, t_helpers.GetLoggingPublishFn(lggr, userLogsCh, baseMessageCh, "./logs/aptos_capability_workflow_test.log"))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@cawthorne cawthorne changed the base branch from develop to release/2.35.0 February 27, 2026 14:17
@cawthorne cawthorne changed the base branch from release/2.35.0 to develop February 27, 2026 14:19
@cawthorne cawthorne force-pushed the feature/cre-aptos-v2.35.0 branch from 0d6ee82 to e5e9956 Compare February 27, 2026 20:58
@github-actions
Copy link
Contributor

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 35 @smartcontractkit/foundations, @smartcontractkit/core
/core/capabilities/ 4 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
/core/services/workflows 1 @smartcontractkit/keystone
/core/services/standardcapabilities 2 @smartcontractkit/keystone
/deployment/cre 2 @smartcontractkit/keystone, @smartcontractkit/operations-platform
/core/chainlink.Dockerfile 1 @smartcontractkit/devex-cicd, @smartcontractkit/foundations, @smartcontractkit/core
go.mod 7 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 7 @smartcontractkit/core, @smartcontractkit/foundations

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

For more details, see the full review summary.

@github-actions
Copy link
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
Contributor

✅ No conflicts with other open PRs targeting develop

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
6 Security Hotspots

See analysis details on SonarQube

@trunk-io
Copy link

trunk-io bot commented Feb 27, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CRE_V2_Aptos_Write Logs ↗︎
Test_CRE_V2_Aptos_Suite/[v2]_Aptos Logs ↗︎
Test_CRE_V2_Aptos_Write_Expected_Failure Logs ↗︎
Test_CRE_V2_Aptos_Write_Read_Roundtrip Logs ↗︎

... and 6 more

View Full Report ↗︎Docs

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