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

Solana router deploy (D) #15871

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

Solana router deploy (D) #15871

wants to merge 159 commits into from

Conversation

yashnevatia
Copy link
Contributor

@yashnevatia yashnevatia commented Jan 8, 2025

Adding router deploy for solana

NOTE: uploading the .so and the corresponding keypair for initial dev efforts

TODO:

  • Use CI loaded artifacts (delete pushed artifact)
  • replace hardcoded ccipRouterProgramid to using testConfig defined in chainlink-ccip

Requires

#15870

Supports

@archseer
Copy link
Contributor

Let's move any remaining changes into #15892 and merge that instead?

@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Jan 21, 2025
@tt-cll
Copy link
Contributor

tt-cll commented Jan 21, 2025

Let's move any remaining changes into #15892 and merge that instead?

yes I think we just want to get the router deploy and CI changes fixed here and the rest can go into the home chain PR

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 00363c1 (solana-router-deploy).

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
TestDeployCCIPContracts N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestDeployChainContractsChangeset N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestDeployHomeChain N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestDeployPrerequisites N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestJobSpecChangeset N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestRMNCurseIdempotent 0.00% true true false 6 0 6 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestRMNCurseIdempotent/chain_duplicate_CURSE_IDEMPOTENT_NO_MCMS N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation
Test_NewAcceptOwnershipChangeset N/A false false false 0 0 0 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

Comment on lines +101 to +104
privateKeyBytes, err := base58.Decode(privateKey.String())
if err != nil {
return solana.PrivateKey{}, "", fmt.Errorf("failed to decode private key: %w", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just cast the type, it's already []byte

Suggested change
privateKeyBytes, err := base58.Decode(privateKey.String())
if err != nil {
return solana.PrivateKey{}, "", fmt.Errorf("failed to decode private key: %w", err)
}
privateKeyBytes := []byte(privateKey)

Copy link
Contributor

Choose a reason for hiding this comment

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

Will handle this in the home chain PR

// SolChainState holds a Go binding for all the currently deployed CCIP programs
// on a chain. If a binding is nil, it means here is no such contract on the chain.
type SolCCIPChainState struct {
LinkToken solana.PublicKey
SolCcipRouter solana.PublicKey
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
SolCcipRouter solana.PublicKey
CCIPRouter solana.PublicKey

Copy link
Contributor

Choose a reason for hiding this comment

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

Will handle this in the home chain PR

Comment on lines +74 to +102
// GetRouterStatePDA returns the PDA for the "state" account.
func GetRouterStatePDA(ccipRouterProgramID solana.PublicKey) solana.PublicKey {
pda, _, _ := solana.FindProgramAddress(
[][]byte{[]byte("state")},
ccipRouterProgramID,
)
return pda
}

// GetExternalExecutionConfigPDA returns the PDA for the "external_execution_config" account.
func GetExternalExecutionConfigPDA(ccipRouterProgramID solana.PublicKey) solana.PublicKey {
pda, _, _ := solana.FindProgramAddress(
[][]byte{[]byte("external_execution_config")},
ccipRouterProgramID,
)
return pda
}

// GetExternalTokenPoolsSignerPDA returns the PDA for the "external_token_pools_signer" account.
func GetExternalTokenPoolsSignerPDA(ccipRouterProgramID solana.PublicKey) solana.PublicKey {
pda, _, _ := solana.FindProgramAddress(
[][]byte{[]byte("external_token_pools_signer")},
ccipRouterProgramID,
)
return pda
}

// GetSolanaSourceChainStatePDA returns the PDA for the "source_chain_state" account for Solana.
func GetSolanaSourceChainStatePDA(ccipRouterProgramID solana.PublicKey, solanaChainSelector uint64) solana.PublicKey {
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.

when we originally started these changes, these weren't available. It looks like right now those are hardcoded to use the test config. We can refactor but might want to do it in a followup. https://github.com/smartcontractkit/chainlink-ccip/blob/60504624690889155c2cc5aea142d2af7733f5e3/chains/solana/contracts/tests/config/ccip_config.go#L16

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and d6e23db (solana-router-deploy).

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
TestDeployChainContractsChangeset 0.00% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset false 7.556666666s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

Copy link
Contributor

@tt-cll tt-cll left a comment

Choose a reason for hiding this comment

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

will handle any comments in #15892

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