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

Change output format for price feed check #52

Merged
merged 5 commits into from
Dec 30, 2024

Conversation

nivcertora
Copy link
Collaborator

@nivcertora nivcertora commented Dec 29, 2024

https://certora.atlassian.net/browse/CERT-7874
https://certora.atlassian.net/browse/CERT-7875

PR Summary

Refactor PriceFeedData and Enhance PriceFeedCheck Messaging

  • Remove Address Fields:

    • Eliminated address and proxy_address from the __str__ method in PriceFeedData to streamline its string representation.
  • Enhance Messaging in PriceFeedCheck:

    • Updated PriceFeedCheck to include proxy_address and origin_address in success messages when they are available and differ from the primary address.
    • Provides more detailed information about the price feed sources, improving clarity and debugging capabilities.
image

@nivcertora nivcertora requested a review from a team as a code owner December 29, 2024 15:28
@nivcertora nivcertora self-assigned this Dec 29, 2024
Copy link
Collaborator

@yoav-el-certora yoav-el-certora left a comment

Choose a reason for hiding this comment

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

The output is not as required by ticket.

For price feed checks we expect:

Found <address> on <price feed provider>
Name: <price feed name>
Decimals: <decimals>

<if this is an implementation address> <in red> this is an implementation contract with a proxy address <proxy address> </in red>

For coin gecko we expect:

Found <address> on <token validator provider>
Name: <token name>
Symbol: <token symbol>
Decimals: <decimals>

@nivcertora
Copy link
Collaborator Author

The output is not as required by ticket.

For price feed checks we expect:

Found <address> on <price feed provider>
Name: <price feed name>
Decimals: <decimals>

<if this is an implementation address> <in red> this is an implementation contract with a proxy address <proxy address> </in red>

For coin gecko we expect:

Found <address> on <token validator provider>
Name: <token name>
Symbol: <token symbol>
Decimals: <decimals>

The output is literally the same, you can check the output image.

@nivcertora nivcertora dismissed yoav-el-certora’s stale review December 29, 2024 16:33

Same output, no need to change

if address.lower() != price_feed.address.lower():
color = pp.Colors.FAILURE
message += f"This is an implementation contract with a proxy address\n"
message += f"Origin Address: {price_feed.address}\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was not requested

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is an implementation contract with a proxy address </in red>

Copy link
Collaborator

Choose a reason for hiding this comment

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

This line - message += f"Origin Address: {price_feed.address}\n"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was but they made a mistake, they don't need the proxy address in the sentence as it is already printed. they want the original.

message += f"Proxy address: {price_feed.proxy_address}\n"
if address.lower() != price_feed.address.lower():
color = pp.Colors.FAILURE
message += f"This is an implementation contract with a proxy address\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only this sentence should be printed in red

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not possible to do. and better to put the entire message to not miss it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But everything in red makes you think this is a failure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a failure according to the ticket.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the contract uses the proxy address instead of the original they want it in red

Copy link
Collaborator

Choose a reason for hiding this comment

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

From ticket description, they want only the last line.
Please check this with Michael.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ill merge it and if have a issue ill talk to him.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Check with @MichaelMorami before merge.

@nivcertora nivcertora requested review from yoav-el-certora and MichaelMorami and removed request for yoav-el-certora December 30, 2024 07:20
@nivcertora nivcertora merged commit a17c9ca into main Dec 30, 2024
9 checks passed
@nivcertora nivcertora deleted the niv/CERT-7876-Coingecko-Output branch December 30, 2024 07:53
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.

2 participants