Skip to content

Migrate Keystone View to Datastore API #17617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vyzaldysanchez
Copy link
Contributor

@vyzaldysanchez vyzaldysanchez commented May 7, 2025

This PR addresses CRE-400.

Currently, the Keystone View uses the Address Book to load the contracts and generate the View, but we want to refactor the functionality so it uses the newly added Datastore API.

Requires

Supports

@vyzaldysanchez vyzaldysanchez requested a review from krehermann May 7, 2025 16:46
@vyzaldysanchez vyzaldysanchez force-pushed the task/CRE-400/refactor-keystone-view-with-datastore branch from ee4bc0b to c09071b Compare May 8, 2025 17:58
@vyzaldysanchez vyzaldysanchez requested a review from krehermann May 9, 2025 13:44
@vyzaldysanchez vyzaldysanchez marked this pull request as ready for review May 9, 2025 14:12
@vyzaldysanchez vyzaldysanchez requested review from a team as code owners May 9, 2025 14:12
CapabilitiesRegistry map[common.Address]*capabilities_registry.CapabilitiesRegistry
WorkflowRegistry map[common.Address]*workflow_registry.WorkflowRegistry
}

func ViewKeystone(e deployment.Environment, previousView json.Marshaler) (json.Marshaler, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

changes look good, let's add a test that ensures we get the expected result when there are multiple contracts of the same type on a single chain

@vyzaldysanchez vyzaldysanchez requested a review from krehermann May 9, 2025 16:12
Copy link
Contributor

github-actions bot commented May 9, 2025

Flakeguard Summary

Ran new or updated tests between develop and 06696d9 (task/CRE-400/refactor-keystone-view-with-datastore).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

1 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestKeystoneView/successfully_generates_a_view_of_the_keystone_state_with_multiple_contracts_of_the_same_type_per_chain 33.3333% false false false 3 1 2 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 1.733333333s @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation, @smartcontractkit/cld-team

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

@vyzaldysanchez vyzaldysanchez enabled auto-merge May 9, 2025 17:56
require.Len(t, viewChain.WorkflowRegistry, 2)
_, ok = viewChain.CapabilityRegistry[capabilityRegistryAddr]
require.True(t, ok)
require.Len(t, viewChain.CapabilityRegistry, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a 2nd cap reg please? use case is active-active setup for aptos datafeeds; they require 2 capability registries

@vyzaldysanchez vyzaldysanchez requested a review from krehermann May 9, 2025 19:37
@cl-sonarqube-production
Copy link

Copy link
Contributor

github-actions bot commented May 9, 2025

Flakeguard Summary

Ran new or updated tests between develop and 062114c (task/CRE-400/refactor-keystone-view-with-datastore).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

1 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestKeystoneView/successfully_generates_a_view_of_the_keystone_state_with_multiple_contracts_of_the_same_type_per_chain 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/keystone/changeset false 1.773333333s @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation, @smartcontractkit/cld-team

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

@vyzaldysanchez vyzaldysanchez added this pull request to the merge queue May 9, 2025
Merged via the queue into develop with commit dee3133 May 9, 2025
135 of 139 checks passed
@vyzaldysanchez vyzaldysanchez deleted the task/CRE-400/refactor-keystone-view-with-datastore branch May 9, 2025 22:55
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