-
Notifications
You must be signed in to change notification settings - Fork 828
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
[pallet-revive] ecrecover #7652
base: pg/fix_tracing_2
Are you sure you want to change the base?
Conversation
- add check for precompiles addresses - fixes debug_call for revert call - fixes traces for staticcall
/cmd prdoc --audience runtime_dev --bump minor |
Please make this less invasive. We know all precompiles we are adding here are pure functions. Just call them directly from the Both of those points will keep the merge conflicts I have to deal with down. |
that's what I did initially, but you also need to duplicate all the tracing logic if you do it, and handle value transfer |
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 understand. But please still just duplicate the logic into precompiles.rs
then. I want this PR to have minimal impact on exec.rs. First, because making contract_info
optional generates a lot of changes I don't want to backport. Secondly, the merge conflicts I will get from this will break my brain. I checked my branch and it will be bad.
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.
Please rename module to pure_precompiles
to avoid merge conflicts later.
substrate/frame/revive/src/exec.rs
Outdated
fn code_info(&self) -> &CodeInfo<T>; | ||
fn code_deposit(&self) -> BalanceOf<T>; |
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.
What is the reason for this change?
} | ||
|
||
impl<T: Config> Precompiles<T> { | ||
pub fn execute<E: Ext<T = T>>(addr: H160, ext: &mut E, input: &[u8]) -> ExecResult { |
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.
Let's enforce that they are pure. No need to give them access to the full ext.
pub fn execute<E: Ext<T = T>>(addr: H160, ext: &mut E, input: &[u8]) -> ExecResult { | |
pub fn execute<T: Config>(addr: H160, ext: &mut GasMeter<T>, input: &[u8]) -> ExecResult { |
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 would rather just duplicate the value transfer logic here to keep the diff easy.
Sounds good then, you have a branch somewhere with another version of precompile implemented? |
All GitHub workflows were cancelled due to failure one of the required jobs. |
Yes its |
Ok did the refactoring yesterday |
Add ECrecover 0x1 precompile and remove the unstable equivalent host function.