Coder Social home page Coder Social logo

Comments (2)

bestbeforetoday avatar bestbeforetoday commented on July 29, 2024

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.

griffithsrac avatar griffithsrac commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.