-
Notifications
You must be signed in to change notification settings - Fork 819
chore: Add dyn Crypto trait to PrecompileFn #2772
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
chore: Add dyn Crypto trait to PrecompileFn #2772
Conversation
let Some(precompile) = self.precompiles.get(address) else { | ||
return Ok(None); | ||
}; |
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.
We now check for this in self.precompiles.execute
-- will revert this and just deref the fn pointer, then explicitly pass in the dyn trait
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.
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.
this is quite an invasive change just to make the sha256 fn configurable
perhaps a better approach would be to have dedicated precompile fns that use different impls and then simply replace the entire precompile
This would be for all of the precompiles fwiw -- I just did sha256 first to show it working. I was hoping to not need to replace the entire precompile because the main thing we care about switching out is the pure cryptography part and not the EVM related parts |
@mattsse we would essentially be adding all of these methods: revm/crates/precompile/src/crypto.rs Line 42 in 3d00601
|
CodSpeed Performance ReportMerging #2772 will not alter performanceComparing Summary
|
This is contained only within |
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.
Good as a skeleton.
No description provided.