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 token pool & on ramp tooling #16067

Draft
wants to merge 193 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
aaab52e
Adding solchains in NewEnv
yashnevatia Jan 3, 2025
f19598e
Revert "Adding solchains in NewEnv"
yashnevatia Jan 3, 2025
e4f1f05
adding sol chains to newenv
yashnevatia Jan 3, 2025
18d77d1
newEnv needs to send nil
yashnevatia Jan 3, 2025
8150d8d
adding test env setup
yashnevatia Jan 6, 2025
7a2afca
adding link token deployment and test
yashnevatia Jan 6, 2025
7da3b14
adding nil for crib sol chains
yashnevatia Jan 6, 2025
3b1e77a
Merge branch 'solana-updates' of github.com:smartcontractkit/chainlin…
yashnevatia Jan 6, 2025
1c41814
using switch case
yashnevatia Jan 7, 2025
01f39eb
Adding decimal const
yashnevatia Jan 7, 2025
3a4ae18
adding chain selectors commit
yashnevatia Jan 7, 2025
b76324d
go mod tidy
yashnevatia Jan 7, 2025
b8a9542
Merge branch 'solana-updates' of github.com:smartcontractkit/chainlin…
yashnevatia Jan 7, 2025
b36af9d
adding initial code for solana chain contracts deploy
yashnevatia Jan 7, 2025
9d87560
linting
yashnevatia Jan 7, 2025
31cde63
merging
yashnevatia Jan 7, 2025
818f7fb
adding solana state
yashnevatia Jan 7, 2025
98e3890
adding initial code for solana chain contracts deploy
yashnevatia Jan 7, 2025
7c7c36e
wip
yashnevatia Jan 7, 2025
78664bc
wip
yashnevatia Jan 7, 2025
2f98015
chain sel update
yashnevatia Jan 7, 2025
cd73657
update core/scripts go files
yashnevatia Jan 7, 2025
a4ec585
again
yashnevatia Jan 7, 2025
0a2336b
Merge remote-tracking branch 'origin/develop' into solana-updates
tt-cll Jan 7, 2025
c0f35b9
add changeset
tt-cll Jan 7, 2025
720dccb
go imports
yashnevatia Jan 8, 2025
859dd64
Merge branch 'solana-updates' of github.com:smartcontractkit/chainlin…
yashnevatia Jan 8, 2025
c08d092
go mod
yashnevatia Jan 8, 2025
d0882cd
go mod
yashnevatia Jan 8, 2025
1e55e6f
go mod tidy
yashnevatia Jan 8, 2025
8b0f261
lint
yashnevatia Jan 8, 2025
66ff0d3
Merge branch 'solana-link-deploy' of github.com:smartcontractkit/chai…
yashnevatia Jan 8, 2025
a3974dc
todo
yashnevatia Jan 8, 2025
4de2362
Merge branch 'solana-state-updates' of github.com:smartcontractkit/ch…
yashnevatia Jan 8, 2025
90b421e
deploy stuff
yashnevatia Jan 8, 2025
87c289a
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
yashnevatia Jan 8, 2025
a4b2bc6
Adding solana router deploy
yashnevatia Jan 8, 2025
074dacf
Adding
yashnevatia Jan 8, 2025
650a18a
merging
yashnevatia Jan 8, 2025
62d0e00
Merge branch 'solana-link-deploy' of github.com:smartcontractkit/chai…
yashnevatia Jan 8, 2025
7e3b169
updates
yashnevatia Jan 8, 2025
754f858
Merge branch 'solana-state-updates' of github.com:smartcontractkit/ch…
yashnevatia Jan 8, 2025
040ca48
adding stuff for tests
yashnevatia Jan 8, 2025
abb5a01
linting
yashnevatia Jan 8, 2025
e846d6f
Merge branch 'develop' into solana-link-deploy
yashnevatia Jan 9, 2025
58480cf
merging
yashnevatia Jan 9, 2025
f4c69fd
Merge branch 'solana-link-deploy' of github.com:smartcontractkit/chai…
yashnevatia Jan 9, 2025
b4a7781
linting
yashnevatia Jan 9, 2025
b325e8b
Merge branch 'solana-link-deploy' of github.com:smartcontractkit/chai…
yashnevatia Jan 9, 2025
31e8133
changing to ctf
yashnevatia Jan 9, 2025
7fcf845
bug
yashnevatia Jan 9, 2025
723cc1a
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
yashnevatia Jan 9, 2025
d8f5646
merging
yashnevatia Jan 9, 2025
f5a1e9f
Add CI Action to build Solana contracts
jlaveracll Jan 9, 2025
f96c9ac
testing stuff
jlaveracll Jan 9, 2025
9341090
continue testing
jlaveracll Jan 9, 2025
4306ba0
Update action.yml
jlaveracll Jan 9, 2025
7abd473
Update action.yml
jlaveracll Jan 9, 2025
0ff93c0
Update action.yml
jlaveracll Jan 9, 2025
e265c37
Update action.yml
jlaveracll Jan 9, 2025
4e6fbe2
Update action.yml
jlaveracll Jan 9, 2025
f4a06c9
Update action.yml
jlaveracll Jan 9, 2025
ea4ab8b
Update action.yml
jlaveracll Jan 9, 2025
0b18a74
Update action.yml
jlaveracll Jan 9, 2025
12f4c9e
deployment: memory: Generate more transmitter key types, expose in JD
archseer Jan 7, 2025
6c54711
deployment: memory: Configure nodes with solana config too
archseer Jan 7, 2025
ba38563
Use CTF to spin up the solana validator for in-memory tests
archseer Jan 7, 2025
e28b265
Use autopatchelf on solana binaries to make them usable on NixOS
archseer Jan 8, 2025
5429dc5
memory: solana: Shut down the container when test terminates
archseer Jan 9, 2025
c6a65cb
go mod tidy
archseer Jan 10, 2025
480ed0b
Use latest upstream CTF
archseer Jan 10, 2025
6483a93
Add missing import
archseer Jan 10, 2025
ea35285
make modgraph
archseer Jan 10, 2025
1b3fdd6
Use framework.DefaultNetwork()
archseer Jan 10, 2025
b11f530
merging deployment-memory-solana-2
yashnevatia Jan 10, 2025
1382873
merging solana-state-updates
yashnevatia Jan 10, 2025
bd14a29
changes
yashnevatia Jan 10, 2025
c97c9aa
tidying
yashnevatia Jan 10, 2025
dc0c1a7
ignoring keypair if not provided
yashnevatia Jan 10, 2025
18ed1b4
merging
yashnevatia Jan 10, 2025
32776f1
fix
yashnevatia Jan 10, 2025
fa9d9f9
adding solchains to newnodes
yashnevatia Jan 10, 2025
57965b9
adding home chain changes
yashnevatia Jan 10, 2025
5b2e182
delegate changes
yashnevatia Jan 10, 2025
3193928
Update action.yml
jlaveracll Jan 10, 2025
3b9dfd2
Update action.yml
jlaveracll Jan 10, 2025
6215cec
Update action.yml
jlaveracll Jan 10, 2025
150cc41
Update action.yml
jlaveracll Jan 10, 2025
23464d5
Update action.yml
jlaveracll Jan 10, 2025
2938be6
Update action.yml
jlaveracll Jan 10, 2025
c3e59fb
Merge branch 'jlavera/add-ci-action-to-build-contracts' of github.com…
jlaveracll Jan 10, 2025
0b47286
test integrating with CI build step
jlaveracll Jan 10, 2025
5e337b1
working tests
tt-cll Jan 11, 2025
0d01582
bump ccip
tt-cll Jan 11, 2025
0116b79
test fix
jlaveracll Jan 12, 2025
e638d07
save existing solana + tests
tt-cll Jan 12, 2025
84e3239
try reading program ids
jlaveracll Jan 12, 2025
3a4b939
Update action.yml
jlaveracll Jan 13, 2025
8346bd5
Update action.yml
jlaveracll Jan 13, 2025
036108a
Update action.yml
jlaveracll Jan 13, 2025
ce86b2f
Update action.yml
jlaveracll Jan 13, 2025
251077a
Update chain.go
jlaveracll Jan 13, 2025
87e326a
Update action.yml
jlaveracll Jan 13, 2025
1e4a5f4
last try
jlaveracll Jan 13, 2025
e51ecd8
Update action.yml
jlaveracll Jan 13, 2025
b7fbe7e
Update action.yml
jlaveracll Jan 13, 2025
ca3135f
make script executable
jlaveracll Jan 13, 2025
610b8a0
reverting changes to stabilize the branch
jlaveracll Jan 13, 2025
7b6077f
Create ccip_router.so
jlaveracll Jan 13, 2025
da7ae10
go mod tidy
tt-cll Jan 13, 2025
b46abf5
sol chains param
tt-cll Jan 13, 2025
aa31afe
linting
yashnevatia Jan 13, 2025
e113603
adding build here
yashnevatia Jan 13, 2025
1f08be3
try without parallel
tt-cll Jan 13, 2025
ff35f21
yash fixed it!
jlaveracll Jan 13, 2025
4edddaf
Merge remote-tracking branch 'origin/solana-router-deploy' into solan…
tt-cll Jan 13, 2025
8d7878b
function signature
tt-cll Jan 13, 2025
04311ec
Update chain.go
jlaveracll Jan 13, 2025
e4fa6fb
parallel
tt-cll Jan 13, 2025
366e05b
try defer
tt-cll Jan 13, 2025
f9f5fd2
retries
tt-cll Jan 13, 2025
1c849ef
still linting
yashnevatia Jan 14, 2025
e229877
Revert "retries"
tt-cll Jan 14, 2025
85be245
revert
tt-cll Jan 14, 2025
081506a
lint
yashnevatia Jan 14, 2025
c55821c
gomod
tt-cll Jan 14, 2025
95d3869
remove cleanup
tt-cll Jan 14, 2025
50b87ae
fix deps
tt-cll Jan 14, 2025
60afdf4
try empty map
tt-cll Jan 14, 2025
429f87f
Merge pull request #15898 from smartcontractkit/tt/saveExisting
tt-cll Jan 14, 2025
64f6aed
Revert "yash fixed it!"
tt-cll Jan 14, 2025
7ef20dc
remove token info changes
tt-cll Jan 14, 2025
5188fc9
revert function call
tt-cll Jan 14, 2025
14675b1
Merge remote-tracking branch 'origin/solana-router-deploy' into solan…
tt-cll Jan 14, 2025
9149007
revert
tt-cll Jan 14, 2025
cca9295
go mod tidy
tt-cll Jan 14, 2025
0089910
no return
tt-cll Jan 14, 2025
5124bee
try retries
tt-cll Jan 14, 2025
e199014
try returning again
tt-cll Jan 14, 2025
9e7a37f
use CI artifact
tt-cll Jan 14, 2025
97ee0ea
try without ctf bump
tt-cll Jan 14, 2025
c4aac83
CR comments
tt-cll Jan 15, 2025
2bcb88f
lint
tt-cll Jan 15, 2025
551831e
add global lookup table
tt-cll Jan 15, 2025
c785ccf
call utils
tt-cll Jan 15, 2025
cee710d
adding token pool deploy
yashnevatia Jan 16, 2025
2f315cd
test commit
yashnevatia Jan 14, 2025
1efcf8c
adding solana token stufF
yashnevatia Jan 16, 2025
9d86933
adding token pool so
yashnevatia Jan 16, 2025
965e13f
add retries
tt-cll Jan 16, 2025
5bf1660
fix token test
tt-cll Jan 16, 2025
c2f19b8
setup token pool last
tt-cll Jan 16, 2025
f40a326
match lookup table from tests
tt-cll Jan 16, 2025
1f460a7
lint
tt-cll Jan 16, 2025
e0f8349
revert token pool uncomment
tt-cll Jan 16, 2025
7eb9262
skip early return
tt-cll Jan 16, 2025
5e3b4f3
remove retries
tt-cll Jan 16, 2025
998adc7
add ccip receiver to helpers
tt-cll Jan 17, 2025
140c8c5
initial token admin registry
tt-cll Jan 18, 2025
723b4b4
billing
yashnevatia Jan 20, 2025
44724b3
adding billing stuff
yashnevatia Jan 20, 2025
3885e91
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
archseer Jan 21, 2025
40b4677
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
archseer Jan 21, 2025
b9ac3ba
cr comments
tt-cll Jan 21, 2025
0846e3a
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
tt-cll Jan 21, 2025
555943f
fix home chain
tt-cll Jan 21, 2025
bd2bec0
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
tt-cll Jan 22, 2025
a425a5b
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
tt-cll Jan 22, 2025
669006a
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
tt-cll Jan 23, 2025
2eee4d0
test fix
tt-cll Jan 23, 2025
ed247d0
run receiver in CI
tt-cll Jan 23, 2025
fec5e1c
skip receiver again
tt-cll Jan 23, 2025
bbdd802
change set program id
tt-cll Jan 23, 2025
14545b0
addLane for solana
yashnevatia Jan 23, 2025
3652603
clean up supported chain checks
tt-cll Jan 23, 2025
23108da
using AddLane for evm to sol
yashnevatia Jan 24, 2025
a4fa78a
make it one operation
yashnevatia Jan 24, 2025
9c1339c
adding router account check for router init (solana)
yashnevatia Jan 24, 2025
8fef3a1
adding default commitment to solana_chain
yashnevatia Jan 24, 2025
8db0192
Adding support for solana in validateRemoteChain
yashnevatia Jan 24, 2025
9c831e8
Adding test TestUpdateOnRampsDestsSolana
yashnevatia Jan 24, 2025
40ac60c
move to switch
tt-cll Jan 24, 2025
362ee5d
Revmoing solana from UpdateOnRampsDests
yashnevatia Jan 24, 2025
7e620c5
adding separate solana AddRemoteChainToSolana
yashnevatia Jan 24, 2025
e7ec3f7
moving to changeset_solana
yashnevatia Jan 24, 2025
77873f3
Reuse GetAccountDataBorshInto
yashnevatia Jan 24, 2025
11d4214
validation comment
yashnevatia Jan 24, 2025
cfd962e
update test helpers based on AddRemoteChainOnSolana
yashnevatia Jan 24, 2025
d6ae699
AddRemoteChainOnSolana test update
yashnevatia Jan 24, 2025
ed33f25
uncommenting test but this will break
yashnevatia Jan 24, 2025
bde2e41
validation comment
yashnevatia Jan 24, 2025
a809730
Merge branch 'solana-home-chain-update' of github.com:smartcontractki…
yashnevatia Jan 24, 2025
a1355c2
Merge remote-tracking branch 'origin/develop' into solana-home-chain-…
tt-cll Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/build-publish-develop-pr.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: "Build and Publish GoReleaser"

on:
pull_request:
# The default types are opened, synchronize, and reopened
# See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# We add a label trigger too, since when the build-publish label is added to a PR, we want to build and publish
types:
- opened
- synchronize
- reopened
- labeled
push:
branches:
- develop
# pull_request:
# # The default types are opened, synchronize, and reopened
# # See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# # We add a label trigger too, since when the build-publish label is added to a PR, we want to build and publish
# types:
# - opened
# - synchronize
# - reopened
# - labeled
# push:
# branches:
# - develop
workflow_dispatch:
inputs:
git_ref:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-publish-goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "Goreleaser Chainlink"

on:
push:
tags:
- "goreleaser-v*"

# push:
# tags:
# - "goreleaser-v*"
workflow_dispatch:
env:
ECR_HOSTNAME: public.ecr.aws

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-core-partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
fail-fast: false
matrix:
type:
- test-suite: "core"
module-directory: "./"
build-flags: "-tags=integration"
# - test-suite: "core"
# module-directory: "./"
# build-flags: "-tags=integration"
- test-suite: "ccip-deployment"
module-directory: "./deployment"
steps:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ jobs:
fail-fast: false
matrix:
type:
- cmd: go_core_tests
os: ubuntu22.04-32cores-128GB
printResults: true
- cmd: go_core_tests_integration
os: ubuntu22.04-32cores-128GB
printResults: true
# - cmd: go_core_tests
# os: ubuntu22.04-32cores-128GB
# printResults: true
# - cmd: go_core_tests_integration
# os: ubuntu22.04-32cores-128GB
# printResults: true
- cmd: go_core_ccip_deployment_tests
os: ubuntu22.04-32cores-128GB
printResults: true
- cmd: go_core_fuzz
os: ubuntu22.04-8cores-32GB
- cmd: go_core_race_tests
# use 64cores for certain scheduled runs only
os: ${{ needs.run-frequency.outputs.two-per-day-frequency == 'true' && 'ubuntu-latest-64cores-256GB' || 'ubuntu-latest-32cores-128GB' }}
# - cmd: go_core_fuzz
# os: ubuntu22.04-8cores-32GB
# - cmd: go_core_race_tests
# # use 64cores for certain scheduled runs only
# os: ${{ needs.run-frequency.outputs.two-per-day-frequency == 'true' && 'ubuntu-latest-64cores-256GB' || 'ubuntu-latest-32cores-128GB' }}
name: Core Tests (${{ matrix.type.cmd }})
# We don't directly merge dependabot PRs, so let's not waste the resources
if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: 'CodeQL'

on:
push:
branches:
- develop
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]
schedule:
- cron: '23 19 * * 4'
# push:
# branches:
# - develop
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [develop]
# schedule:
# - cron: '23 19 * * 4'
workflow_dispatch:

jobs:
filter:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
name: Integration In-Memory Tests
run-name: Integration In-Memory Tests
on:
merge_group:
pull_request:
push:
tags:
- "*"
# merge_group:
# pull_request:
# push:
# tags:
# - "*"
workflow_dispatch:
inputs:
cl_ref:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
name: Integration Tests
run-name: Integration Tests ${{ inputs.distinct_run_name && inputs.distinct_run_name || '' }}
on:
merge_group:
pull_request:
push:
tags:
- "*"
# merge_group:
# pull_request:
# push:
# tags:
# - "*"
workflow_dispatch:
inputs:
cl_ref:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/solidity-wrappers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ name: Solidity Wrappers
# used for job execution. The jobs in "solidity.yml" are configured around push events, whereas
# we only want to generate gethwrappers during pull requests.
on:
pull_request:
types:
- opened
- synchronize
- reopened
# pull_request:
# types:
# - opened
# - synchronize
# - reopened
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Solidity

on:
merge_group:
push:

# merge_group:
# push:
workflow_dispatch:
defaults:
run:
shell: bash
Expand Down
47 changes: 30 additions & 17 deletions core/capabilities/ccip/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ func (d *Delegate) OnDeleteJob(ctx context.Context, spec job.Job) error {
func (d *Delegate) getOCRKeys(ocrKeyBundleIDs job.JSONConfig) (map[string]ocr2key.KeyBundle, error) {
ocrKeys := make(map[string]ocr2key.KeyBundle)
for networkType, bundleIDRaw := range ocrKeyBundleIDs {
if networkType != relay.NetworkEVM {
return nil, fmt.Errorf("unsupported chain type: %s", networkType)
}

bundleID, ok := bundleIDRaw.(string)
if !ok {
return nil, fmt.Errorf("OCRKeyBundleIDs must be a map of chain types to OCR key bundle IDs, got: %T", bundleIDRaw)
Expand All @@ -273,22 +269,39 @@ func (d *Delegate) getOCRKeys(ocrKeyBundleIDs job.JSONConfig) (map[string]ocr2ke
func (d *Delegate) getTransmitterKeys(ctx context.Context, relayIDs []types.RelayID) (map[types.RelayID][]string, error) {
transmitterKeys := make(map[types.RelayID][]string)
for _, relayID := range relayIDs {
chainID, ok := new(big.Int).SetString(relayID.ChainID, 10)
if !ok {
return nil, fmt.Errorf("error parsing chain ID, expected big int: %s", relayID.ChainID)
}
switch relayID.Network {
case relay.NetworkSolana:
solKeys, err := d.keystore.Solana().GetAll()
if err != nil {
return nil, fmt.Errorf("error getting enabled addresses for chain: %s %w", relayID.ChainID, err)
}

ethKeys, err := d.keystore.Eth().EnabledAddressesForChain(ctx, chainID)
if err != nil {
return nil, fmt.Errorf("error getting enabled addresses for chain: %s %w", chainID.String(), err)
}
transmitterKeys[relayID] = func() (r []string) {
for _, key := range solKeys {
r = append(r, key.PublicKey().String())
}
return
}()
case relay.NetworkEVM:
chainID, ok := new(big.Int).SetString(relayID.ChainID, 10)
if !ok {
return nil, fmt.Errorf("error parsing chain ID, expected big int: %s", relayID.ChainID)
}

transmitterKeys[relayID] = func() (r []string) {
for _, key := range ethKeys {
r = append(r, key.Hex())
ethKeys, err := d.keystore.Eth().EnabledAddressesForChain(ctx, chainID)
if err != nil {
return nil, fmt.Errorf("error getting enabled addresses for chain: %s %w", chainID.String(), err)
}
return
}()

transmitterKeys[relayID] = func() (r []string) {
for _, key := range ethKeys {
r = append(r, key.Hex())
}
return
}()
default:
return nil, fmt.Errorf("unsupported network: %s", relayID.Network)
}
}
return transmitterKeys, nil
}
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/setup_testdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function exit_error {
}
# Create a new user and database for development
# This script is intended to be run on a local development machine
tdir=$(mktemp -d -t db-dev-user)
tdir=$(mktemp -d -t db-dev-user-XXXXXX)

username="chainlink_dev"
password="insecurepassword"
Expand Down
55 changes: 28 additions & 27 deletions deployment/ccip/changeset/cs_add_lane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,45 @@ package changeset_test
import (
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/stretchr/testify/require"
)

func TestAddLanesWithTestRouter(t *testing.T) {
t.Parallel()
e, _ := testhelpers.NewMemoryEnvironment(t)
e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithSolChains(1))
// e, _ := testhelpers.NewMemoryEnvironment(t)

// Here we have CR + nodes set up, but no CCIP contracts deployed.
state, err := changeset.LoadOnchainState(e.Env)
require.NoError(t, err)

selectors := e.Env.AllChainSelectors()
chain1, chain2 := selectors[0], selectors[1]

solanaSelectors := e.Env.AllChainSelectorsSolana()
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, chain1, chain2, true)
// Need to keep track of the block number for each chain so that event subscription can be done from that block.
startBlocks := make(map[uint64]*uint64)
// Send a message from each chain to every other chain.
expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64)
latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil)
require.NoError(t, err)
block := latesthdr.Number.Uint64()
startBlocks[chain2] = &block
msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, chain1, chain2, true, router.ClientEVM2AnyMessage{
Receiver: common.LeftPadBytes(state.Chains[chain2].Receiver.Address().Bytes(), 32),
Data: []byte("hello"),
TokenAmounts: nil,
FeeToken: common.HexToAddress("0x0"),
ExtraArgs: nil,
})
expectedSeqNumExec[testhelpers.SourceDestPair{
SourceChainSelector: chain1,
DestChainSelector: chain2,
}] = []uint64{msgSentEvent.SequenceNumber}
testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &e, state, chain1, solanaSelectors[0], true)

// // Need to keep track of the block number for each chain so that event subscription can be done from that block.
// startBlocks := make(map[uint64]*uint64)solanaSelectors
// // Send a message from each chain to every other chain.
// expectedSeqNumExec := make(map[testhelpers.SourceDestPair][]uint64)
// latesthdr, err := e.Env.Chains[chain2].Client.HeaderByNumber(testcontext.Get(t), nil)
// require.NoError(t, err)
// block := latesthdr.Number.Uint64()
// startBlocks[chain2] = &block
// msgSentEvent := testhelpers.TestSendRequest(t, e.Env, state, chain1, chain2, true, router.ClientEVM2AnyMessage{
// Receiver: common.LeftPadBytes(state.Chains[chain2].Receiver.Address().Bytes(), 32),
// Data: []byte("hello"),
// TokenAmounts: nil,
// FeeToken: common.HexToAddress("0x0"),
// ExtraArgs: nil,
// })
// expectedSeqNumExec[testhelpers.SourceDestPair{
// SourceChainSelector: chain1,
// DestChainSelector: chain2,
// }] = []uint64{msgSentEvent.SequenceNumber}
// testhelpers.ConfirmExecWithSeqNrsForAll(t, e.Env, state, expectedSeqNumExec, startBlocks)
}
Loading
Loading