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

Feat/filter labeled addresses #16464

Merged
merged 15 commits into from
Feb 20, 2025
Merged

Feat/filter labeled addresses #16464

merged 15 commits into from
Feb 20, 2025

Conversation

MStreet3
Copy link
Contributor

@MStreet3 MStreet3 commented Feb 18, 2025

PR #16148 added labels to contract addresses on deployment, but did not introduce filtering. This introduced a bug where certain changesets in chainlink-deployments that relied on the assumption of a single contract per chain for MCMS contracts inadvertently generated proposals with the wrong MCMS contract addresses.

This PR fixes the issue by filtering contracts by labels when loading the address book in a backwards compatible way. If the passed label set is empty, then only un-labeled contracts are returned. If there are labels passed in the request, then only contracts that have all labels are returned.

Requires

Supports

Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 9232a0c (feat/filter-labeled-addresses).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

1 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestSaveExistingMCMSAddressWithLabels 0% true false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset true 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

@MStreet3 MStreet3 force-pushed the feat/filter-labeled-addresses branch from 9232a0c to 0aa5162 Compare February 18, 2025 22:03
Copy link
Contributor

github-actions bot commented Feb 18, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@MStreet3 MStreet3 marked this pull request as ready for review February 18, 2025 22:04
@MStreet3 MStreet3 requested review from a team as code owners February 18, 2025 22:04
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 0aa5162 (feat/filter-labeled-addresses).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

1 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestSaveExistingMCMSAddressWithLabels 0% true false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset true 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @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

Flakeguard Summary

Ran new or updated tests between develop and 5759bab (feat/filter-labeled-addresses).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

4 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestAddressesContainBundle 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/Mismatched_labels_=>_false 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/No_instance_=>_result_false,_no_error 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestSaveExistingMCMSAddressWithLabels 0% true false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset true 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

Removes check that the addresses contains all the
types and versions defined in a bundle.

It is not required that the MCMS state contracts
be non-nil.  There is a Validate() method and the
docstring states that nil values are possible.
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and aeafd44 (feat/filter-labeled-addresses).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

6 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestAddressesContainBundle 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/Mismatched_labels_=>_false 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/No_instance_=>_result_false,_no_error 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestDeployMCMSWithTimelockV2 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 37.52s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestMaybeLoadMCMSWithTimelockChainState 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 70ms @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestMaybeLoadMCMSWithTimelockChainState/Missing_contract 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 20ms @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

@MStreet3 MStreet3 force-pushed the feat/filter-labeled-addresses branch from 6c63ae9 to 4cc29c1 Compare February 19, 2025 02:51
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and 6c63ae9 (feat/filter-labeled-addresses).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

6 Results
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestAddressesContainBundle 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/Mismatched_labels_=>_false 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestAddressesContainBundle/No_instance_=>_result_false,_no_error 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment false 0s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestDeployMCMSWithTimelockV2 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 35.573333333s @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestMaybeLoadMCMSWithTimelockChainState 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 70ms @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation
TestMaybeLoadMCMSWithTimelockChainState/Missing_contract 0% false false false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/common/changeset false 20ms @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

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

@MStreet3 MStreet3 force-pushed the feat/filter-labeled-addresses branch from 4cc29c1 to b607296 Compare February 19, 2025 02:57
@MStreet3 MStreet3 requested a review from a team as a code owner February 19, 2025 22:37
Copy link
Contributor

I see you added a changeset file but it does not contain a tag. Please edit 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.

AnieeG
AnieeG previously approved these changes Feb 19, 2025
// EnsureDeduped ensures that each contract in the bundle only appears once
// in the address map. It returns an error if there are more than one instance of a contract.
// Returns true if every value in the bundle is found once, false otherwise.
func EnsureDeduped(addrs map[string]TypeAndVersion, bundle []TypeAndVersion) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

eutopian
eutopian previously approved these changes Feb 19, 2025
@MStreet3 MStreet3 dismissed stale reviews from eutopian and AnieeG via 29f5cde February 19, 2025 23:13
AnieeG
AnieeG previously approved these changes Feb 19, 2025
@MStreet3 MStreet3 enabled auto-merge February 20, 2025 11:55
@MStreet3 MStreet3 added this pull request to the merge queue Feb 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 20, 2025
@MStreet3 MStreet3 added this pull request to the merge queue Feb 20, 2025
@MStreet3 MStreet3 removed this pull request from the merge queue due to a manual request Feb 20, 2025
@MStreet3 MStreet3 dismissed stale reviews from cedric-cordenier and AnieeG via 0320343 February 20, 2025 14:36
@MStreet3 MStreet3 enabled auto-merge February 20, 2025 14:52
@MStreet3 MStreet3 added this pull request to the merge queue Feb 20, 2025
Merged via the queue into develop with commit 8d2b90c Feb 20, 2025
164 of 165 checks passed
@MStreet3 MStreet3 deleted the feat/filter-labeled-addresses branch February 20, 2025 15:22
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