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

Add apply_discount_factor to gas_parameters #15

Merged
merged 10 commits into from
Jan 22, 2025
Merged

Conversation

elmato
Copy link
Contributor

@elmato elmato commented Oct 28, 2024

No description provided.

@elmato elmato requested a review from yarkinwho October 28, 2024 17:54
@stephenpdeos stephenpdeos linked an issue Nov 13, 2024 that may be closed by this pull request
@elmato elmato force-pushed the elmato/discount-factor branch from 72c15e0 to 032abf0 Compare November 14, 2024 20:34
@elmato elmato mentioned this pull request Jan 7, 2025
speculative_cpu_gas_consumed_ = std::max(y, 0l);
cpu_gas_refund_ = std::max(-y, 0l);
speculative_cpu_gas_consumed_ = std::max(y, decltype(y){0});
cpu_gas_refund_ = std::max(-y, decltype(y){0});

Choose a reason for hiding this comment

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

is it possible to eliminate the use of auto and decltype here? it seems a little bit dangerous to me to use things like auto and decltype in the scenarios that have the risk of overflow/underflow.

Choose a reason for hiding this comment

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

I wonder if change the auto above as well can help fixing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@elmato elmato requested a review from yarkinwho January 17, 2025 05:24
@elmato elmato merged commit e531566 into master Jan 22, 2025
5 checks passed
@elmato elmato deleted the elmato/discount-factor branch January 22, 2025 03:29
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.

Add apply_discount_factor function to gas_parameters
2 participants