ethereum-compass icon indicating copy to clipboard operation
ethereum-compass copied to clipboard

第四章数据结构-资料篇:区块-区块体-transactions交易列表 解释有误

Open Karry-Almond opened this issue 3 years ago • 0 comments

该书原文: transactions 交易列表: 所有入选该区块的交易的哈希值列表,每个哈希是一个 32字节 的数据。根据哈希值,可以用客户端在以太坊节点上唯一查询该笔交易

但是根据github的geth源码: https://github.com/ethereum/go-ethereum/blob/master/core/types/block.go#L168 type Block struct { header *Header uncles []*Header transactions Transactions ...

以及 https://github.com/ethereum/go-ethereum/blob/6c3513c0775e1e1e69a7c9e5c86255804fa3fb36/core/types/transaction.go#L51 `type Transaction struct { inner TxData // Consensus contents of a transaction time time.Time // Time first seen locally (spam avoidance)

// caches
hash atomic.Value
size atomic.Value
from atomic.Value

}

type TxData interface { txType() byte // returns the type ID copy() TxData // creates a deep copy and initializes all fields

chainID() *big.Int
accessList() AccessList
data() []byte
gas() uint64
gasPrice() *big.Int
gasTipCap() *big.Int
gasFeeCap() *big.Int
value() *big.Int
nonce() uint64
to() *common.Address

rawSignatureValues() (v, r, s *big.Int)
setSignatureValues(chainID, v, r, s *big.Int)

}`

可以看出,这里的区块体中装载的是交易本身(即包含了to,from,data等信息)

另外根据以太坊黄皮书, “一系列的交易 BT” ,也指的是字节序列的交易。

Karry-Almond avatar Feb 14 '22 16:02 Karry-Almond