当客户订购交易时,他是将其发送给所有订购者(如PBFT(还是仅发送给一个/几个订购者?
答案是:"视情况而定"。
在 Fabric 中,共识机制是可插拔的,因此 - 任何人都可以实现自己的排序服务,只要它实现了 AtomicBroadcast gRPC API:
service AtomicBroadcast {
// broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure
rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse) {}
// deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received.
rpc Deliver(stream common.Envelope) returns (stream DeliverResponse) {}
}
如果共识服务是CFT类型,如Kafka或Raft - 那么客户端只需要向单个排序者发送交易。
然而,对于Hyperledger Fabric,有非官方的拜占庭容错共识服务实现,在这些实现中,客户端不能假设选定的排序者会诚实地包含其交易,因此它需要像PBFT论文中那样将请求发送到所有节点。
当 Fabric 具有正式的 BFT 排序器时,需要对客户端进行适当的配置。