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

Improvement in naming changesets #15943

Merged
merged 36 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ded3f4c
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 7, 2024
10314c8
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 10, 2024
5f14bf0
remove deployCCIPContracts
AnieeG Dec 10, 2024
75c676f
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 10, 2024
b31ec5a
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 10, 2024
5f6d2d5
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 13, 2024
65616ff
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 13, 2024
6dd9c4a
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 13, 2024
813cc6e
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 18, 2024
a299e7c
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Dec 19, 2024
1837b21
deprecate existing add lane
AnieeG Dec 20, 2024
bda53fc
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 3, 2025
e171316
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 6, 2025
52422ba
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 9, 2025
56b0ff1
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 10, 2025
e261d27
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 14, 2025
35d936e
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG Jan 15, 2025
59e995c
making OCR input more user friendly
AnieeG Jan 15, 2025
5e37b44
rename changesets
AnieeG Jan 15, 2025
1da2ad1
fix lint errors
AnieeG Jan 15, 2025
7bc1ac4
fix
AnieeG Jan 15, 2025
0fb138c
further rename
AnieeG Jan 15, 2025
5f0f701
populate addresses from state for 1.5
AnieeG Jan 16, 2025
e16d28c
move test related methods to test package
AnieeG Jan 16, 2025
7e15cc6
updates
AnieeG Jan 16, 2025
8f2aa3f
more fix
AnieeG Jan 16, 2025
a01635c
Merge branch 'backup-fixes-for-staging' into fixes-for-staging
AnieeG Jan 16, 2025
d8a707a
create new package for test
AnieeG Jan 16, 2025
6d5a3da
another move
AnieeG Jan 16, 2025
9f7ae90
more fixes
AnieeG Jan 16, 2025
7d461eb
fix lint
AnieeG Jan 16, 2025
22f5df0
fix file path
AnieeG Jan 16, 2025
533c7ed
fix file path
AnieeG Jan 16, 2025
7c5af73
go mod tidy
AnieeG Jan 16, 2025
8411f36
merge with develop
AnieeG Jan 16, 2025
85fa2e2
review comments
AnieeG Jan 16, 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
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
AnieeG committed Jan 16, 2025
commit 7d461eb54c7a6f940718de95494fbbd4b37bfa73
2 changes: 1 addition & 1 deletion deployment/ccip/changeset/cs_deploy_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestDeployChainContractsChangeset(t *testing.T) {
for _, chain := range e.AllChainSelectors() {
cfg[chain] = proposalutils.SingleGroupTimelockConfig(t)
}
var prereqCfg []changeset.DeployPrerequisiteConfigPerChain
prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0)
for _, chain := range e.AllChainSelectors() {
prereqCfg = append(prereqCfg, changeset.DeployPrerequisiteConfigPerChain{
ChainSelector: chain,
Expand Down
14 changes: 7 additions & 7 deletions deployment/ccip/changeset/cs_update_rmn_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ import (
)

var (
rmn_staging_1 = changeset.RMNNopConfig{
rmnStaging1 = changeset.RMNNopConfig{
NodeIndex: 0,
PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWRXxZq3pd4a3ZGkKj7Nt1SQQrnB8CuvbPnnV9KVeMeWqg"),
OffchainPublicKey: [32]byte(common.FromHex("0xb34944857a42444d1b285d7940d6e06682309e0781e43a69676ee9f85c73c2d1")),
EVMOnChainPublicKey: common.HexToAddress("0x5af8ee32316a6427f169a45fdc1b3a91a85ac459e3c1cb91c69e1c51f0c1fc21"),
}
rmn_staging_2 = changeset.RMNNopConfig{
rmnStaging2 = changeset.RMNNopConfig{
NodeIndex: 1,
PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWEmdxYQFsRbD9aFczF32zA3CcUwuSiWCk2CrmACo4v9RL"),
OffchainPublicKey: [32]byte(common.FromHex("0x68d9f3f274e3985528a923a9bace3d39c55dd778b187b4120b384cc48c892859")),
EVMOnChainPublicKey: common.HexToAddress("0x858589216956f482a0f68b282a7050af4cd48ed2"),
}
rmn_staging_3 = changeset.RMNNopConfig{
rmnStaging3 = changeset.RMNNopConfig{
NodeIndex: 2,
PeerId: deployment.MustPeerIDFromString("p2p_12D3KooWJS42cNXKJvj6DeZnxEX7aGxhEuap6uNFrz554AbUDw6Q"),
OffchainPublicKey: [32]byte(common.FromHex("0x5af8ee32316a6427f169a45fdc1b3a91a85ac459e3c1cb91c69e1c51f0c1fc21")),
Expand All @@ -49,12 +49,12 @@ func TestUpdateRMNConfig(t *testing.T) {
{
useMCMS: true,
name: "with MCMS",
nops: []changeset.RMNNopConfig{rmn_staging_1, rmn_staging_2, rmn_staging_3},
nops: []changeset.RMNNopConfig{rmnStaging1, rmnStaging2, rmnStaging3},
},
{
useMCMS: false,
name: "without MCMS",
nops: []changeset.RMNNopConfig{rmn_staging_1, rmn_staging_2, rmn_staging_3},
nops: []changeset.RMNNopConfig{rmnStaging1, rmnStaging2, rmnStaging3},
},
}

Expand Down Expand Up @@ -101,7 +101,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) {
previousActiveDigest, err := rmnHome.GetActiveDigest(nil)
require.NoError(t, err)

var mcmsConfig *changeset.MCMSConfig = nil
var mcmsConfig *changeset.MCMSConfig

if tc.useMCMS {
mcmsConfig = &changeset.MCMSConfig{
Expand Down Expand Up @@ -226,7 +226,7 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) {
allChains := e.Env.AllChainSelectors()
mcmsCfg := make(map[uint64]commontypes.MCMSWithTimelockConfig)
var err error
var prereqCfgs []changeset.DeployPrerequisiteConfigPerChain
prereqCfgs := make([]changeset.DeployPrerequisiteConfigPerChain, 0)
for _, c := range e.Env.AllChainSelectors() {
mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t)
prereqCfgs = append(prereqCfgs, changeset.DeployPrerequisiteConfigPerChain{
Expand Down
4 changes: 2 additions & 2 deletions deployment/ccip/changeset/testhelpers/test_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func NewEnvironmentWithPrerequisitesContracts(t *testing.T, tEnv TestEnvironment
for _, c := range e.Env.AllChainSelectors() {
mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t)
}
var prereqCfg []changeset.DeployPrerequisiteConfigPerChain
prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0)
for _, chain := range allChains {
var opts []changeset.PrerequisiteOpt
if tc != nil {
Expand Down Expand Up @@ -423,7 +423,7 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl
mcmsCfg[c] = proposalutils.SingleGroupTimelockConfig(t)
}

var prereqCfg []changeset.DeployPrerequisiteConfigPerChain
prereqCfg := make([]changeset.DeployPrerequisiteConfigPerChain, 0)
for _, chain := range allChains {
var opts []changeset.PrerequisiteOpt
if tc != nil {
Expand Down
2 changes: 1 addition & 1 deletion deployment/ccip/changeset/testhelpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/services/relay"

"github.com/ethereum/go-ethereum/common"
Expand All @@ -47,7 +48,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/mock_ethusd_aggregator_wrapper"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/aggregator_v3_interface"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/burn_mint_erc677"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/mock_v3_aggregator_contract"
Expand Down
8 changes: 4 additions & 4 deletions deployment/ccip/changeset/testhelpers/v1_5/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ func LaneConfigsForChains(t *testing.T, env deployment.Environment, state change
[]v1_5changeset.ExecuteOCR2ConfigParams,
[]v1_5changeset.JobSpecInput,
) {
var addLanesCfg []v1_5changeset.DeployLaneConfig
var commitOCR2Configs []v1_5changeset.CommitOCR2ConfigParams
var execOCR2Configs []v1_5changeset.ExecuteOCR2ConfigParams
var jobSpecs []v1_5changeset.JobSpecInput
addLanesCfg := make([]v1_5changeset.DeployLaneConfig, 0)
commitOCR2Configs := make([]v1_5changeset.CommitOCR2ConfigParams, 0)
execOCR2Configs := make([]v1_5changeset.ExecuteOCR2ConfigParams, 0)
jobSpecs := make([]v1_5changeset.JobSpecInput, 0)
for _, pair := range pairs {
dest := pair.DestChainSelector
src := pair.SourceChainSelector
Expand Down
2 changes: 0 additions & 2 deletions deployment/ccip/changeset/token_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ const (
WethDecimals = 18
UsdcDecimals = 6
// MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract
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
// MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract
// MockLinkAggregatorDescription is the description of the MockV3Aggregator.sol contract

//nolint:lll
// https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/tests/MockV3Aggregator.sol#L76-L76
MockLinkAggregatorDescription = "v0.8/tests/MockV3Aggregator.sol"
// MockWETHAggregatorDescription WETH use description from MockETHUSDAggregator.sol
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is unintelligible, maybe

Suggested change
// MockWETHAggregatorDescription WETH use description from MockETHUSDAggregator.sol
// MockWETHAggregatorDescription is the description from MockETHUSDAggregator.sol

//nolint:lll
// https://github.com/smartcontractkit/chainlink/blob/a348b98e90527520049c580000a86fb8ceff7fa7/contracts/src/v0.8/automation/testhelpers/MockETHUSDAggregator.sol#L19-L19
MockWETHAggregatorDescription = "MockETHUSDAggregator"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package contracts
package smoke

import (
"context"
Expand All @@ -18,6 +18,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"

"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers"
"github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight"

"github.com/smartcontractkit/chainlink-ccip/plugintypes"
Expand Down Expand Up @@ -590,15 +591,15 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
//env := NewMemoryEnvironmentContractsOnly(t, logger.TestLogger(t), 2, 4, nil)
env, _ := changeset.NewMemoryEnvironment(t)
env, _ := testhelpers.NewMemoryEnvironment(t)
state, err := changeset.LoadOnchainState(env.Env)
require.NoError(t, err)

selectors := env.Env.AllChainSelectors()
destChain, srcChain := selectors[0], selectors[1]

changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, destChain, srcChain, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, srcChain, destChain, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, destChain, srcChain, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, srcChain, destChain, false)

reader := testSetupRealContracts(
ctx,
Expand All @@ -619,8 +620,8 @@ func TestCCIPReader_GetExpectedNextSequenceNumber(t *testing.T) {
maxExpectedSeqNum := uint64(10)
var i uint64
for i = 1; i < maxExpectedSeqNum; i++ {
msg := changeset.DefaultRouterMessage(state.Chains[destChain].Receiver.Address())
msgSentEvent := changeset.TestSendRequest(t, env.Env, state, srcChain, destChain, false, msg)
msg := testhelpers.DefaultRouterMessage(state.Chains[destChain].Receiver.Address())
msgSentEvent := testhelpers.TestSendRequest(t, env.Env, state, srcChain, destChain, false, msg)
require.Equal(t, uint64(i), msgSentEvent.SequenceNumber)
require.Equal(t, uint64(i), msgSentEvent.Message.Header.Nonce) // check outbound nonce incremented
seqNum, err2 := reader.GetExpectedNextSequenceNumber(ctx, cs(srcChain), cs(destChain))
Expand Down Expand Up @@ -700,15 +701,15 @@ func TestCCIPReader_Nonces(t *testing.T) {
func Test_GetChainFeePriceUpdates(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
env, _ := changeset.NewMemoryEnvironment(t)
env, _ := testhelpers.NewMemoryEnvironment(t)
state, err := changeset.LoadOnchainState(env.Env)
require.NoError(t, err)

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

changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)

// Change the gas price for chain2
feeQuoter := state.Chains[chain1].FeeQuoter
Expand Down Expand Up @@ -756,15 +757,15 @@ func Test_GetChainFeePriceUpdates(t *testing.T) {
func Test_LinkPriceUSD(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
env, _ := changeset.NewMemoryEnvironment(t)
env, _ := testhelpers.NewMemoryEnvironment(t)
state, err := changeset.LoadOnchainState(env.Env)
require.NoError(t, err)

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

changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)

reader := testSetupRealContracts(
ctx,
Expand All @@ -785,22 +786,22 @@ func Test_LinkPriceUSD(t *testing.T) {
linkPriceUSD, err := reader.LinkPriceUSD(ctx)
require.NoError(t, err)
require.NotNil(t, linkPriceUSD.Int)
require.Equal(t, changeset.DefaultLinkPrice, linkPriceUSD.Int)
require.Equal(t, testhelpers.DefaultLinkPrice, linkPriceUSD.Int)
}

func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
env, _ := changeset.NewMemoryEnvironment(t, changeset.WithNumOfChains(4))
env, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(4))
state, err := changeset.LoadOnchainState(env.Env)
require.NoError(t, err)

selectors := env.Env.AllChainSelectors()
destChain, chain1, chain2, chain3 := selectors[0], selectors[1], selectors[2], selectors[3]

changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, destChain, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, destChain, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain3, destChain, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, destChain, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, destChain, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain3, destChain, false)

boundContracts := map[cciptypes.ChainSelector][]types.BoundContract{}
for i, selector := range env.Env.AllChainSelectorsExcluding([]uint64{destChain}) {
Expand Down Expand Up @@ -850,15 +851,15 @@ func Test_GetMedianDataAvailabilityGasConfig(t *testing.T) {
func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) {
t.Parallel()
ctx := tests.Context(t)
env, _ := changeset.NewMemoryEnvironment(t)
env, _ := testhelpers.NewMemoryEnvironment(t)
state, err := changeset.LoadOnchainState(env.Env)
require.NoError(t, err)

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

changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
changeset.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain1, chain2, false)
testhelpers.AddLaneWithDefaultPricesAndFeeQuoterConfig(t, &env, state, chain2, chain1, false)

reader := testSetupRealContracts(
ctx,
Expand All @@ -884,7 +885,7 @@ func Test_GetWrappedNativeTokenPriceUSD(t *testing.T) {

// Only chainD has reader contracts bound
require.Len(t, prices, 1)
require.Equal(t, changeset.DefaultWethPrice, prices[cciptypes.ChainSelector(chain1)].Int)
require.Equal(t, testhelpers.DefaultWethPrice, prices[cciptypes.ChainSelector(chain1)].Int)
}

// Benchmark Results:
Expand Down Expand Up @@ -1341,7 +1342,7 @@ func testSetupRealContracts(
destChain uint64,
toBindContracts map[cciptypes.ChainSelector][]types.BoundContract,
toMockBindings map[cciptypes.ChainSelector][]types.BoundContract,
env changeset.DeployedEnv,
env testhelpers.DeployedEnv,
) ccipreaderpkg.CCIPReader {
db := pgtest.NewSqlxDB(t)
lpOpts := logpoller.Opts{
Expand Down
Loading