VM: Add EthersStateManager
It really get's on my nerve that it is so so hard to run the VM in a "real world" state context, so e.g. I just wanted to add a new more fitting VM (so: not EVM) example to the README code along the #2016 work - by using VM.runBlock() or VM.runTransaction() - and it is just so hard to do due to all the (pre-)state context missing. One is also re-realizing this by looking at the respective test setups (where there is just no "simple" runBlock() or runTx() example).
Maybe we should really rather sooner than later add a new EthersStateManager, which just takes in an Ethers instance using one of the providers (Infura, Alchemy, whatever) and which then allows to just read state from an external source an allows for such use cases mentioned above.
This should really be not such a hard task now having our StateManager fully extracted and also with a nicely extendable BaseStateManager one can build upon.
I would even be a fan of directly integrating into the @ethereumjs/statemanger package. This would be such a super-useful addition where people will have myriads of use cases (and which would additionally also be a good selling point for the breaking releases 😋).
Ethers is such a tiny package (and we have Richard on the team) and I would say that it wouldn't hurt here to add this as an additional dependency. We can even go one step further and think if we rather make this a "standard" package which is "allowed" to be used in various packages (in a synced version number) if useful, similarly to the ethereum-cryptography library e.g.). Then we will likely be better able to integrate in general - e.g. also on use cases like loading an Ethers tx in our tx library - see #1099 - which would improve interoperability between these ecosystems, guess users will likely benefit since there are lots of use cases around that (especially in this field: reading RPC data with Ethers, continue to use/process with EthereumJS libs).
So to come back: maybe this is really some nice holiday task for someone. Again, nothing pressing, but likely also not too difficult to realize.
also cc-ing in her @ricmoo if he has got some additional input on this
I think I might pick this up. Not 100% sure what to do with all of the write/put methods since you can't directly update accounts or storage from ethers but maybe we can just cache a map of updated data as it is retrieved and update as the VM does operations on code.
Closed by #2059