Open manuelwedler opened 1 year ago
Closes #1797
I don't want the current progress to get lost, so I am opening this draft.
The issue at the moment is that the l2 gas limit is needed for sending the request to L2. They don't provide a contract level function to calculate it, only the rpc method zks_estimateGasL1ToL2. It is worth it to check the implementation of the rpc server to see how they calculate it. Maybe something similar can be written in the contract to estimate the l2 gas limit. rpc server implementation is here: https://github.com/matter-labs/zksync-era/blob/7f1d44d5cafd80df2e846bb35ab81e21676bfc36/core/bin/zksync_core/src/api_server/web3/namespaces/zks.rs#L82
zks_estimateGasL1ToL2
Closes #1797
I don't want the current progress to get lost, so I am opening this draft.
The issue at the moment is that the l2 gas limit is needed for sending the request to L2. They don't provide a contract level function to calculate it, only the rpc method
zks_estimateGasL1ToL2
. It is worth it to check the implementation of the rpc server to see how they calculate it. Maybe something similar can be written in the contract to estimate the l2 gas limit. rpc server implementation is here: https://github.com/matter-labs/zksync-era/blob/7f1d44d5cafd80df2e846bb35ab81e21676bfc36/core/bin/zksync_core/src/api_server/web3/namespaces/zks.rs#L82