Closed RoboTeddy closed 2 years ago
In fact just yesterday I was "giving thought" to this issue while going through this: https://www.cairo-lang.org/docs/hello_starknet/l1l2.html.
To be clear, the Alpha testnet, which this devnet aims to mimic, is able to communicate with an Ethereum testnet (currently Goerli). And currently, the devnet is isolated from L1 chains.
Do you have an idea on how this could be addressed? Or have you found the relevant starknet code parts concerning the L1-L2 connection?
Do you have an idea on how this could be addressed?
One possibility could be to try to set up a local Ethereum devnet (e.g. ganache) such that L1->L2 and L2->L1 messages can be passed between them. That way, there'd be a totally local devnet which replicates what can be done on the Goerli testnet.
I'm not sure how much integration work/complexity/maintenance would be required.
Barring total integration, we could add an endpoint to starknet-devnet
that calls starknet.send_message_to_l2
(as in this example: https://github.com/makerdao/starknet-dai-bridge/blob/mk/draft/test/l2/l2_dai_bridge.py#L288)
I suppose a broader question is: should starknet-devnet
be solely about replicating the testnet deployment locally, or should it also be about exposing Starkware's testing framework more broadly? If the former, then including send_message_to_l2
like this might not make sense. If the latter, then it could be a good addition.
One possibility could be to try to set up a local Ethereum devnet (e.g. ganache) such that L1->L2 and L2->L1 messages can be passed between them. That way, there'd be a totally local devnet which replicates what can be done on the Goerli testnet.
Yes, that also occurred to me. But it could be more generic: just providing the RPC endpoint of the testnet you wish your devnet instance to be connected with, be it something local like Ganache, or something nonlocal like Goerli. Something like passing --l1_endpoint https://goerli...
on devnet startup.
I'd say this is a good enhancement idea and I'd keep this issue open until a proper PR is merged.
Has any thought been given to how these should be supported yet?