Skip to content
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

Keystone in CRIB #14326

Open
wants to merge 120 commits into
base: develop
Choose a base branch
from

Conversation

HenryNguyen5
Copy link
Collaborator

@HenryNguyen5 HenryNguyen5 commented Sep 4, 2024

This PR enables keystone in CRIB. In summary, it:

Note that a good portion of this code will be replaced with work done at chainlink/deployments. It's better IMO to get this merged in sooner rather than later to begin integration work with chainlink/deployments ASAP to avoid continuing duplicate implementations of the same provisioning logic.

TODO:

  • Set mod refs back to their original versions via make gomodslocalupdate
  • Update chainlink aptos to reflect new repo ref

@HenryNguyen5 HenryNguyen5 changed the title CRIB 322 keystone evm contract deployment tooling KIAB Streams Trigger Provisioner Sep 4, 2024
@HenryNguyen5 HenryNguyen5 force-pushed the CRIB-322-keystone-evm-contract-deployment-tooling branch 3 times, most recently from eaad372 to 7abd46d Compare September 18, 2024 23:59
@HenryNguyen5 HenryNguyen5 force-pushed the CRIB-322-keystone-evm-contract-deployment-tooling branch from 6537149 to f0b0226 Compare September 25, 2024 23:00
@HenryNguyen5 HenryNguyen5 force-pushed the CRIB-322-keystone-evm-contract-deployment-tooling branch 2 times, most recently from 3a10b2a to 7dfbe68 Compare October 17, 2024 06:21
Copy link
Contributor

github-actions bot commented Oct 17, 2024

AER Report: CI Core

aer_workflow , commit , Detect Changes , Scheduled Run Frequency , Clean Go Tidy & Generate , Flakeguard Root Project / Get Tests To Run , GolangCI Lint (core/scripts) , GolangCI Lint (.) , GolangCI Lint (integration-tests) , GolangCI Lint (deployment) , GolangCI Lint (tools/goreleaser-config) , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , test-scripts , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , Core Tests (go_core_race_tests) , Flakeguard Deployment Project / Get Tests To Run , Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core/cmd, ubuntu-latest) , Flakeguard Deployment Project / Run Tests , Flakeguard Deployment Project / Report , lint , Flakeguard Root Project / Report , SonarQube Scan , Flakey Test Detection

1. File is not goimports-ed with -local:

Job ID: Golang Lint (core/scripts)

Source of Error:
Golang Lint (core/scripts)	2024-12-20T19:09:01.9026003Z core/scripts/keystone/src/88_contracts_helpers.go:14: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint (core/scripts)	2024-12-20T19:09:01.9028115Z 	"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"

Why: The file 88_contracts_helpers.go in the core/scripts/keystone/src directory is not formatted according to the goimports tool with the -local flag set to github.com/smartcontractkit/chainlink.

Suggested fix: Run goimports -local github.com/smartcontractkit/chainlink -w core/scripts/keystone/src/88_contracts_helpers.go to format the file correctly.

2. Test failure in github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/executable:

Job ID: Run tests

Source of Error:
Run tests	2024-12-20T19:19:33.8032165Z FAIL
Run tests	2024-12-20T19:19:33.8032593Z FAIL	github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/executable	634.377s

Why: The test suite for github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/executable failed, which caused the overall test run to fail.

Suggested fix: Investigate the specific test cases within core/capabilities/remote/executable to identify the root cause of the failure. Check for any recent changes that might have introduced the issue and ensure that all dependencies and configurations are correct.

3. Encountered test failures:

Job ID: Run tests

Source of Error:
Run tests	2024-12-20T19:19:34.7994372Z go_core_tests exiting with code 1
Run tests	2024-12-20T19:19:34.8009898Z ##[error]Process completed with exit code 1.

Why: The test suite encountered failures, leading to an exit code of 1, which indicates that not all tests passed successfully.

Suggested fix: Review the test logs to identify all failing tests. Address the issues causing the test failures, which may involve fixing bugs, updating test cases, or adjusting configurations.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@HenryNguyen5 HenryNguyen5 force-pushed the CRIB-322-keystone-evm-contract-deployment-tooling branch 2 times, most recently from 357886c to 9864099 Compare October 25, 2024 16:28
@HenryNguyen5 HenryNguyen5 force-pushed the CRIB-322-keystone-evm-contract-deployment-tooling branch from 7f49528 to b658c21 Compare October 30, 2024 22:33
@HenryNguyen5 HenryNguyen5 marked this pull request as ready for review October 30, 2024 22:33
@HenryNguyen5 HenryNguyen5 requested review from a team as code owners October 30, 2024 22:33
core/services/relay/evm/mercury/transmitter.go Outdated Show resolved Hide resolved
PanicErr(err)

jsonRPCClient, err := rpc.Dial(ethURL)
insecureSkipVerify := os.Getenv("INSECURE_SKIP_VERIFY") == "true"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed to add this since CRIB can run locally via kind, which uses https but a locally generated cert

src.NewDeployJobSpecsCommand(),
src.NewGenerateCribClusterOverridesCommand(),
src.NewDeleteJobsCommand(),
src.NewProvisionKeystoneCommand(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For reviewers: This is the main entrypoint, CRIB scripts call into this command only to provision everything. All other commands below are essentially subcmds of this one

src.NewPreprovisionCribCommand(),
src.NewPostprovisionCribCommand(),
src.NewProvisionCapabilitesRegistryCommand(),
src.NewProvisionStreamsTriggerCommand(),
src.NewDeployAndInitializeCapabilitiesRegistryCommand(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cedric-cordenier Can we remove this? I kept it around because I wasnt sure if the team needs this. NewProvisionCapabilitesRegistryCommand handles provisioning CR for crib

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we can remove this if NewProvisionCapabilitesRegistryCommand handles it.

core/scripts/keystone/main.go Outdated Show resolved Hide resolved
return "provision-keystone"
}

func (g *provisionKeystone) Run(args []string) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For reviewers: This is the main entrypoint to keystone in CRIB

core/scripts/keystone/src/02_deploy_keystone_workflows.go Outdated Show resolved Hide resolved
@HenryNguyen5 HenryNguyen5 changed the title KIAB Streams Trigger Provisioner Keystone in CRIB Oct 30, 2024
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

krehermann
krehermann previously approved these changes Oct 31, 2024
core/scripts/go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

Flaky Test Detector for github.com/smartcontractkit/chainlink project has failed ❌

Ran new or updated tests between develop and e6c4a3c (CRIB-322-keystone-evm-contract-deployment-tooling).

View Flaky Detector Details | Compare Changes

Flaky Tests

Ran 271 unique tests. Below are the tests identified as flaky, with a pass ratio lower than the 99% threshold:

TestPackage                                        TestName                               PassRatio  RunCount   Skipped
---------                                          ---------                              ---------  ---------  ---------
github.com/smartcontractkit/chainlink/v2/core/cmd  TestShell_ImportExportETHKey_NoChains  67%        3          false
github.com/smartcontractkit/chainlink/v2/core/cmd  TestShell_ListETHKeys_Error            67%        3          false
github.com/smartcontractkit/chainlink/v2/core/cmd  TestShell_CreateETHKey                 67%        3          false

… into CRIB-322-keystone-evm-contract-deployment-tooling
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 4aea6f7 (CRIB-322-keystone-evm-contract-deployment-tooling).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestShell_ListETHKeys 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.173333333s Unknown

Artifacts

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

@HenryNguyen5 HenryNguyen5 requested a review from a team as a code owner December 12, 2024 01:10
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and de1a8f5 (CRIB-322-keystone-evm-contract-deployment-tooling).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestShell_ImportExportETHKey_NoChains 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.306666666s Unknown
TestShell_ListETHKeys 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.26s Unknown

Artifacts

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

core/scripts/keystone/src/99_app.go Dismissed Show dismissed Hide dismissed
core/scripts/keystone/src/99_app.go Dismissed Show dismissed Hide dismissed
core/scripts/keystone/src/99_app.go Dismissed Show dismissed Hide dismissed
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and f4bb112 (CRIB-322-keystone-evm-contract-deployment-tooling).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestShell_ImportExportETHKey_NoChains 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.293333333s Unknown
TestShell_ListETHKeys_Error 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.27s Unknown

Artifacts

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

@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/tools/goreleaser-config

go 1.23.0
go 1.22.8
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 intentional?

Copy link
Collaborator Author

@HenryNguyen5 HenryNguyen5 Dec 20, 2024

Choose a reason for hiding this comment

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

i want to say yes, but i do not remember the reasoning behind it now :/. I could try setting it back and seeing it it breaks any tooling

}

func ensureArtefactsDir(artefactsDir string) {
_, err := os.Stat(artefactsDir)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be checking for a certain kind of error? https://pkg.go.dev/os#IsNotExist

"github.com/stretchr/testify/assert"
)

func TestMustReadNodesList(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func TestMustReadNodesList(t *testing.T) {
func Test_mustReadNodesList(t *testing.T) {

Copy link
Contributor

@krehermann krehermann left a comment

Choose a reason for hiding this comment

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

This looks good to me

Main request: A README about how to use the tools so that I can push it forward next year

  • minimal cmds to start, run, stop
  • cfg or permission required to use it
  • known limitations

and anything keystone specific that isn't covered in normal crib implementations

@justinkaseman justinkaseman self-requested a review December 20, 2024 22:37
Copy link
Contributor

@justinkaseman justinkaseman left a comment

Choose a reason for hiding this comment

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

This looks good to me

Main request: A README about how to use the tools so that I can push it forward next year

minimal cmds to start, run, stop
cfg or permission required to use it
known limitations
and anything keystone specific that isn't covered in normal crib implementations

I'll pair with Henry early next week to take notes / record a video on this

PR LGTM at a glance, approving to get out of rebase hell, with further usage next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-publish Build and Publish image to SDLC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants