Skip to content

Commit 56efb31

Browse files
authored
Merge pull request #121 from scroll-tech/fix/enforced-txs-and-gas
fix: Clarity and copy changes on enforced txs and gas limit and zktrie
2 parents d4a6d5f + 18bacd5 commit 56efb31

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

src/content/docs/en/developers/guides/scroll-messenger-cross-chain-interaction.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ contract GreeterOperator {
7979
We pass the message by executing `executeFunctionCrosschain` and passing the following parameters:
8080

8181
- `scrollMessengerAddress`: This will depend on where you deployed the `GreeterOperator` contract.
82-
- If you deployed it on Sepolia use `0x50c7d3e7f7c656493D1D76aaa1a836CedfCBB16A`. If you deployed on Scroll use `0xBa50f5340FB9F3Bd074bD638c9BE13eCB36E603d`.
82+
- If you deployed it on Sepolia use `0x50c7d3e7f7c656493D1D76aaa1a836CedfCBB16A`. If you deployed on Scroll Sepolia use `0xBa50f5340FB9F3Bd074bD638c9BE13eCB36E603d`.
8383
- `targetAddress`: The address of the `Greeter` contract on the opposite chain.
8484
- `value`: In this case, it is `0` because the `setGreeting`is not payable.
8585
- `greeting`: This is the parameter that will be sent through the message. Try passing `“This message was cross-chain!”`
8686
- `gasLimit`:
87-
- If you are sending the message from L1 to L2, around `1000000` gas limit should be more than enough.
88-
- If you are sending the message from L2 to L1, pass `0`, as the transaction to be completed by executing an additional transaction on L1.
87+
- If you are sending the message from L1 to L2, around `1000000` gas limit should be more than enough. That said, if you set this too high, and `msg.value` doesn't cover `gasLimit` * `baseFee`, the transaction will revert. If `msg.value` is greater than the gas fee, the unused portion will be refunded.
88+
- If you are sending the message from L2 to L1, pass `0`, as the transaction will be completed by executing an additional transaction on L1.
8989

9090
### Relay the Message when sending from L2 to L1
9191

src/content/docs/en/developers/l1-and-l2-bridging/enforced-transactions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ excerpt: "The Enforced Transaction contract enables sending transactions between
99

1010
import Aside from "../../../../../components/Aside.astro"
1111

12-
The Enforced Transaction contract enables sending transactions between L1 and L2 the **`sendTransaction`** function. This contract shares similarities with the Scroll Messenger contract as it allows sending arbitrary data from one layer to the other. However, it distinguishes itself by enabling the relaying of signed transactions and the ability to set the sender (CALLER or msg.sender) on the receiving transaction on Scroll.
12+
In future upgrades to Scroll, the Enforced Transaction contract will enable sending transactions between L1 and L2 with the **`sendTransaction`** function. This contract shares similarities with the Scroll Messenger contract as it allows sending arbitrary data from one layer to the other. However, it distinguishes itself by enabling the relaying of signed transactions and the ability to set the sender (CALLER or msg.sender) on the receiving transaction on Scroll.
1313

1414
## Enforced Transactions API
1515

src/content/docs/en/developers/l1-and-l2-bridging/erc1155-token-bridge.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Deposit an ERC1155 token from L1 to a recipient's account on L2.
115115
| to | The address of recipient's account on L2. |
116116
| tokenId | The NFT id to deposit. |
117117
| amount | The amount of tokens to deposit. |
118-
| gasLimit | Gas limit required to complete the deposit on L2. |
118+
| gasLimit | Gas limit required to complete the deposit on L2. Unused portion of fee will be refunded.|
119119

120120
### updateTokenMapping
121121

src/content/docs/en/developers/l1-and-l2-bridging/erc721-nft-bridge.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Deposit an ERC721 NFT from L1 to a recipient's account on L2.
8686
| token | The address of ERC721 NFT contract on L1. |
8787
| to | The address of recipient's account on L2. |
8888
| tokenId | The NFT id to deposit. |
89-
| gasLimit | Gas limit required to complete the deposit on L2. |
89+
| gasLimit | Gas limit required to complete the deposit on L2. Unused portion of fee will be refunded. |
9090

9191
### updateTokenMapping
9292

src/content/docs/en/developers/l1-and-l2-bridging/eth-and-erc20-token-bridge.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ When bridging ERC20 tokens, you don’t have to worry about selecting the right
2828
All Gateway contracts will form the message and send it to the `L1ScrollMessenger` which can send arbitrary messages to L2. The `L1ScrollMessenger` passes the message to the `L1MessageQueue`. Any user can send messages directly to the Messenger to execute arbitrary data on L2. This means they can execute any function on L2 from a transaction made on L1 via the bridge. Although an application could directly pass messages to existing token contracts, the Gateway abstracts the specifics and simplifies making transfers and calls.
2929

3030
<Aside type="tip" title="">
31-
Users can also bypass the `L1ScrollMessenger` and send messages directly to the `L1MessageQueue`. If a message is sent
31+
In future upgrades, users will be able to bypass the `L1ScrollMessenger` and send messages directly to the `L1MessageQueue`. If a message is sent
3232
via the `L1MessageQueue`, the transaction's sender will be the address of the user sending the transaction, not the
33-
address of the `L1ScrollMessenger`. Learn more about sending arbitrary messages in the [Scroll
34-
Messenger](/developers/l1-and-l2-bridging/the-scroll-messenger) article.
33+
address of the `L1ScrollMessenger`.
3534
</Aside>
3635

3736
When a new block gets created on L1, the Watcher will detect the message on the `L1MessageQueue` and will pass it to the Relayer service, which will submit the transaction to the L2 via the l2geth node. Finally, the l2geth node will pass the transaction to the `L2ScrollMessagner` contract for execution on L2.
@@ -54,7 +53,7 @@ The L2 Gateway is very similar to the L1 Gateway. We can withdraw ETH and ERC20
5453

5554
## Creating an ERC20 token with custom logic on L2
5655

57-
If a token needs custom logic on L2, it will need to be bridged through a `L1CustomERC20Gateway` and `L2CustomERC20Gateway` respectively. The custom token on L2 will need to give permission to the Gateway to mint new tokens when a deposit occurs and to burn when tokens are withdrawn
56+
If a token needs custom logic on L2, it will need to be bridged through an `L1CustomERC20Gateway` and `L2CustomERC20Gateway` respectively. The custom token on L2 will need to give permission to the Gateway to mint new tokens when a deposit occurs and to burn when tokens are withdrawn
5857

5958
The following interface is the `IScrollStandardERC20` needed for deploying tokens compatible with the `L2CustomERC20Gateway` on L2.
6059

@@ -105,7 +104,7 @@ Sends ETH from L1 to L2.
105104
| --------- | --------------------------------------------------------------------------------------------------------------------------- |
106105
| to | The address of recipient's account on L2. |
107106
| amount | The amount of token to transfer, in wei. |
108-
| gasLimit | Gas limit required to complete the deposit on L2. From 4000 to 10000 gas limit should be enough to process the transaction. |
107+
| gasLimit | Gas limit required to complete the deposit on L2. 170000 should be enough to process the transaction, but unused funds are refunded. |
109108

110109
### depositERC20
111110

@@ -120,7 +119,7 @@ Sends ERC20 tokens from L1 to L2.
120119
| token | The token address on L1. |
121120
| to | The address of recipient's account on L2. |
122121
| amount | The amount of token to transfer, in wei. |
123-
| gasLimit | Gas limit required to complete the deposit on L2. From 4000 to 10000 gas limit should be enough to process the transaction. |
122+
| gasLimit | Gas limit required to complete the deposit on L2. 20000 should be enough to process the transaction, depending on the Gateway, but unused funds are refunded. |
124123

125124
### getL2ERC20Address
126125

src/content/docs/en/technology/bridge/cross-domain-messaging.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function sendMessage(
9393
</ToggleElement>
9494
9595
96-
Both functions require users to provide a gas limit for the corresponding `L1MessageTx` transaction on L2 and prepay the [message relay fee](#message-relay-fee) on L1, which is calculated based on the gas limit amount. The fee is collected to a `feeVault` contract on L1. In case the transaction fails on L2 because the user did not set the correct gas limit for their message on L1, the user can replay the same message with a higher gas limit. You can find more details in the [Retrying failed messages](#retrying-failed-messages) section.
96+
Both functions require users to provide a gas limit for the corresponding `L1MessageTx` transaction on L2 and prepay the [message relay fee](#message-relay-fee) on L1, which is calculated based on the gas limit amount. The fee is collected to a `feeVault` contract on L1. In case the transaction fails on L2 because the user did not set the correct gas limit for their message on L1, the user can replay the same message with a higher gas limit. You can find more details in the [Retrying failed messages](#retrying-failed-messages) section, but since any unused portion of these fees is refunded to the user, there is no penalty for overestimating the gas limit.
9797
9898
The `sendMessage` functions encode the arguments into a cross-domain message (see the code snippet below), where the message nonce is the next queue index of the L1 message queue. The encoded data is then used as calldata in the `L1MessageTx` transaction executed on L2. Note that such cross-domain messages always call the `relayMessage` function of the `L2ScrollMessenger` contract on L2.
9999

src/content/docs/en/technology/sequencer/zktrie.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ When we insert a new leaf node to a zkTrie, there are two cases illustrated in t
6161

6262
The deletion of a leaf node is similar to the insertion. There are two cases illustrated in the Figure 3.
6363

64-
1. The sibling node of to-be-deleted leaf node is a
64+
1. The sibling node of the to-be-deleted leaf node is a
6565
branch node (Figure 3a). In this case, we can simply replace the node `a` by an empty node and update the node hash of its ancestors till the root node.
66-
2. The node of to-be-deleted leaf node is a leaf node (Figure 3b). Similarly to case 1, we first replace the leaf node by an empty node and start to contract its sibling node upwards until its sibling node is not an empty node. For example, in Figure 3b, we replace the leaf node `b` by an empty node. Because the sibling of node `c` now becomes an empty node, we need to move node `c` one level upward and replace its parent. The new sibling of node `c`, node `e`, is still an empty node. So again we move node `c` upward. Now that the sibling of node `c` is node `a`, a leaf node, the deletion process is finished.
66+
2. The sibling node of the to-be-deleted leaf node is a leaf node (Figure 3b). Similarly to case 1, we first replace the leaf node by an empty node and start to contract its sibling node upwards until its sibling node is not an empty node. For example, in Figure 3b, we replace the leaf node `b` by an empty node. Because the sibling of node `c` now becomes an empty node, we need to move node `c` one level upward and replace its parent. The new sibling of node `c`, node `e`, is still an empty node. So again we move node `c` upward. Now that the sibling of node `c` is node `a`, a leaf node, the deletion process is finished.
6767

6868
Note that the sibling of a leaf node in a valid zkTrie cannot be an empty node. Otherwise, we should always prune the subtree and move the leaf node upwards.
6969

0 commit comments

Comments
 (0)