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

Make LinkMonitor CLA compatible #11427

Closed
wants to merge 130 commits into from
Closed

Make LinkMonitor CLA compatible #11427

wants to merge 130 commits into from

Conversation

fbac
Copy link
Contributor

@fbac fbac commented Nov 30, 2023

  • addToWatchList function has to be CL Automation compatible.
  • removeFromWatchList function has to properly clear the address from the watchList and set it as not active.
  • Contract now has admin and executor roles, so the admin can give permissions to different CLA Upkeeps.
  • Roles can be revoked.

@fbac fbac requested review from RensR and RyanRHall November 30, 2023 14:47
@fbac fbac requested a review from a team as a code owner November 30, 2023 14:47
Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

@fbac
Copy link
Contributor Author

fbac commented Nov 30, 2023

PTAL @RyanRHall, and also please @RensR take a look as the CCIP sme.

@fbac fbac force-pushed the linkmon-add-onramps branch from 58cc1c7 to 4d61e1f Compare November 30, 2023 14:57
@fbac fbac force-pushed the linkmon-add-onramps branch from 4d61e1f to 1a1f9ac Compare November 30, 2023 17:26
@fbac fbac changed the title include add and remove to/from watchlist Make LinkMonitor CLA compatible Dec 1, 2023
Copy link
Contributor

@RensR RensR left a comment

Choose a reason for hiding this comment

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

Missing a lot of test coverage

@fbac fbac requested a review from RensR December 4, 2023 17:02
@fbac fbac force-pushed the linkmon-add-onramps branch from d6c69fe to 64f4753 Compare December 4, 2023 17:03
Copy link
Contributor

@RyanRHall RyanRHall left a comment

Choose a reason for hiding this comment

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

I don't think the test changes quite match the functionality changes. Ex I don't see anything in the tests about the executor role? Also some new edge cases were added to addToWatchlist() that should have test cases.

Also, this contract is very CCIP specific. I think you might want to either (A) make a copy of the original LinkAvailableBalanceMonitor contract or (B) rename this to something like CCIPOnRampBalanceMonitor or similar. I think preference for (A) as iirc this contract was supposed to serve any contract that implements the linkAvailableForPayment() function (ex VRF) but these changes only make sense for CCIP.

@fbac
Copy link
Contributor Author

fbac commented Dec 5, 2023

I don't think the test changes quite match the functionality changes. Ex I don't see anything in the tests about the executor role? Also some new edge cases were added to addToWatchlist() that should have test cases.

Also, this contract is very CCIP specific. I think you might want to either (A) make a copy of the original LinkAvailableBalanceMonitor contract or (B) rename this to something like CCIPOnRampBalanceMonitor or similar. I think preference for (A) as iirc this contract was supposed to serve any contract that implements the linkAvailableForPayment() function (ex VRF) but these changes only make sense for CCIP.

Working on the unit tests, I'll add them asap.

Regarding the CCIP specific part, I agree. The idea here is this contract will watch over every kind of contract (vrf, data feed proxies..) but also over CCIP onRamps, and in this last case it will be triggered automatically through the onRampSet event (using Automation). So that's why some of the logic has to be changed while it's still capable of dealing with any other contract type.
Another solution is to create a middleman contract that manages the s_onRamp list and triggers an addition on this contract's watchlist if everything is ok. It would increase the attack surface though.
What do you think?

@fbac fbac requested review from matYang and RyanRHall December 5, 2023 18:14
@fbac fbac force-pushed the linkmon-add-onramps branch 2 times, most recently from 1280e9f to 878041d Compare December 7, 2023 11:15
kidambisrinivas and others added 3 commits December 14, 2023 10:41
* Introduce job spec flag for custom reverted pipeline

* Disable the flag for V2+

* Rename file after merge conflict
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.