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 ed25519_program to built-in instruction cost list #27199

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion runtime/src/block_cost_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
use {
lazy_static::lazy_static,
solana_sdk::{
feature, incinerator, native_loader, pubkey::Pubkey, secp256k1_program, system_program,
ed25519_program, feature, incinerator, native_loader, pubkey::Pubkey, secp256k1_program,
system_program,
},
std::collections::HashMap,
};
Expand Down Expand Up @@ -40,6 +41,7 @@ lazy_static! {
(solana_vote_program::id(), COMPUTE_UNIT_TO_US_RATIO * 70),
// secp256k1 is executed in banking stage, it should cost similar to sigverify
tao-stones marked this conversation as resolved.
Show resolved Hide resolved
(secp256k1_program::id(), COMPUTE_UNIT_TO_US_RATIO * 24),
(ed25519_program::id(), COMPUTE_UNIT_TO_US_RATIO * 24),
Comment on lines 42 to +43
Copy link
Member

Choose a reason for hiding this comment

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

nit: could you define SIGNATURE_US = 24 and use it for all of these?: SIGNATURE_COST, secp256k1_program::id(), ed25519_program::id()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm, these two programs don't necessary cost same as sigverify, do they? They are currently mimicking signature cost just as an estimation, technically they should be able to have different values. Maybe leave them as-is, not to introduce dependencies with each other?

(system_program::id(), COMPUTE_UNIT_TO_US_RATIO * 5),
]
.iter()
Expand Down