-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
use one definition of builtin program cost in runtime and banking stage #31930
use one definition of builtin program cost in runtime and banking stage #31930
Conversation
(feature::id(), COMPUTE_UNIT_TO_US_RATIO * 2), | ||
(incinerator::id(), COMPUTE_UNIT_TO_US_RATIO * 2), | ||
(native_loader::id(), COMPUTE_UNIT_TO_US_RATIO * 2), | ||
(solana_sdk::stake::config::id(), COMPUTE_UNIT_TO_US_RATIO * 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above four entries are not programs, ref #30639 (comment)
|
||
declare_process_instruction!( | ||
process_instruction, | ||
DEFAULT_COMPUTE_UNITS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the actual changes to this, and other programs, is add and use DEFAULT_COMPUTE_UNITS instead of a number (eg 750
). But the rustfmt
rearranged large chunk of code.
Codecov Report
@@ Coverage Diff @@
## master #31930 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 759 759
Lines 207250 207243 -7
=========================================
- Hits 169807 169790 -17
- Misses 37443 37453 +10 |
Problem
builtin programs compute units are defined in two places: runtime/src/block_cost_limits.rs and at runtime for each program. This potentially introduces inconsistency. Should define builtin program's CU at one place.
Summary of Changes
pub const DEFAULT_COMPUTE_UNITS
for each program,Fixes #