hyperledger / fabric-gateway

Go, Node and Java client API for Hyperledger Fabric v2.4+
https://hyperledger.github.io/fabric-gateway/
Apache License 2.0
154 stars 91 forks source link

Use Gateway peer local ledger height when selecting peers #558

Closed bestbeforetoday closed 1 year ago

bestbeforetoday commented 1 year ago

As an application developer I want the Gateway peer to use the ledger height obtained directly from its local ledger So that the latest available information is used for evaluate / endorse peer selection

The Gateway peer currently uses only ledger heights obtained from service discovery to aid selection of the highest block height peer. Since there is a minimum time window between service discovery updates being published, the ledger height for the local peer recorded in service discovery can be slightly behind the actual point-in-time ledger height. Instead the Gateway peer should query the height of its local ledger directly instead of relying on the ledger height obtained from service discovery for itself.