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

add support for solana on home chain #15826

Draft
wants to merge 100 commits into
base: develop
Choose a base branch
from
Draft

add support for solana on home chain #15826

wants to merge 100 commits into from

Conversation

tt-cll
Copy link
Contributor

@tt-cll tt-cll commented Jan 2, 2025

Copy link
Contributor

github-actions bot commented Jan 2, 2025

AER Report: CI Core

aer_workflow , commit , Clean Go Tidy & Generate , Detect Changes , Scheduled Run Frequency , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , GolangCI Lint (core/scripts) , GolangCI Lint (.) , Core Tests (go_core_race_tests) , GolangCI Lint (integration-tests/load) , test-scripts , GolangCI Lint (integration-tests) , GolangCI Lint (deployment) , lint , SonarQube Scan

1. Linting errors detected

[Golang Lint (deployment)] [2025-01-09T21:11:46.2492294Z] commentFormatting: put a space between // and comment text (gocritic)

Source of Error:
//ccip_router.SetProgramID(pub)
**Why**: The comment does not have a space between `//` and the comment text, which violates the `gocritic` linting rule. **Suggested fix**: Add a space between `//` and the comment text.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2496456Z] commentFormatting: put a space between // and comment text (gocritic)

Source of Error:
//ccip_receiver.SetProgramID(pub)
**Why**: The comment does not have a space between `//` and the comment text, which violates the `gocritic` linting rule. **Suggested fix**: Add a space between `//` and the comment text.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2499102Z] commentFormatting: put a space between // and comment text (gocritic)

Source of Error:
//token_pool.SetProgramID(pub)
**Why**: The comment does not have a space between `//` and the comment text, which violates the `gocritic` linting rule. **Suggested fix**: Add a space between `//` and the comment text.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2500750Z] appendAssign: append result not assigned to the same slice (gocritic)

Source of Error:
selectors := append(evmSelectors, solChainSelectors...)
**Why**: The result of `append` is not assigned back to the same slice, which violates the `gocritic` linting rule. **Suggested fix**: Assign the result of `append` back to the same slice.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2504063Z] File is not goimports-ed with -local github.com/smartcontractkit/chainlink (goimports)

Source of Error:
"github.com/gagliardetto/solana-go"
**Why**: The file is not formatted with `goimports` using the `-local` flag for the specified package. **Suggested fix**: Run `goimports` with the `-local github.com/smartcontractkit/chainlink` flag.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2504930Z] File is not goimports-ed with -local github.com/smartcontractkit/chainlink (goimports)

Source of Error:
solana "github.com/gagliardetto/solana-go"
**Why**: The file is not formatted with `goimports` using the `-local` flag for the specified package. **Suggested fix**: Run `goimports` with the `-local github.com/smartcontractkit/chainlink` flag.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2506693Z] File is not goimports-ed with -local github.com/smartcontractkit/chainlink (goimports)

Source of Error:
chain_selectors "github.com/smartcontractkit/chain-selectors"
**Why**: The file is not formatted with `goimports` using the `-local` flag for the specified package. **Suggested fix**: Run `goimports` with the `-local github.com/smartcontractkit/chainlink` flag.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2510054Z] G115: integer overflow conversion int -> uint8 (gosec)

Source of Error:
FChain: uint8(len(nodes.NonBootstraps().PeerIDs()) / 3),
**Why**: The conversion from `int` to `uint8` can cause an integer overflow, which violates the `gosec` linting rule. **Suggested fix**: Ensure the value being converted fits within the range of `uint8`.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2513234Z] Consider pre-allocating ocr3Configs (prealloc)

Source of Error:
var ocr3Configs []MultiOCR3BaseOCRConfigArgsSolana
**Why**: Pre-allocating the slice can improve performance by reducing the number of allocations. **Suggested fix**: Pre-allocate the slice with an appropriate capacity.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2516257Z] indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)

Source of Error:
} else {
    e.Logger.Infow("Confirmed instruction", "instruction", instruction)
}
**Why**: The `else` block is unnecessary because the `if` block ends with a `return` statement. **Suggested fix**: Remove the `else` block and outdent its contents.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2519693Z] var-naming: var p2pIds should be p2pIDs (revive)

Source of Error:
p2pIds := nodes.NonBootstraps().PeerIDs()
**Why**: The variable name does not follow the standard naming convention. **Suggested fix**: Rename the variable to `p2pIDs`.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2522191Z] var-naming: var ccipRouterId should be ccipRouterID (revive)

Source of Error:
ccipRouterId := state.SolChains[chainSel].SolCcipRouter
**Why**: The variable name does not follow the standard naming convention. **Suggested fix**: Rename the variable to `ccipRouterID`.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2524663Z] var-naming: var ccipRouterId should be ccipRouterID (revive)

Source of Error:
ccipRouterId := solChains[remote].SolCcipRouter
**Why**: The variable name does not follow the standard naming convention. **Suggested fix**: Rename the variable to `ccipRouterID`.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2526752Z] unnecessary conversion (unconvert)

Source of Error:
uint8(arg.OcrPluginType),
**Why**: The conversion is unnecessary and can be removed. **Suggested fix**: Remove the unnecessary conversion.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2529381Z] unnecessary conversion (unconvert)

Source of Error:
IsSignatureVerificationEnabled: uint8(btoi(arg.IsSignatureVerificationEnabled)),
**Why**: The conversion is unnecessary and can be removed. **Suggested fix**: Remove the unnecessary conversion.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2532017Z] unnecessary trailing newline (whitespace)

Source of Error:
**Why**: The file contains an unnecessary trailing newline. **Suggested fix**: Remove the trailing newline.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2533664Z] unnecessary trailing newline (whitespace)

Source of Error:
**Why**: The file contains an unnecessary trailing newline. **Suggested fix**: Remove the trailing newline.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2535260Z] unnecessary trailing newline (whitespace)

Source of Error:
**Why**: The file contains an unnecessary trailing newline. **Suggested fix**: Remove the trailing newline.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2538163Z] non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)

Source of Error:
return deployment.ChangesetOutput{}, fmt.Errorf("failed to generate instructions: %v", err)
**Why**: The error formatting does not use the `%w` verb for wrapping errors. **Suggested fix**: Use `%w` to wrap the error.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2542877Z] non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)

Source of Error:
return deployment.ChangesetOutput{}, fmt.Errorf("failed to confirm instructions: %v", err)
**Why**: The error formatting does not use the `%w` verb for wrapping errors. **Suggested fix**: Use `%w` to wrap the error.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2547360Z] non-wrapping format verb for fmt.Errorf. Use %w to format errors (errorlint)

Source of Error:
return fmt.Errorf("failed to save address: %v", err)
**Why**: The error formatting does not use the `%w` verb for wrapping errors. **Suggested fix**: Use `%w` to wrap the error.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2551886Z] printf: non-constant format string in call to (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Infof (govet)

Source of Error:
lggr.Infof(fmt.Sprintf("%+v", sourceChainStateAccount.State))
**Why**: The format string is not constant, which violates the `govet` linting rule. **Suggested fix**: Use a constant format string.

[Golang Lint (deployment)] [2025-01-09T21:11:46.2554360Z] bool-compare: use require.True (testifylint)

Source of Error:
require.Equal(t, true, sourceChainStateAccount.Config.IsEnabled)
**Why**: The boolean comparison should use `require.True` for better readability. **Suggested fix**: Use `require.True(t, sourceChainStateAccount.Config.IsEnabled)`.

2. Test failures detected

[Run tests] [2025-01-09T21:15:09.3503227Z] Test failures

Source of Error:
FAIL	github.com/smartcontractkit/chainlink/deployment/ccip/changeset	296.506s
**Why**: The test suite for `ccip/changeset` failed, causing the overall test run to fail. **Suggested fix**: Investigate the specific test failures in the `ccip/changeset` package and address the issues causing the tests to fail.

3. Uncommitted changes detected

[Ensure clean after generate] [2025-01-09T21:15:40.8087852Z] Uncommitted changes detected

Source of Error:
go.md | 4 ++++
1 file changed, 4 insertions(+)
**Why**: There are uncommitted changes in the `go.md` file after running the generate step. **Suggested fix**: Commit the changes in the `go.md` file or ensure that the generate step does not produce uncommitted changes.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit


// ValidateState validates the state of the CCIP deployment
func (s CCIPOnChainState) ValidateState(chainSelector uint64) error {
if deployment.IsSolanaChainFamily(chainSelector) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe just inline this and use switch/case? We'll be adding more conditionals here as chains are added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah good idea

@tt-cll tt-cll changed the base branch from yn-solana to deployment-memory-solana January 8, 2025 18:11
@tt-cll tt-cll changed the base branch from deployment-memory-solana to solana-memory-node January 9, 2025 09:44
Copy link
Contributor

github-actions bot commented Jan 9, 2025

I see you updated files related to core. Please run pnpm changeset 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.

🎖️ No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these.

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)
23 New Major Issues (required ≤ 5)
C Security 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

@yashnevatia yashnevatia changed the base branch from solana-memory-node to solana-router-deploy January 10, 2025 11:16
@yashnevatia yashnevatia changed the base branch from solana-router-deploy to develop January 10, 2025 14:02
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.

4 participants