[DRAFT] contracts: add zksync messengers #2195
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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