-
Notifications
You must be signed in to change notification settings - Fork 152
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
generic verify_precompiles #3055
base: master
Are you sure you want to change the base?
Conversation
@@ -2260,7 +2261,7 @@ fn verify_transaction( | |||
let move_precompile_verification_to_svm = | |||
feature_set.is_active(&feature_set::move_precompile_verification_to_svm::id()); | |||
if !move_precompile_verification_to_svm { | |||
if let Err(e) = transaction.verify_precompiles(feature_set) { | |||
if let Err(e) = verify_precompiles(transaction, feature_set) { |
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.
implementation change, no affect on the RPC interface.
@@ -107,6 +107,7 @@ assert_matches = { workspace = true } | |||
ed25519-dalek = { workspace = true } | |||
libsecp256k1 = { workspace = true } | |||
memoffset = { workspace = true } | |||
rand0-7 = { package = "rand", version = "0.7" } |
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.
need this to create the precompile instructions for testing.
logic was mainly copied from the individual precompile tests - if there's a better way without this old version would be happy to change & remove this
.get_or_insert_with(|| message.instructions_iter().map(|ix| ix.data).collect()); | ||
precompile | ||
.verify(instruction.data, all_instruction_data, feature_set) | ||
.map_err(|_| TransactionError::InvalidAccountIndex)?; |
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.
kept error type here consistent with what tx.verify_precompiles
returns...but this does not seem like the correct variant to me.
Problem
verify_precompiles
needs to have a generic counterpart so that new transaction type(s) can verify themSummary of Changes
solana_runtime::verify_precompiles::verify_precompiles
fnSanitizedTransaction::verify_precompiles
was previously usedFixes #