Skip to content

Commit 1c7c1d5

Browse files
authored
Merge pull request duneanalytics#104 from springzh/zh-docs-v2
Zh docs V2 原始数据表部分的翻译
2 parents d1de455 + 2edc0ec commit 1c7c1d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+890
-883
lines changed

docs/zh/tables/v2/.pages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: V2 Engine (Databricks SQL)
1+
title: V2 引擎 (Databricks SQL)
22
nav:
33
- raw
44
- decoded
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Blocks
1+
# 区块表
22

33
## arbitrum.blocks
44

5-
Blocks are the building blocks of blockchains and rollups. A block contains transactions which will alter the state of an EVM system incrementally. Transaction within a block can only be executed one after the other, not in parallel.
5+
区块是区块链和汇总(rollups)的构建组件。一个区块包含将逐渐改变EVM系统状态的多个交易。区块内的交易只能一个接一个地执行,不能并行执行。
66

77
| **Column Name** | **datatype** | **Description** |
88
| ------------------- | ------------ | ----------------------------------------- |
9-
| time | timestamptz | the time when the block was mined. |
10-
| number | numeric | the length of the blockchain in blocks |
11-
| hash | string | a unique identifier for that block |
12-
| parent hash | string | the unique identifier for the prior block |
13-
| gas\_limit | numeric | the ArbGas limit of the current block |
14-
| gas\_used | numeric | the ArbGas used in this block |
15-
| miner | string | not applicable |
16-
| difficulty | numeric | not applicable |
17-
| total\_difficulty | numeric | not applicable |
18-
| nonce | string | not applicable |
19-
| size | numeric | not applicable |
20-
| base\_fee\_per\_gas | numeric | not applicable |
9+
| time | timestamptz | 当前区块被开采的时间 |
10+
| number | numeric | 区块链的长度(以区块数为单位) |
11+
| hash | string | 当前区块的唯一标识符 |
12+
| parent hash | string | 前一个区块的唯一标识符 |
13+
| gas\_limit | numeric | 当前区块的ArbGas燃料限制 |
14+
| gas\_used | numeric | 当前区块消耗的ArbGas燃料数量 |
15+
| miner | string | 不适用 |
16+
| difficulty | numeric | 不适用 |
17+
| total\_difficulty | numeric | 不适用 |
18+
| nonce | string | 不适用 |
19+
| size | numeric | 不适用 |
20+
| base\_fee\_per\_gas | numeric | 不适用 |
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Event Logs
1+
# 事件日志表
22

33
## arbitrum.logs
44

5-
This Table stores all logs that get generated by smart contracts. It is sometimes useful for querying contracts that are not yet decoded or are not able to be decoded since the code of the smart contract is not public.
5+
此表存储了智能合约生成的所有事件日志。它对于查询尚未被解码或者由于代码非开源而无法解码的合约很有用。
66

7-
Logs are an elegant way to store tiny amounts of data on EVM blockchains for a small amount of gas. Specifically, event logs are useful to let other people know something has happened without them having to query contracts individually.
7+
事件日志(Logs)是一种在EVM区块链上存储少量数据从而只消耗少量燃料的优雅方式。具体来说,事件日志有助于让其他人不必单独查询具体的合约代码就能知道发生了什么事情。
88

9-
For more on this topic read [this article](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378).
9+
有关此主题的更多信息,请阅读[本文](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378)
1010

11-
**Note: Our topic index is off by 1, so `topic0` shows up as `topic1`, `topic1` shows up as `topic2` and so on.**
11+
**注意:我们的主题索引是从1开始计数的,所以`topic0`显示为`topic1``topic1`显示为`topic2`,以此类推。**
1212

13-
| **Column Name** | **datatype** | **Description** |
13+
| **字段名称** | **数据类型** | **描述** |
1414
| ----------------- | ------------ | ------------------------------------------------------------------------------------------------------------ |
15-
| block\_hash | string | a unique identifier for that block |
16-
| block\_number | int8 | the length of the blockchain in blocks |
17-
| block\_time | timestamptz | the time when the block was mined that includes this log |
18-
| contract\_address | string | The address of the contract that emitted the log |
19-
| topic1 | string | keccak256 hash of a flattened event declaration string |
20-
| topic2 | string | indexed topic of the event |
21-
| topic3 | string | indexed topic of the event |
22-
| topic4 | string | indexed topic of the event |
23-
| data | string | unindexed data containing further information on the event |
24-
| tx\_hash | string | the transaction's hash of the transaction that produced this log |
25-
| index | numeric | this logs´ index position in the block (cumulative amount of logs ordered by execution) |
26-
| tx\_index | numeric | the index position of the transaction in this block (cumulative amount of transactions ordered by execution) |
15+
| block\_hash | string | 当前区块的唯一标识符 |
16+
| block\_number | int8 | 区块链的长度(以区块数为单位) |
17+
| block\_time | timestamptz | 包含此事件日志的区块被开采的时间 |
18+
| contract\_address | string | 发出当前事件日志的合约地址 |
19+
| topic1 | string | 事件声明字符串平展后的keccak256哈希值 |
20+
| topic2 | string | 事件的索引主题1 |
21+
| topic3 | string | 事件的索引主题2 |
22+
| topic4 | string | 事件的索引主题3 |
23+
| data | string | 包含有关事件的更多信息的未索引数据 |
24+
| tx\_hash | string | 产生此事件日志的交易的哈希值 |
25+
| index | numeric | 事件日志在被记录的区块中的索引位置(按执行顺序排序的累计日志数量) |
26+
| tx\_index | numeric | 事件日志归属的交易在区块中的索引位置(按执行顺序排序的累计交易数量) |
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11
---
2-
description: Raw data tables are the basic building blocks of our database.
2+
description: 原始数据表是我们数据库的基本构建块。
33
---
44

55
# Arbitrum
66

7-
Arbitrum is an optimistic rollup that settles it's transactions on Ethereum Mainnet. You can read all about Arbitrum's approach to scaling and building a rollup [in their docs](https://developer.offchainlabs.com/docs/inside\_arbitrum).
7+
Arbitrum是一个通过乐观的汇总(rollup)来结清其在以太坊主网上的交易的L2区块链。您可以在他们的[文档](https://developer.offchainlabs.com/docs/inside\_arbitrum)中阅读有关Arbitrum扩展和构建汇总的方法的所有信息。
88

9-
Arbitrum's execution environment differs from the Mainnet EVM implementation in it's calculation of gas costs. Since Arbitrum is an optimistic rollup that publishes it's transaction on Ethereum Mainnet, the gas calculations have to account for additional factors.
9+
Arbitrum的执行环境与主网EVM实施的不同之处在于它计算燃料成本的方式。由于Arbitrum是在以太坊主网上发布其交易的乐观汇总方案,因此其燃料计算必须考虑其他的因素。
1010

11-
## Gas costs for L1
11+
## L1的燃料成本
1212

13-
Transactions on Arbitrum have to pay for both L1 and L2 resources. The L1 resources are essentially just Ethereum calldata; i.e., you pay the size in raw data of your transaction times Arbitrum's view of the L1 calldata price. This already factors in L1's fluctuating gas prices. The L2 resources in a given transaction are the natively emerging costs for computation and storage that you invoke with your transaction, similar to any other EVM.
13+
Arbitrum上的交易必须同时为L1和L2资源支付燃料。L1资源本质上只是以太坊调用数据;即,您支付交易原始数据的大小乘以Arbitrum对L1调用数据的价格定价。这已经将L1的燃料价格波动考虑在内。给定交易中的L2资源是您在交易中调用的计算和存储的本地新增成本,类似于任何其他EVM链。
1414

15-
Since the "normal" implementation of the Ethereum Virtual Machine does not possess multiple ways to pay gas fees, Arbitrum solved this by including the cost for L1 resources inside of the computational gas units used (`gas_limit` or `gas_used`). Whenever somebody tries to transact on Arbitrum, the RPC endpoint that is called for estimating a sufficient "gas limit" returns an amount of computational gas units that exceeds the standard costs that would incur in a "normal" EVM.
15+
由于以太坊虚拟机的“正常”实现不具备多种支付燃料费用的方式,Arbitrum通过将L1资源的成本包含在使用的计算燃料单位(`gas_limit``gas_used`)中解决了这个问题。每当有人尝试在Arbitrum上进行交易时,RPC端点被调用以估算足够的“燃料限制”,其返回的计算燃料单位数量超过了“正常”EVM中会产生的标准成本。
1616

1717
```
18-
P = "Gas Price" on Arbitrum = Arbitrum's native gas price
19-
G = traditionally "Gas Limit" = L2 gas used + L1 resources used
18+
P = Arbitrum上的“燃料价格” = Arbitrum的本地燃料价格
19+
G = 传统上的“燃料限制” = L2消耗的燃料 + L1资源消耗的燃料
2020
```
2121

22-
Arbitrum's transactions costs are calculated with the following formula:
22+
Arbitrum的交易成本使用以下公式计算:
2323

2424
$$
25-
P*G = Costs
25+
P*G = 交易成本(Costs
2626
$$
2727

28-
G consists of:
28+
G包括:
2929

3030
$$
31-
(L2 \ gas \ used) +\frac{(L1 \ gas \ price * L1\ calldata)}{P} = G
31+
(L2消耗的燃料) +\frac{(L1的燃料价格 * L1调用数据)}{P} = G
3232
$$
3333

34-
The complete calculation therefore consists of:
34+
因此,完整的计算包括:
3535

3636
$$
37-
P * ((L2 \ gas \ used) +\frac{(L1 \ gas \ price * L1\ calldata)}{P}) = Costs
37+
P * ((L2消耗的燃料) +\frac{(L1的燃料价格 * L1调用数据)}{P}) = 交易成本
3838
$$
3939

40-
Looking at this formula, we can now understand that an increasing gas price on Arbitrum leads to cheaper transactions. This is due to the fact that Arbitrum will always publish it's transactions on Ethereum mainnet, whether there is one transaction that needs to be published on mainnet or a thousand. Fees on Arbitrum will only rise if there is an increased demand for blockspace. The increased demand for blockspace in return means that more abritrum transactions get published on mainnet in one "batch publish" transaction, significantly reducing the costs for individual transactions.
40+
通过这个公式我们可以理解Arbitrum上的燃料价格上涨会导致交易更便宜。这是因为无论是需要发布一个还是一千个交易,Arbitrum将始终在以太坊主网上发布其交易。只有在对区块空间的需求增加时,Arbitrum的费用才会上涨。作为回报,对区块空间的需求增加意味着更多Abritrum交易在一次“批量发布”交易中被发布到主网上,因而显著降低了单个交易的成本。
4141

42-
We are reflecting the L1 resources used for Arbitrum Transactions in the column `gas_used_for_l1`.
42+
我们在`gas_used_for_l1`列中反映了用于Arbitrum交易的L1资源的燃料消耗。
4343

44-
### Gas Price Mechanism
44+
### 燃料价格机制
4545

46-
Arbitrum does not follow the EIP1559 standard and instead has its own mechanism for determining gas costs. A transaction will have a `gas_price`, which is treated as the maximum price that the user is willing to pay for this transaction. The actual `gas_price` that is paid by the user will be determined by an [algorithm](https://developer.offchainlabs.com/docs/inside\_arbitrum#price-for-arbgas) within the Arbitrum EVM. This actual `gas_price` that the user pays is reflected in the columnn `effective_gas_price`.
46+
Arbitrum不遵循EIP1559标准,而是有自己的机制来确定燃料成本。一笔交易会有一个`gas_price`,它被视为用户愿意为此交易支付的最高价格。用户支付的实际`gas_price`将由Arbitrum EVM中的 [算法](https://developer.offchainlabs.com/docs/inside\_arbitrum#price-for-arbgas)确定。用户支付的实际`gas_price`反映在`effective_gas_price`列中。
4747

48-
### Calculation of Gas Usage
48+
### 燃料使用量计算
4949

50-
Arbitrum does not follow the standard EVM standards and rules to calculate how much gas is being used by a transaction. That is including and excluding the L1 Resource costs, the costs within Arbitrum's EVM are just calculated differently all together. You can look at the specifications of Arbitrum's AVM opcode costs [in their documentation](https://developer.offchainlabs.com/docs/avm\_specification#instructions).
50+
Arbitrum不遵循标准的EVM规范和规则来计算交易使用了多少燃料。Arbitrum的EVM中的成本以不同的方式计算到一起,其中涉及包括和排除相应的L1资源成本。您可以[在他们的文档中](https://developer.offchainlabs.com/docs/avm\_specification#instructions)查看Arbitrum的AVM操作码成本规范。
5151

52-
**You can't compare Arbitrum gas costs to other EVM chains gas costs!**
52+
**您不能将Arbitrum的燃料成本与其他EVM链的燃料成本进行比较!**
5353

54-
### TL;DR
54+
### 简而言之
5555

56-
Use `effective_gas_price` for calculating gas costs on Arbitrum.
56+
使用`effective_gas_price`计算Arbitrum上的燃料成本。
5757

58-
To look at only the gas costs that occur within the Arbitrum EVM, substract the `gas_used_for_l1` amount from the `effective_gas_price` field.
58+
要查看仅在Arbitrum EVM中发生的燃料成本,请从`effective_gas_price`字段中减去`gas_used_for_l1`的金额。
5959

60-
That being said, you can't compare Arbitrum's gas consumption to other EVM chains gas costs.
60+
话虽如此,您仍然不能将Arbitrum的燃料消耗与其他EVM链的燃料成本进行比较。
6161

62-
### Raw data tables
62+
### 原始数据表
6363

6464
<div class="cards grid" markdown>
65-
- [Blocks](blocks.md)
66-
- [Transactions](transactions.md)
67-
- [Event logs](event-logs.md)
68-
- [Traces](traces.md)
65+
- [区块表(Blocks](blocks.md)
66+
- [交易表(Transactions](transactions.md)
67+
- [事件日志表(Logs)](event-logs.md)
68+
- [内部合约调用表(Traces](traces.md)
6969
</div>

0 commit comments

Comments
 (0)