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

Improvement in naming changesets #15943

merged 36 commits into from
Jan 16, 2025

Conversation

AnieeG
Copy link
Contributor

@AnieeG AnieeG commented Jan 15, 2025

  • It was getting difficult to differentiate between Changeset related methods and other public methods in ccip/changeset. Suffixed all Changeset methods with ..Changeset
  • All test methods are renamed with TestConfig in name to denote those are explicitly for Test.
  • OCRParameter derivation is made easier with options to override over the default values easily.

AnieeG added 19 commits December 6, 2024 16:47
Copy link
Contributor

github-actions bot commented Jan 15, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@AnieeG AnieeG marked this pull request as ready for review January 15, 2025 23:24
@AnieeG AnieeG requested review from a team as code owners January 15, 2025 23:24
@AnieeG AnieeG requested review from winder and asoliman92 January 15, 2025 23:24
@AnieeG AnieeG force-pushed the fixes-for-staging branch from 8f2aa3f to 5f0f701 Compare January 16, 2025 17:05
},
})
require.NoError(t, err)

assertTimelockOwnership(t, e, allChains, state)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved these to test_assertions

@@ -102,7 +102,7 @@ func (d *DeployerGroup) getDeployer(chain uint64) (*bind.TransactOpts, error) {
return sim, nil
}

func (d *DeployerGroup) enact(deploymentDescription string) (deployment.ChangesetOutput, error) {
func (d *DeployerGroup) Enact(deploymentDescription string) (deployment.ChangesetOutput, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

had to export these for _test package import

@AnieeG AnieeG requested review from a team as code owners January 16, 2025 18:34
@AnieeG AnieeG requested a review from a team as a code owner January 16, 2025 18:48
@AnieeG AnieeG requested a review from Atrax1 January 16, 2025 18:48
PriceFeedChainSelector: ccipocr3.ChainSelector(feedChainSel),
NewMsgScanBatchSize: merklemulti.MaxNumberTreeLeaves,
MaxReportTransmissionCheckAttempts: 5,
RMNEnabled: os.Getenv("ENABLE_RMN") == "true", // only enabled in manual test
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pretty strange, we shouldn't be accessing os.Getenv in these funcs IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually done for test.let me handle it in a better way in subsequent ticket

func buildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts {
func BuildTimelockPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*proposalutils.TimelockExecutionContracts {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these need to be exported? Don't see it being used outside the changeset pkg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's used in test -

timelocksPerChain := changeset.BuildTimelockPerChain(e.Env, state)

func buildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address {
timelocksPerChain := buildTimelockPerChain(e, state)
func BuildTimelockAddressPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]common.Address {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto here

func buildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig {
func BuildProposerPerChain(e deployment.Environment, state CCIPOnChainState) map[uint64]*gethwrappers.ManyChainMultiSig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Double ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these are used under _test package

Copy link
Contributor

Choose a reason for hiding this comment

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

Intentional delete right?

@@ -19,6 +19,8 @@ import (
commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/deployment/ccip/changeset"
changeset2 "github.com/smartcontractkit/chainlink/deployment/common/changeset"
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename import to changesetcommon or cscommon or whatever

Suggested change
changeset2 "github.com/smartcontractkit/chainlink/deployment/common/changeset"
cscommon "github.com/smartcontractkit/chainlink/deployment/common/changeset"

Copy link
Contributor

Choose a reason for hiding this comment

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

Nvm seems transferred here

@@ -20,9 +25,26 @@ const (
LinkDecimals = 18
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

// MockLinkAggregatorDescription This is the description of the MockV3Aggregator.sol contract
// 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

tenv, _ := NewMemoryEnvironment(t, WithChains(3))
_, err := ViewCCIP(tenv.Env)
tenv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(3))
_, err := changeset.ViewCCIP(tenv.Env)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a ticket for better test coverage on the views?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All views have individual tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually no some were missing, created a ticket

@AnieeG AnieeG added this pull request to the merge queue Jan 16, 2025
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 85fa2e2 (fixes-for-staging).

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
TestRMNCurseIdempotent 0.00% true true false 3 0 3 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.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2025
@AnieeG AnieeG added this pull request to the merge queue Jan 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2025
@AnieeG AnieeG added this pull request to the merge queue Jan 16, 2025
Merged via the queue into develop with commit ac3a55f Jan 16, 2025
195 of 196 checks passed
@AnieeG AnieeG deleted the fixes-for-staging branch January 16, 2025 20:50
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.

5 participants