哪些因素会影响 HLF 1.4.4 中区块中的交易顺序?

What factors influence the ordering of transactions in a block in HLF 1.4.4?

在 hyperledger fabric 交易流程的documentation中提到

"排序服务不需要检查交易的全部内容来执行其操作,它只是从网络中的所有渠道接收交易,按渠道按时间顺序排序,然后每个通道创建交易块。"

我有几个问题

  1. “时间顺序”是什么意思?.这是否意味着通道的交易根据在排序服务节点(领导者)收到交易的时间进行排序?

  2. 如果两个客户端应用程序几乎同时为账本上的同一个键提交更新交易[让我们称它们为 tx1(将键 x 更新为值 p),tx2(更新键x to value q)],所有背书节点将模拟更新交易提议和return交易提议响应中的写入集。当客户端向排序服务节点发送这些背书提议请求时,这些更新交易在一个区块中会以什么顺序排序?.

区块中的交易顺序可以是tx1,tx2 OR tx2,tx1,假设更新交易只有write set没有read set,这两个顺序的交易都是有效的。分类帐 [p 或 q] 上密钥的最终值是多少?

我想了解 x 的最终值是否是确定性的,以及哪些因素会影响它。

What does "chronological ordering" mean?. Does it mean that the transactions for a channel are ordered depending on the time they are received at the Ordering service node (Leader)?

一般来说,排序器不保证消息的传递顺序,只是保证消息将以相同的顺序传递到所有对等节点。

在实践中,以下通常适用于当前排序器实现:

Solo - 消息应按接收顺序传送

Kafka - 消息应该按照每个排序节点接收消息的顺序传递,通常甚至按照跨多个排序节点接收消息的顺序传递。

这也适用于最新的结构版本。

If two client applications are submitting an update transaction for the same key on the ledger almost at the same time [Let us call them tx1 (updating key x to value p) , tx2 (updating key x to value q)], all the endorsing peers will simulate the update transaction proposal and return the write set in the transaction proposal response. When the clients send these endorsement proposal requests to ordering service nodes, in which order will these update transactions be ordered in a block ?.

当你提交交易时,节点会生成一个读写集。这个 read/write 集随后会在交易提交到账本时使用。它包含要 read/written 的变量的名称及其读取时的版本。如果在集合创建和提交之间,提交了一个不同的事务并更改了变量的版本,则原始事务将在提交期间被拒绝,因为读取时的版本不是当前版本。

为了解决这个问题,您必须创建数据和事务结构来避免同时编辑同一个键,否则您可能会遇到 MVCC_READ_CONFLICT 错误。