-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: add ed25519/secp256k1 precompiles #102
Conversation
Have implemented both suggestions |
svm/src/precompiles.rs
Outdated
account.set_lamports(1); | ||
account.set_executable(true); | ||
|
||
svm.set_account(ed25519_program::ID, account.clone().into()) |
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.
I looked at bank.rs
and it checks each precompile against the feature_set
before adding it:
for precompile in get_precompiles() {
let should_add_precompile = precompile
.feature
.as_ref()
.map(|feature_id| self.feature_set.is_active(feature_id))
.unwrap_or(false);
if should_add_precompile {
self.add_precompile(&precompile.program_id);
}
}
Can we do the same please? We already have a feature_set
field on LiteSVM
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.
Implemented in 4ea8b29
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.
Strange, seems the bank code has a logic error/poor wording. These precompiles have feature_id: None which means always enabled. But the code doesn't enable them. My guess is they're loaded elsewhere so it just works... cool.
Hi can you add an entry in the Changelog? |
done |
Waiting for a last check of @kevinheavey and after sounds good to me |
Without this patch ed25519/secp256k1 fail with: