[Feature] Pass the TxEnv to precompiles as well.
nuntax opened this issue · comments
Describe the feature you would like
I am using the PrecompilesMap for adding and managing Precompiles. However, I now ran into the issue that the EvmInternals field in the PrecompileInput only contains the BlockEnv and not the TxEnv, which I need to access in a precompile.
Lines 158 to 161 in 785be28
Would also open a PR myself and add it, just don't know if there's maybe a specific reason that the TxEnv is not in there.
Additional context
No response
ideally we keep this free of generics, so what we could probably do is tx_env: dyn revm::Transaction
@mablr perhaps you want to take this :) ?
The issue is that the Transaction trait isn't dyn compatible. I have a fork which I use for now in which I solved this by adding a wrapper dyn compatible TransactionTr trait, similar to the EvmInternalsTr trait. It's quite a bit messy though and I didn't really know if there's a better solution.
The issue is that the Transaction trait isn't dyn compatible
ah sigh...
there's possibly a workaround for this
My workaround looks like this but as I said this adds some boilerplate code:
https://github.com/nuntax/evm/blob/d8ecbd963c4edce8155e9362f5e1e5165ea29bb5/crates/evm/src/traits.rs#L44-L171
Could clean this up and open a PR.