Re: [hyperledger/fabric] Remove chaincode instance variables from example chaincodes (#1981)


Brian Behlendorf <bbehlendorf@...>
 

This is another fascinating discussion I thought folks on the list may want to follow.

Brian


-------- Forwarded Message --------
Subject: Re: [hyperledger/fabric] Remove chaincode instance variables from example chaincodes (#1981)
Resent-Date: Fri, 24 Jun 2016 18:19:15 -0700 (PDT)
Resent-From: Brian Behlendorf <brian@...>
Resent-To: bbehlendorf@...
Date: Fri, 24 Jun 2016 06:56:55 -0700
From: sachikoy <notifications@...>
Reply-To: hyperledger/fabric <reply+000a22e3184158bd3d709d66bbd1af0c3d384df6a554ee4592cf000000011384fe2792a169ce09a851a2@...>
To: hyperledger/fabric <fabric@...>


We have developed a reasonably big chain code as a prototype application, and found that it is quite easy to write a non-deterministic code.
For example, one can write non-deterministic chain code by

  • using associative arrays with iteration (the order is randomized in Go lang)
  • reading list of items from KVS table (the order is not guaranteed)
  • or writing thread-unsafe chain code (query and invoke may be called in parallel)

I am sure we can find more.
The problem is that it is quite difficult to debug the non-deterministic chaincode. An app developer can easily develop a chaincode that is non-deterministic unless he has sufficient understanding in the behaviour of Go programs.
Some kind of domain specific language, or a validation tool, should certainly help.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.



Join fabric@lists.hyperledger.org to automatically receive all group messages.