Skip to content

Commit da466ab

Browse files
committed
Translation of task arbitrum
1 parent 4c7ec3a commit da466ab

File tree

3 files changed

+80
-46
lines changed

3 files changed

+80
-46
lines changed

basic/27-Arbitrum-layer2/README-CN.md

+28-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Arbitrum
22

3-
Arbitrum bridge:<https://bridge.arbitrum.io/>
4-
53
与 optimism 差别在于: 交互式证明挑战
64

75
Optimism 的争议解决比 Arbitrum 更依赖于以太坊虚拟机 (EVM)。当有人提交关于 Optimism 的挑战时,**整个有问题的交易都通过 EVM 运行**。相比之下,**Arbitrum 使用链下争议解决流程将争议减少到一笔交易中的一个步骤**。然后,协议将这个一步断言(而不是整个交易)发送到 EVM 进行最终验证。因此,从概念上讲,Optimism 的争议解决过程比 Arbitrum 简单得多。
@@ -26,11 +24,13 @@ Optimism 的争议解决过程比 Arbitrum 更简单、更快捷,因为它只
2624
AVM 与 EVM 的不同:
2725
AVM 既支持执行交易,又支持证明(L1 合约相信某个断言是真的)
2826

29-
## 开发
27+
## L1 to L2 messaging
28+
29+
### Ethereum to Arbitrum: Retryable Tickets
3030

31-
### L1 to L2 messaging
31+
Retryable tickets are the Arbitrum protocol’s canonical method for passing generalized messages from Ethereum to Arbitrum. A retryable ticket is an L2 message encoded and delivered by L1; if gas is provided, it will be executed immediately. If no gas is provided or the execution reverts, it will be placed in the L2 retry buffer, where any user can re-execute for some fixed period (roughly one week).
3232

33-
<https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/greeter>
33+
- <https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/greeter>
3434

3535
### L2 to L1 messaging
3636

@@ -47,6 +47,8 @@ https://developer.offchainlabs.com/docs/useful_addresses
4747

4848
## Quick Start
4949

50+
### depoly SimpleToken
51+
5052
- 安装依赖
5153

5254
```bash
@@ -77,6 +79,27 @@ https://developer.offchainlabs.com/docs/useful_addresses
7779
Token address: 0x...
7880
```
7981

82+
### L1 to L2
83+
84+
```sh
85+
node ./scripts/L1toL2.js
86+
```
87+
88+
output:
89+
90+
```sh
91+
Arbitrum Demo: Cross-chain Greeter
92+
Lets
93+
Go ➡️
94+
...🚀
95+
96+
Deploying L1 Greeter 👋
97+
deployed to 0x24b11e81B6477129f298e546c568C20e73b6DD5b
98+
Deploying L2 Greeter 👋👋
99+
deployed to 0x4998e921AC9Cd7ba3B2921aDA9dCedbDC1341465
100+
...
101+
```
102+
80103
## 参考链接
81104

82105
- <https://developer.offchainlabs.com/docs/inside_arbitrum>

basic/27-Arbitrum-layer2/README.md

+51-40
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
# Arbitrum
22

3-
与 optimism 差别在于: 交互式证明挑战
3+
The difference between Arbitrum and Optimism lies in the Interactive Proving challenge.
44

5-
Optimism 的争议解决比 Arbitrum 更依赖于以太坊虚拟机 (EVM)。当有人提交关于 Optimism 的挑战时,**整个有问题的交易都通过 EVM 运行**。相比之下,**Arbitrum 使用链下争议解决流程将争议减少到一笔交易中的一个步骤**。然后,协议将这个一步断言(而不是整个交易)发送到 EVM 进行最终验证。因此,从概念上讲,Optimism 的争议解决过程比 Arbitrum 简单得多。
5+
Arbitrum is more dependent on Ethereum virtual machine (EVM). When someone submits a challenge in Optimism, **The transaction in question is run through EVM**. In contrast, **Arbitrum uses the off-chain dispute resolution process to reduce the dispute to one step in a transaction **. The protocol then sends this one-step assertion (rather than the entire transaction) to EVM for final validation. Therefore, conceptually speaking, the dispute resolution process of Optimism is much simpler than Arbitrum.
66

7-
交互式证明的好处:
7+
Advantages of Interactive Proving:
88

9-
1. 在乐观情况下效率更高;
10-
2. 在悲观情况下效率更高;
11-
3. 每笔交易更大的 gaslimit,合约大小不受限制;
9+
1. More efficient in the optimistic case;
10+
2. More efficient in the pessimistic case;
11+
3. Much higher per-tx gas limit;
12+
4. No limit on contract size
13+
5. More implementation flexibility
1214

13-
这意味着在有争议的交易的情况下,在 Arbitrum 的案例中,以太坊的最终确认比在 Optimism 的案例中延迟的时间更长。
14-
Arbitrum 争议解决的优势在于它在链上(即以太坊)交易成本方面更便宜。
15+
This means that in the case of disputed transactions, in the case of Arbitrum, the final confirmation of Arbitrum will be delayed longer than that of Optimism.
1516

16-
Optimism 的争议解决过程比 Arbitrum 更简单、更快捷,因为它只是通过 EVM 提供有争议的交易。这个速度在这里是 Optimism 的优势,因为争议可以快速解决,并且不会妨碍 rollup 链的未来进展。
17+
Arbitrum is cheaper in transaction cost in dispute settlement (in Layer1).
1718

18-
## Pipelining
19+
The dispute resolution process of Optimism is simpler and faster than Arbitrum, because it only provides disputed transactions to EVM. Speed is an advantage of Optimism, because disputes can be resolved quickly and without interfering with future progress of the rollup chain.
1920

20-
人们担心的是“多轮”争议解决程序,例如 Arbitrum 使用的一个程序。至少从理论上讲,垃圾邮件发送者可以通过发起一系列连续的挑战来阻止 Rollup 的进展,每个挑战都需要相当长的时间来解决。事实上,这是一个困扰 Arbitrum 之前迭代的问题。
21+
## The Arbitrum 2.0 protocol
2122

22-
然而,Arbitrum 更新的协议适用于这个问题,一种称为“流水线(Pipelining)”的优雅解决方案。 流水线允许网络验证器继续处理交易以获得最终批准,即使先前处理的交易存在争议。 这创建的是最近处理但尚未完成的交易的“管道”,而不是阻止排序器处理交易和网络各方提交挑战的瓶颈。
23+
The current Arbitrum protocol makes important advances over the original Arbitrum protocol in that it supports multiple pipelined DAs In the new protocol, each state can have at most one DA following from it. If a DA has no following state, then anybody can create a DA that follows it, creating a new branch point. The result will be a tree of possible futures, like the one shown below.
2324

24-
AVM 与 EVM 的不同:
25-
AVM 既支持执行交易,又支持证明(L1 合约相信某个断言是真的)
25+
## AVM
26+
27+
The Arbitrum Virtual Machine (AVM) is the interface between the Layer 1 and Layer 2 parts of Arbitrum. Layer 1 provides the AVM interface and ensures correct execution of the virtual machine.
28+
29+
Every Arbitrum chain has a single AVM which does all of the computation and maintains all of the storage for everything that happens on the chain.
30+
31+
Differences between AVM and EVM are motivated by the needs of Arbitrum's Layer 2 protocol and Arbitrum's use of a interactive proving to resolve disputes.
32+
33+
### Gotchas
34+
35+
Block Numbers: Arbitrum vs. Ethereum
36+
37+
- One Ehtereum block may contain several Arbitrum's multiple block.
38+
- Arbitrum block use layer1's `blocktimestamp`
39+
40+
Useful Addresses: <https://developer.offchainlabs.com/docs/useful_addresses>
2641

2742
## L1 to L2 messaging
2843

@@ -36,41 +51,34 @@ Retryable tickets are the Arbitrum protocol’s canonical method for passing gen
3651

3752
<https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/outbox-execute>
3853

39-
### Gotchas
40-
41-
Block Numbers: Arbitrum vs. Ethereum
42-
一个以太坊 block 可能包含多个 arbi 的多个 block
43-
blocktimestamp 使用的是 layer1 的;
44-
45-
一些常用地址:
46-
https://developer.offchainlabs.com/docs/useful_addresses
47-
4854
## Quick Start
4955

5056
### depoly SimpleToken
5157

52-
- 安装依赖
58+
- install dependencies
5359

5460
```bash
5561
yarn
5662
```
5763

58-
- 配置环境变量
59-
复制 .env.example 文件为 .env 文件, 然后配置其中的 PRIVATE_KEY,INFURA_ID
64+
- config env variables
65+
copy .env.example file rename it to .env, then modify `PRIVATE_KEY` and `INFURA_ID`
6066

61-
- 转 eth 到 arbitrum 测试网络
62-
因为 arbitrum 测试网络对应的是 rinkeby, 所以需要在 rinkeby 测试网络上有测试币 , 可以通过 [rinkeby 测试网](https://faucet.rinkeby.io/) 获取测试币.
63-
之后需要把 rinkeby 测试币转移到 arbitrum 二层网络上, 可以通过 [arbitrum bridge](https://bridge.arbitrum.io/) 进行操作, 测试币转移需要等待 10 mins 左右
67+
- switch network to arbitrum testnet (arbitrum rinkeby)
6468

65-
测试币转移成功后, 通过 metaMask 可以看到在 arbitrum 上面的余额
69+
Because the testnet is arbitrum rinkeby, so we need get some test token from ethereum rinkeby network [rinkeby 测试网](https://faucet.rinkeby.io/).
6670

67-
- 执行测试脚本
71+
Then transfer ethereum rinkeby test token to arbitrum testnet through [arbitrum bridge](https://bridge.arbitrum.io/) , it will take 10mins.
72+
73+
After a while, we can see balance on arbitrum testnet is not zero any more.
74+
75+
- run script
6876

6977
```bash
7078
npx hardhat run scripts/deploy.js --network arbitrum_rinkeby
7179
```
7280

73-
命令行输出 (421611 Arbitrum-Rinkeby chainId)
81+
output content (421611 is Arbitrum-Rinkeby chainId)
7482

7583
```bash
7684
Network ChainId: 421611
@@ -100,14 +108,17 @@ deployed to 0x4998e921AC9Cd7ba3B2921aDA9dCedbDC1341465
100108
...
101109
```
102110

103-
## 参考链接
111+
## TODO
112+
113+
- L2 to L1 messaging demo
114+
115+
## Reference
104116

105117
- <https://developer.offchainlabs.com/docs/inside_arbitrum>
106118
- Arbitrum github: <https://github.com/OffchainLabs>
107-
- 中文文档: <https://github.com/dysquard/Arbitrum_Doc_CN>
108-
- 与 op 对比: <https://medium.com/stakingbits/guide-to-arbitrum-and-setting-up-metamask-for-arbitrum-543e513cdd8b>
109-
- 很详细的原理介绍 <https://new.qq.com/omn/20210709/20210709A0CL6M00.html>
110-
- <https://github.com/dysquard/Arbitrum_Doc_CN/blob/master/2_%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3%E5%8D%8F%E8%AE%AE/>
111-
- rollup 详细解读: <https://q6rsx4wom8.feishu.cn/file/boxcnu89en45JWelsoUv8nIwdRc>
112-
- arbi 简介 <https://q6rsx4wom8.feishu.cn/file/boxcnu89en45JWelsoUv8nIwdRc>
113-
- 幕布树形图: <https://mubu.com/app/edit/clb/NIhGqZda80#m>
119+
- Arbitrum docs-CN: <https://github.com/dysquard/Arbitrum_Doc_CN>
120+
- compare with OP: <https://medium.com/stakingbits/guide-to-arbitrum-and-setting-up-metamask-for-arbitrum-543e513cdd8b>
121+
- Difference between Arbitrum and Optimism: <https://new.qq.com/omn/20210709/20210709A0CL6M00.html>
122+
- Layer2 Rollup: <https://q6rsx4wom8.feishu.cn/file/boxcnu89en45JWelsoUv8nIwdRc>
123+
- arbi intro: <https://q6rsx4wom8.feishu.cn/file/boxcnu89en45JWelsoUv8nIwdRc>
124+
- Mubu tree graph: <https://mubu.com/app/edit/clb/NIhGqZda80#m>

basic/27-Arbitrum-layer2/scripts/L1toL2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const main = async () => {
8787
*/
8888
const l1ToL2MessageGasEstimate = new L1ToL2MessageGasEstimator(l2Provider);
8989

90-
const _submissionPriceWei = await l1ToL2MessageGasEstimate.estimateSubmissionFee(
90+
const _submissionPriceWei = await l1ToL2MessageGasEstimate.estimateSubmissionPrice(
9191
l1Provider,
9292
await l1Provider.getGasPrice(),
9393
newGreetingBytesLength

0 commit comments

Comments
 (0)