Comments (2)
endorsed = Math.min(required, endorsed++)
certainly looks like an obvious bug. I guess it should be endorsed = Math.min(required, endorsed + 1)
.
The endorsement logic is complicated enough (to me) for it to be difficult to be 100% certain of side-effects, but it does look like you are correct about endorsers.size() >= required
too. Maybe it should be endorsers.size() >= getStillRequired()
.
My guess is that this scenario isn't typically hit as there are enough active peers or groups that endorsement requirements can be met on the first pass. I am actually a little dubious of the value of the SDK making some arbitrary number of retry attempts at endorsement. One pass through all the potential endorsement plans / layouts seems like it should generally be sufficient, with it then being a client application decision whether the entire endorsement process should be retried, or some other action should be taken.
Since the code doesn't look to be working the way it was intended, you are welcome to submit a pull request with a code fix. Ideally it would have some testing to confirm correct behaviour but I appreciate that the code structure does not lend itself at all to unit testing, so this may not be practical - at least not without some fairly significant refactoring, which carries its own risks without the safety net of good test coverage.
I would encourage everyone to switch to the Fabric Gateway client API as soon as you are able to get to Fabric v2.4+.
from fabric-sdk-java.
Okay, I've attempted to create a pull request 👍 Let me know if I've done anything wrong with the pull request, coming from gitlab everything is similar but slightly different!
Re the test: I've added a very minor unit test for the methods in which the bugs are present, but it's not truely testing the Channel.sendTransactionProposalToEndorsers
because like you said it would be far trickier and possibly require more extensive changes.
Re Fabric Gateway: yes, I believe it is scheduled on our plan somewhere! 🤞
from fabric-sdk-java.
Related Issues (20)
- Getting block time exceeded 5 seconds for channel mychannel when peer join channel HOT 4
- New version release date with Log4j vulnerability managed HOT 1
- Jndi log4j vulnerability in fabric-sdk-java v2.1.1? HOT 1
- log4j2 issue HOT 1
- NetworkConfig.getPrivateKeyFromString read private key exception HOT 2
- Customization in the number of connections to hlf peer is unavailable and uses large number of threads HOT 2
- log4j update dependency HOT 2
- log4j Security Vulability CVE-2021-44832 Security Issue
- GeneratedMessageV3.isStringEmpty NoSuchMethodError issue HOT 3
- Separate logging of warnings and errors in channel.sendTransaction() method in low level java SDK
- Comment about `SERVICE_DISCOVERY` is incorrect and same with `EVENT_SOURCE`. HOT 1
- virtual machines entropy document links is broken
- Maven repository link is wrong
- Fabric read the docs: Chaincode for Operators is broken
- Cannot commit chaincode approve HOT 3
- release-2.2 mutual tls config key and peer property key not matching HOT 5
- fanric-java-sdk how to use Taking ledger snapshots and using them to join channels HOT 2
- Intermittent test failure: chaincode event ordering
- Vulnerable dependencies HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fabric-sdk-java.