Skip to content

Commit 6fb0b33

Browse files
authored
Update brucexu-eth.md
1 parent 48debc4 commit 6fb0b33

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

brucexu-eth.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,63 @@ The ideas and proposed changes from the community are coordinated using EIP proc
223223

224224
TODO https://notes.ethereum.org/@mikeneuder/rcr2vmsvftv
225225

226-
TODO https://epf.wiki/#/eps/week2
226+
# 2025.02.13
227+
228+
## https://epf.wiki/#/eps/week2
229+
230+
### https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md#modified-process_execution_payload
231+
232+
```
233+
class ExecutionPayload(Container):
234+
# Execution block header fields
235+
parent_hash: Hash32 # 上一个区块的 hash,连起来
236+
fee_recipient: ExecutionAddress # 'beneficiary' in the yellow paper 执行层中,是区块提交者的地址
237+
state_root: Bytes32
238+
receipts_root: Bytes32
239+
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM] # 用于日志过滤的 bloom 过滤器,用于快速查找日志
240+
prev_randao: Bytes32 # 'difficulty' in the yellow paper
241+
block_number: uint64 # 'number' in the yellow paper
242+
gas_limit: uint64
243+
gas_used: uint64
244+
timestamp: uint64
245+
extra_data: ByteList[MAX_EXTRA_DATA_BYTES]
246+
base_fee_per_gas: uint256
247+
# Extra payload fields
248+
block_hash: Hash32 # Hash of execution block
249+
transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]
250+
withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] # 目前区块的提款列表
251+
blob_gas_used: uint64 # [New in Deneb:EIP4844]
252+
excess_blob_gas: uint64 # [New in Deneb:EIP4844]
253+
```
254+
255+
需要进行能力扩展和数据增加,就是通过类似 EIP4844 这样的标准,创建新的标准,然后客户端来实现读取和保存记录。
256+
257+
真实的信息和数据:
258+
259+
![image](https://github.com/user-attachments/assets/185dcd23-b49a-4980-8c9a-f6f66d365543)
260+
261+
![image](https://github.com/user-attachments/assets/51da5284-ff7a-44af-8b53-b286f9e35555)
262+
263+
![image](https://github.com/user-attachments/assets/7861ddc2-dc22-4da3-84aa-406d639f2eda)
264+
265+
logs_bloom 的工作原理:
266+
267+
- logs_bloom 是一个固定大小的位数组,通常为256字节,即2048位。
268+
- 当一个新的日志被添加到区块中时,计算该日志的哈希值,并使用多个哈希函数(如3个)生成多个哈希值。
269+
- 将这些哈希值映射到logs_bloom的位数组中,将对应的位设置为1。
270+
- 查询某个日志是否存在于某个区块的时候,只需要计算日志的 hash,然后快速检查 logs_bloom 的对应的位置是否全部为 1,如果是,那么日志可能在当前区块。可能会存在误报
271+
- 通过这个,可以快速过滤不包含特定日志的区块,提高检索效率,比如查询 event 发生在哪些区块,从而仅仅加载和处理相关区块
272+
273+
TODO Hackerscan 可以加入查看原始区块信息的功能,没有找到 logs_bloom 的原始数据
274+
275+
TODO Contract Internal Transactions 是什么?跟 Block 的 transactions 区别是什么?
276+
277+
TODO 明天把整个区块的所有信息和内容过一下 https://etherscan.io/block/21833528 https://eth.blockscout.com/block/21833528?tab=index
278+
279+
TODO randao
280+
TODO withdrawals 提款工作原理?
281+
282+
227283

228284

229285

0 commit comments

Comments
 (0)