optimistic-specs
optimistic-specs copied to clipboard
Allow gasless invocation of function calls on L1 smart contracts
Is your feature request related to a problem? Please describe.
In the current situation it's not possible to invoke a gasless call function on a L1 contract. Cross-chain interaction is currently only possible by sending messages that incur a gas cost.
Describe the solution you'd like
Allow smart contracts on L2 OE to invoke gasless function calls on L1 contracts.
Describe alternatives you've considered
I addressed this issue in the OE Discord. One of the CC's looked into this and requested me to write up this feature request.
Additional context
I was reading the development support channel on the OE discord; where I found a question of another developer who wanted to access the state from a L1 contract. I assumed a gasless mechanism was already in place for this; however this was not the case.
Does any other L2 solution offer this? You would like to STATICCALL L1 contracts from L2. This would require adding an HTTP/IPC provider to the L2 EVM so that it can call out to L1. This would mean that an L1 archive node is required and tightly coupled to any L2 node. Running an Optimism node currently doesn't require an archive node and adding this feature would greatly increase the cost of running an Optimism node.
This sort of functionality would be appropriate for a custom opcode but would need to be priced very expensively as it would need to take into account the interprocess communication time of execution.
An alternative architecture where the L1 node and the L2 node run in the same process could remove the need for IPC but would greatly increase the demand on the hardware as this single process would be responsible for executing all of L1 and L2.
I believe this issue is better suited for optimistic-specs, going to transfer it there. It'll get more visibility on that repository, since the sort of deep protocol-level modification required to make this work doesn't really happen in this repository. I don't believe this is being considered as part of Bedrock, but it's an interesting idea.
We discussed this briefly, but we're very wary with requiring inter-process/network communication in the EVM.
With Bedrock, it will become possible to prove L1 data against an L1 blockhash, and that can be used towards the same goal. This does cost gas, and any computation needs to be re-implemented on L2, where it does cost gas, though hopefully little enough that it's not a major impediment to whatever you want to achieve.
We might want to revisit this in the future however.