Open alexfertel opened 5 months ago
I'm also facing the same issue, needing to create a precompile that has (write)access to state.
The workaround mentioned above unfortunately doesn't work, as I need low level access to accounts. Is there an obvious way to satisfy the DB
constraint without pulling it through the whole codebase?
Unfortunately this is blocking us from fully onboarding Anvil for Celo. Is there any chance that this feature will be addressed any time soon ? @gakonst
hey @mattsse @onbjerg @Evalir @DaniPopes any chance this could be implemented any time soon? we're currently migrating our tests to anvil and this is blocking us as well
thanks in advance for looking into it!
Component
Anvil
Describe the feature you would like
We've been using the new precompile injection API created in https://github.com/foundry-rs/foundry/pull/7589, and it's working well.
After some use, the need for
ContextPrecompile
arose: we needed a way to get the code of an account, and with the params ofPrecompile
, this can't be done. If I understand correctly the implementation inrevm
,ContextPrecompile
does give access to account state throughInnerEvmContext::code_hash
.Since
ContextPrecompile
is a superset ofPrecompile
, this should be fine. I tried making an initial PoC, but the generics ofContextPrecompile<DB: Database>
get a bit in the way.Current workaround is creating a provider inside the precompile and making a
get_code_at
async call. This works fine, it's just that it's a bit awkward having to make an RPC call, when we are executing in the context of an EVM.Additional context
No response