fabric icon indicating copy to clipboard operation
fabric copied to clipboard

Allow the peer delivery client to select between the Deliverer or BFTDeliverer

Open tock-ibm opened this issue 9 months ago • 12 comments

Current Status

the deliverclient core/deliverservice/deliveryclient.go

Uses either the Deliverer common/deliverclient/blocksprovider/deliverer.go

or the BFTDeliverer common/deliverclient/blocksprovider/bft_deliverer.go

depending on the consensus type - etcdraft/BFT.

Goal

We want to add to the core.yaml a key "peer.deliveryclient.policy" = "simple" / "cluster" that would allow the use of "simple" even when the consensus type is BFT. When consensus type is etcdraft this key is ignored.

Solution

We want to add to the core.yaml a key "peer.deliveryclient.policy" = "simple" / "cluster" that would allow the use of "simple" even when the consensus type is BFT. When consensus type is etcdraft this key is ignored.

tock-ibm avatar May 08 '24 11:05 tock-ibm

@semil

tock-ibm avatar May 08 '24 11:05 tock-ibm

@tock-ibm Why do you want to do this? What problem in the fabric will it solve?

pfi79 avatar May 08 '24 12:05 pfi79

@tock-ibm Why do you want to do this? What problem in the fabric will it solve?

It was suggested by @yacovm that in case the peer organization trusts the ordering service and wants to save bandwidth, it could select the "simple" policy that consumes blocks from a single orderer, rather than the "cluster" policy that consumes blocks from a single orderer and block headers from every other orderer.

tock-ibm avatar May 13 '24 08:05 tock-ibm

Thinking about it, there is also another policy we could easily implement, in which the peer specifies the ordering-org it trusts and wants to pull blocks from. @pfi79 @yacovm @denyeart what do you think?

tock-ibm avatar May 13 '24 08:05 tock-ibm

Thinking about it, there is also another policy we could easily implement, in which the peer specifies the ordering-org it trusts and wants to pull blocks from. @pfi79 @yacovm @denyeart what do you think?

Yes that's also an option.

yacovm avatar May 13 '24 10:05 yacovm

Thinking about it, there is also another policy we could easily implement, in which the peer specifies the ordering-org it trusts and wants to pull blocks from. @pfi79 @yacovm @denyeart what do you think?

It can be done. But why? I mean, the configuration and code will become more difficult. And what do we get?

This is not the only “simple” option for delivering blocks to peer.

pfi79 avatar May 13 '24 10:05 pfi79

Thinking about it, there is also another policy we could easily implement, in which the peer specifies the ordering-org it trusts and wants to pull blocks from. @pfi79 @yacovm @denyeart what do you think?

It can be done. But why? I mean, the configuration and code will become more difficult. And what do we get?

This is not the only “simple” option for delivering blocks to peer.

I think what you get is lower costs.

Since in a multi cloud deployment, the account pays for traffic sent from the server, but not for traffic sent to the server. Therefore, in a simple policy that selects a random block source, you will most likely cause the account that deployed the orderer to pay for traffic, while it may be that you can select to pull from a source which is routable through the internal network and then the account that deployed the orderer doesn't pay for sending these blocks.

yacovm avatar May 13 '24 11:05 yacovm

By the way, I suggested the "simple" option just because the BFT one has more complex code, so if there is a bug we don't know about, we could always have the users fallback on the "simple" option with the code that already existed for quite a while.

yacovm avatar May 13 '24 11:05 yacovm

I think what you get is lower costs.

Since in a multi cloud deployment, the account pays for traffic sent from the server, but not for traffic sent to the server. Therefore, in a simple policy that selects a random block source, you will most likely cause the account that deployed the orderer to pay for traffic, while it may be that you can select to pull from a source which is routable through the internal network and then the account that deployed the orderer doesn't pay for sending these blocks.

Еxcellent use.

I'm sorry, but I'm gonna be a little bit of a nerd.

Your use case, speaks to full control and management of block delivery. But it doesn't. There are alternative delivery methods that I don't think we have control over yet.

pfi79 avatar May 13 '24 12:05 pfi79

Please see #4856 @tock-ibm

semil avatar May 15 '24 13:05 semil

Please see #4856 @tock-ibm

@semil merged

Lets do an integration test for it.

tock-ibm avatar Jun 05 '24 06:06 tock-ibm

@tock-ibm Integration tests ready: #4907

semil avatar Jun 19 '24 10:06 semil