secretflow / yacl

YACL (Yet Another Common crypto library) is a C++ library that contains cryptography, network and io modules which other SecretFlow code depends on.
https://www.secretflow.org.cn/en/docs/yacl/main/
Apache License 2.0
77 stars 64 forks source link

Problems in Black box interconnection #102

Closed maths644311798 closed 1 year ago

maths644311798 commented 1 year ago

(1) Are there any more explanations about “Black box interconnection transport layer protocol” than blackbox_service.proto?

(2) It seems that the difference between ChannelBrpcBlackBox and ChannelBrpc is: the former builds a channel via environment variables while the latter inputs information explicitly. What’s the main reason to write these two classes of channels instead of one?

(3) Many error codes are defined in blackbox_service_errorcode.h. But where are they set? For example, where is the code that sets “QueueFull”?

huocun-ant commented 1 year ago
  1. The blackbox_service.proto is for UnionPay Privacy Computing Interconnection Agreement. You can search related reports,like this report.
  2. ChannelBrpc is for is for direct connection communication between two engines, while ChannelBrpcBlackBox is intended for use on interconnected platforms, the channel will communicate with a transport service which is is managed and scheduled by a framework, like KUSIA.
  3. These errorcode is defined by the agreement, add would be set by the transport service. Like this: image

It does take a lot of background information to understand ChannelBrpcBlackBox, but maybe you can ignore it because basically it's just a way of sending and receiving messages.

Eiji911 commented 1 year ago

Error code were defined in https://github.com/be-io/interconnection-bfia/blob/main/bfia/mesh/api/Specifications_CN.md. In addition, we add three error codes(E0000000700、E0000000608、E0000000413) which will be append to Specifications_CN.md lately. Currently you can see them in https://github.com/secretflow/kuscia/blob/main/pkg/transport/transerr/error_code.go

maths644311798 commented 1 year ago

@huocun-ant

image

In the picture, should the text below "pop_request" be "response(pop)"?

huocun-ant commented 1 year ago

@huocun-ant

image

In the picture, should the text below "pop_request" be "response(pop)"?

It's the same. What I want to express is that if B wants to receive the message (headshake_request) sent to it by A, it needs to call the pop operation of the transport service B, transport service B will put the previously cached message "headshake_request" into "response(pop)",and B will be considered to have received the message.

huocun-ant commented 1 year ago

@maths644311798 To be precise, all responses from the transport service to comp are TransportOutbound. https://github.com/secretflow/yacl/blob/main/yacl/link/transport/blackbox_interconnect/blackbox_service.proto#L25C1-L25C1 And payload may be empty.