Skip to content

Conversation

@bmzig
Copy link
Contributor

@bmzig bmzig commented Dec 23, 2024

Applies the function introduced by OZ in this PR: OpenZeppelin/openzeppelin-upgrades#228. This is only used on two test fixtures, so we still should see warnings when we deploy.

Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig marked this pull request as ready for review December 23, 2024 20:02
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

OOC will this potentially silence other warnings?

@bmzig
Copy link
Contributor Author

bmzig commented Dec 30, 2024

OOC will this potentially silence other warnings?

It would if there were other warnings thrown in those fixtures.

nicholaspai
nicholaspai previously approved these changes Dec 31, 2024
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

fixtures by design are only used in tests so this is nice. Is there way to target specific warnings?

Signed-off-by: bennett <bennett@umaproject.org>
@bmzig
Copy link
Contributor Author

bmzig commented Dec 31, 2024

fixtures by design are only used in tests so this is nice. Is there way to target specific warnings?

I don't see a way to do this. I was referencing this post: https://forum.openzeppelin.com/t/logging-verbose-during-local-tests-with-upgradeable-contracts/4633, which seemed to have similar issues as ours. I changed this to just instead silence warnings for our contract tests only. The upside is that we should have a clean output for our tests, but the downside is that any warnings emitted from @openzeppelin/hardhat-upgrades will be silenced (e.g. the unsafeAllow options found here) I think this is OK, since we still will need to explicitly supply the unsafeAllow type when deploying the contract.

Edit: I'm reverting this change and going to back to what I originally had since if we don't suppress the warnings in the fixtures, then we will get spammed in the other repositories, e.g. the relayer.

Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
@socket-security
Copy link

socket-security bot commented Dec 31, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

Signed-off-by: bennett <bennett@umaproject.org>
james-a-morris
james-a-morris previously approved these changes Jan 2, 2025
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Curious about Nick's comment. This is what I was probing at. If we can't and this looks good I will approve so that I'm not a blocker

Signed-off-by: bennett <bennett@umaproject.org>
@bmzig
Copy link
Contributor Author

bmzig commented Jan 7, 2025

I reverted the package bump since this I don't think this is significant enough to merit a version change. We can just include it whenever we need to upgrade contracts. This should stop the spamming in the relayer repository's unit tests.

As far as silencing specific warnings, I don't think this is possible, but it shouldn't matter, since we know that the warnings will only be emitted if we have an unsafeAllow option somewhere in the code. Essentially, we need to already acknowledge and mark that the warning is allowed in the contract for it to be silenced.

@bmzig bmzig requested a review from james-a-morris January 7, 2025 16:54
@bmzig bmzig merged commit c813704 into master Jan 7, 2025
9 checks passed
@bmzig bmzig deleted the bz/suppressFixtureWarnings branch January 7, 2025 17:25
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