Accessing call value and sender in precompiles
Currently only the call data is passed to precompiles: https://github.com/bluealloy/revm/blob/4d0feec0b5b850d9a1ce651d7c1655d829f48097/crates/revm/src/context/context_precompiles.rs#L212
We're working on some custom precompiles that need to know the msg.value and msg.sender too. Would there be any sympathy for adding these parameters to the precompile traits (Perhaps by passing &CallInputs instead)?
That makes sense. Do you want to add it?
just curious, the msg.sender and msg.value are already in the Env.tx? Don't hesitate to correct me if I'm misunderstood.
https://github.com/bluealloy/revm/blob/d38ff452714e1c4a17cf0fbdaa4913f6d61033c4/crates/revm/src/context/context_precompiles.rs#L199-L205
https://github.com/bluealloy/revm/blob/d38ff452714e1c4a17cf0fbdaa4913f6d61033c4/crates/primitives/src/env.rs#L535-L548
just curious, the
msg.senderandmsg.valueare already in theEnv.tx? Don't hesitate to correct me if I'm misunderstood.
What I understood is caller and value of a subcall.
Hey, I have the same need. Would it be fine to transmit the complete CallInputs to precompiles? I am trying to draft the changes, it would mean that (all different) precompiles types
pub type StandardPrecompileFn = fn(&CallInputs, u64) -> PrecompileResult;
become
pub type StandardPrecompileFn = fn(&CallInputs) -> PrecompileResult;
Does this seem reasonable or should it transmit only a subset of CallInputs?
With new PrecompileProvider we now have access to full Context