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

save solana pdas in address book #16135

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

save solana pdas in address book #16135

wants to merge 5 commits into from

Conversation

tt-cll
Copy link
Contributor

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

Requires

Supports

Copy link
Contributor

github-actions bot commented Jan 30, 2025

AER Report: CI Core

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

1. Linting error: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment) 2025-01-31T16:02:33.8349125Z ##[error]deployment/ccip/changeset/solana_state.go:107:16: range: should omit 2nd value from range; this loop is equivalent to `for selStr := range ...` (revive)
Golang Lint (deployment) 2025-01-31T16:02:33.8350034Z for selStr, _ := range tvStr.Labels {
Golang Lint (deployment) 2025-01-31T16:02:33.8350317Z ^
Golang Lint (deployment) 2025-01-31T16:02:33.8351948Z ##[error]deployment/ccip/changeset/solana_state.go:117:16: range: should omit 2nd value from range; this loop is equivalent to `for selStr := range ...` (revive)
Golang Lint (deployment) 2025-01-31T16:02:33.8352632Z for selStr, _ := range tvStr.Labels {
Golang Lint (deployment) 2025-01-31T16:02:33.8352909Z ^

Why: The linter revive detected that the second value in the range loop is not being used. This is unnecessary and should be omitted for cleaner code.

Suggested fix: Modify the code to omit the second value in the range loop. Change for selStr, _ := range tvStr.Labels to for selStr := range tvStr.Labels.

2. Test failure: Core Tests (go_core_ccip_deployment_tests)

Source of Error:
Run tests 2025-01-31T16:16:00.2560825Z --- FAIL: TestUpdateNodes (0.39s)
Run tests 2025-01-31T16:16:00.2573458Z --- FAIL: TestUpdateNodes/twos_node,_one_shared_capability (0.04s)
Run tests 2025-01-31T16:16:00.2573979Z update_nodes_test.go:505: 
Run tests 2025-01-31T16:16:00.2575131Z Error Trace: /home/runner/work/chainlink/chainlink/deployment/keystone/changeset/internal/update_nodes_test.go:722
Run tests 2025-01-31T16:16:00.2576959Z /home/runner/work/chainlink/chainlink/deployment/keystone/changeset/internal/update_nodes_test.go:505
Run tests 2025-01-31T16:16:00.2577622Z Error: Not equal: 
Run tests 2025-01-31T16:16:00.2578100Z expected: 0x2
Run tests 2025-01-31T16:16:00.2578570Z actual : 0x1
Run tests 2025-01-31T16:16:00.2579439Z Test: TestUpdateNodes/twos_node,_one_shared_capability
Run tests 2025-01-31T16:16:00.2580264Z Messages: nop ID failed : expected 2, got 1
Run tests 2025-01-31T16:16:00.2580718Z update_nodes_test.go:505: 
Run tests 2025-01-31T16:16:00.2581846Z Error Trace: /home/runner/work/chainlink/chainlink/deployment/keystone/changeset/internal/update_nodes_test.go:722
Run tests 2025-01-31T16:16:00.2583632Z /home/runner/work/chainlink/chainlink/deployment/keystone/changeset/internal/update_nodes_test.go:505
Run tests 2025-01-31T16:16:00.2584300Z Error: Not equal: 
Run tests 2025-01-31T16:16:00.2584763Z expected: 0x1
Run tests 2025-01-31T16:16:00.2585229Z actual : 0x2
Run tests 2025-01-31T16:16:00.2585881Z Test: TestUpdateNodes/twos_node,_one_shared_capability
Run tests 2025-01-31T16:16:00.2586491Z Messages: nop ID failed : expected 1, got 2

Why: The test TestUpdateNodes/twos_node,_one_shared_capability failed because the expected node operator ID did not match the actual ID. This indicates a potential issue in the logic for updating or registering node operators.

Suggested fix: Review the logic in the update_nodes_test.go file, specifically around the registration and updating of node operators. Ensure that the IDs are being assigned and checked correctly.

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@yashnevatia
Copy link
Contributor

As discussed offline, I think we should store the chain selectors instead of storing the source/dest PDAs and then add more flexibility in the values instead of having dynamic types

type SolCCIPChainState struct {
 ..
 // list of remote chains
 // type&Version -> RemoteChainSelcs
 RemoteChainSelcs []uint64 // eg: [1,2,3]


 // map of remote chains to tokens configured for billing
 // type&Version -> RemoteToBillingTokens
 RemoteToBillingTokens map[uint64][]sol.PublicKey // billing_1_TokenA, billing_2_TokenB


 // map of remote chains to tokens configured for tokenPools
 // type&Version -> RemoteToPoolTokens
 RemoteToPoolTokens map[uint64][]sol.PublicKey // pool_1_TokenA, pool_2_TokenB
}

when going from addressBook to state:

  • we first check the static type using switch case, which we do right now
  • we then deserialise the value instead of they dynamic type

@tt-cll
Copy link
Contributor Author

tt-cll commented Jan 30, 2025

As discussed offline, I think we should store the chain selectors instead of storing the source/dest PDAs and then add more flexibility in the values instead of having dynamic types

type SolCCIPChainState struct {
 ..
 // list of remote chains
 // type&Version -> RemoteChainSelcs
 RemoteChainSelcs []uint64 // eg: [1,2,3]


 // map of remote chains to tokens configured for billing
 // type&Version -> RemoteToBillingTokens
 RemoteToBillingTokens map[uint64][]sol.PublicKey // billing_1_TokenA, billing_2_TokenB


 // map of remote chains to tokens configured for tokenPools
 // type&Version -> RemoteToPoolTokens
 RemoteToPoolTokens map[uint64][]sol.PublicKey // pool_1_TokenA, pool_2_TokenB
}

when going from addressBook to state:

  • we first check the static type using switch case, which we do right now
  • we then deserialise the value instead of they dynamic type

will raise this for review after token pool merges

Base automatically changed from solana-token-pool to develop January 31, 2025 10:23
Copy link
Contributor

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.

@tt-cll tt-cll marked this pull request as ready for review January 31, 2025 10:46
@tt-cll tt-cll requested review from AnieeG, kylesmartin and a team as code owners January 31, 2025 10:46
@tt-cll tt-cll changed the title pda ab poc save solana pdas in address book Jan 31, 2025
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.

2 participants