Closed raulk closed 1 year ago
We need to make a choice when implementing the eth_getStorageAt
JSON-RPC method.
This method queries a storage slot in an Ethereum contract and returns the U256 value in it. The two options to resolve this call are:
Make the EVM actor export a GetStorageAt
method, and use the same mechanism as we’d implement for eth_call
to invoke it (instantiate the VM and send a message, discarding side effects, similar to what Lotus’ EstimateGas method does).
Make Lotus understand the internal data model of the EVM actor state, dive into it, and rescue the value from the state tree directly.
I’m leaning towards implementing (1). (2) feels like premature optimization and I’d imagine we’d want to go to those lengths only if truly warranted.
I'm strongly in favor of implementing 1 for now just because it's less work.
Basically, we already need to be able to invoke an arbitrary method an an arbitrary actor. We might as well make this easy.
I am in favor of direvtly reading the state; no need for all the switcharoo surounding execution, just look at the thing directly. Much faster and a lot simpler.
eth_getBlockReceipts
doesn't seem to be a standard method as it's not included here, so we can deprioritize it.
Closing this one as most methods haven been shipped, and the left ones are in the separate issue https://github.com/filecoin-project/ref-fvm/issues/909
This is an issue to break down and track the work specified in https://github.com/filecoin-project/FIPs/discussions/422, for implementation in Lotus.
Category A: simple methods
These methods require simple mapping and do not necessitate deeper changes in Lotus.
Owned by @ychiaoli18
Category B: deeper changes required in Lotus
Section 1: require tipset hash tracking and mapping:
Owned by @ychiaoli18
Section 2: requires
GetBytecode
EVM actor method (#838) and eth_call like plumbing:Owned by @raulk
Section 3: requires
GetStorageAt
EVM actor method and eth_call like plumbing:Owned by @raulk
Category C: message sending and interactions with the FVM
Section 1: temporary Eth signature validation in Lotus until account abstraction is ready:
Owned by @ychiaoli18
Section 2: require instantiating the FVM:
Owned by @ychiaoli18
Misc:
Content-Type:application/json
Likely not needed