1. 01 May, 2018 1 commit
    • Alessandro Sorniotti's avatar
      [FAB-6381] Secure defaults for txsFilter · 53de0781
      Alessandro Sorniotti authored
      
      
      The aim of this change set is to apply the well-established "Secure by
      default" security principle to the way the validator validates transactions
      in a block.
      
      The current code behaves as follows: create an array of validation codes, set
      by default to "all transactions are valid"; then perform validation which may
      mark transactions as invalid. Furthermore, in other parts of the code, if no
      array of validation codes is yet persent in the block, a new one is
      indiscriminately created (again, marking all transactions as valid). This
      approach is a security anti-pattern because it opens up to attacks where an
      adversary may force the code through a path where the default "tx is valid"
      validation code is maintained even for invalid txes.
      
      This change set ensures that validation code arrays are created and set to a
      new value (TxValidationCode_NOT_VALIDATED) which ensures that a transaction
      that hasn't been validated cannot be mistaken for a valid one.
      
      Change-Id: I5dbb18dd77af3cd14b168042ae660e4e27bf29dd
      Signed-off-by: default avatarAlessandro Sorniotti <ale.linux@sopit.net>
      53de0781
  2. 25 Apr, 2018 1 commit
  3. 23 Apr, 2018 1 commit
    • Jason Yellick's avatar
      [FAB-9581] Pass sccprovider into chaincode New · 64c38b0a
      Jason Yellick authored
      
      
      Presently, system chaincodes use an antipattern of calling into another
      package to ask how to do something, rather than being told how that
      thing should be done.
      
      This CR inverts the control so that at instantiation time, the system
      chaincode is given the sysccprovider rather than asking for it.
      
      Change-Id: I4c445fa9bcf7857cb1fe15b7dda59b9fe849e77f
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
      64c38b0a
  4. 19 Apr, 2018 1 commit
    • Jason Yellick's avatar
      [FAB-9580] Create SCC instances by constructor · 27121be1
      Jason Yellick authored
      
      
      This is the first in a series of CRs whose goal is to restructure the
      existing chaincodes under the principles of depencency inversion.
      
      Today, the assorted SCCs call out into the "system chaincode provider"
      or other singletons which makes mocking difficult and initialization
      haphazard.
      
      This CR is a first step which pulls the singleton references out of the
      Init functions and pushes them into constructor functions.  The next
      step will be to modify these constructors such that they accept their
      required dependencies.
      
      Change-Id: I8ee1343ed8acad12e4445f90c73a08c7fd0182fe
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
      27121be1
  5. 12 Apr, 2018 1 commit
  6. 20 Dec, 2017 1 commit
  7. 08 Dec, 2017 1 commit
  8. 29 Sep, 2017 2 commits
  9. 30 Aug, 2017 1 commit
    • Jason Yellick's avatar
      [FAB-5819] Combine old/new channelconfig · 0cd16262
      Jason Yellick authored
      
      
      This is a cleanup CR which consolidates the mixed references to the old
      channel config code and the new channel config code.  In general, either
      reference is simply changed to refer to fabric/common/channelconfig but
      there are some package names which need cleanup as well.
      
      Although large and scary looking, this is purely rearrangements of
      imports and package names, no actual code logic is changed in this one.
      
      Change-Id: Iddb2878782307ede3b2786f035673effe1425b86
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
      0cd16262
  10. 11 Aug, 2017 1 commit
    • Jason Yellick's avatar
      [FAB-5646] Move channel config to config/channel · 8dc78833
      Jason Yellick authored
      
      
      This is the first CR in a series designed to split the conflation of
      configtx processing and channel configuration.  The bulk of the code in
      fabric/common/config is specific to this channel configuration, so, this
      CR moves the entirety of this directory to fabric/common/config/channel.
      
      Ultimately, the common pieces will be extracted and moved back, but in
      the interest of making things reviewable and minimizing the diff, it
      makes sense to do this bulk move in one CR, then the move back in
      another.
      
      Change-Id: I124d48b0cbc7fd482e5118177ba9d59a81241d27
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
      8dc78833
  11. 01 Aug, 2017 1 commit
    • Baohua Yang's avatar
      [FAB-5194] Fix usage problems in code · 76c0dc56
      Baohua Yang authored
      
      
      This patchset helps clean up the code and docs:
      
      * Fix redundant parenthesese.
      * Fix mismatching params in func return.
      * Fix variable name collides with imported package name and builtin
        function or reserved words.
      * Fix word typos.
      
      Change-Id: I30304c233067ead7e74d18e3caf2604b3ed1490a
      Signed-off-by: default avatarBaohua Yang <yangbaohua@gmail.com>
      76c0dc56
  12. 13 Jun, 2017 1 commit
    • Artem Barger's avatar
      [FAB-4327] Don't let peer to crash · e4b91f57
      Artem Barger authored
      
      
      Currently peer panics and dies while receiving genesis of the ordering
      service, there is no way to recover after such a failure (even after
      restarting the peer). This commit takes care to check block type before
      trying to create a channel.
      
      Change-Id: Ia72c3e6cccff0632b81f1334fb87841a2aecdab9
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
      e4b91f57
  13. 01 Jun, 2017 1 commit
  14. 17 May, 2017 2 commits
  15. 23 Apr, 2017 1 commit
    • Artem Barger's avatar
      [FAB-3344] Fix CSCC error messages · ffbf6043
      Artem Barger authored
      
      
      This commit fixes the error messages of the CSCC:
      
      1. JoinChannel call provided with genesis block, hence args[1] is a
      block and not channel it as expected in error message, hence to prevent
      putting entire block into error message, channel id is extracted
      instead.
      
      2. GetChannel doesn't get any parameters and therefore in order to avoid
      panic on accessing non existing args[1], this part of error message is
      removed.
      
      Change-Id: Ifcfc543afa5d694c963a65d688056e4d072b9379
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
      ffbf6043
  16. 22 Apr, 2017 1 commit
    • Will Lahti's avatar
      [FAB-2351] Update loggers to flogging.MustGetLogger · 7132dd54
      Will Lahti authored
      
      
      This CR updates all loggers throughout the code base to use
      `flogging.MustGetLogger`. This function wraps `logging.MustGetLogger`
      and tracks the logger modules defined in the system. This enables the
      ability to set log levels for modules using regular expressions.
      and make it easy to change the levels for any module and all its
      submodules with a single command (e.g. gossip, ledger, msp).
      
      Change-Id: If5d3229ea2312adb56fc21bfdafbed3d967cf1df
      Signed-off-by: default avatarWill Lahti <wtlahti@us.ibm.com>
      7132dd54
  17. 20 Apr, 2017 1 commit
  18. 18 Apr, 2017 1 commit
  19. 04 Mar, 2017 1 commit
  20. 24 Feb, 2017 1 commit
  21. 18 Feb, 2017 1 commit
  22. 31 Jan, 2017 1 commit
    • Artem Barger's avatar
      [FAB-1924]: Rework delivery client · 945c4f7a
      Artem Barger authored
      
      
      Move ordering service delivery client management into
      gossip service, this to be able to maintain single
      connection to the ordering service. Moreover this to
      be widely used after gossip based leader election
      integrated.
      
      Change-Id: Iea9a70a1d6ba82caa55716444c54f3ddbc19673b
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
      945c4f7a
  23. 26 Jan, 2017 1 commit
  24. 24 Jan, 2017 1 commit
    • jiangyaoguo's avatar
      FAB-1457 Change return value of chaincode · a5e2d2b5
      jiangyaoguo authored
      Replace return value of chaincode form ([]byte, error) to pb.Response.
      So that we can define different kinds of errors. More detail could be
      seen at https://jira.hyperledger.org/browse/FAB-1457
      
      . Now chaincode
      result will pass through shim/chaincode_spoort without converting.
      This commit define basic Status Code(200 for success and 500 for error).
      More code defination and handle logic will be added in following commit.
      Change chaincode examples interfaces and use basic code(200/500).
      
      Change-Id: I2ace7f4f654d343874274c26847f0dac91050d26
      Signed-off-by: default avatarjiangyaoguo <jiangyaoguo@gmail.com>
      a5e2d2b5
  25. 15 Jan, 2017 1 commit
    • Srinivasan Muralidharan's avatar
      FAB-1547 initial create/join chain support · a93135b1
      Srinivasan Muralidharan authored
      https://jira.hyperledger.org/browse/FAB-1547
      
      With this change the fabric has basic support for create / join
      chain begun with the implementation of CSCC (configuraton system
      chaincode) in https://jira.hyperledger.org/browse/FAB-1022.
      
      Some todos remain for follow up CRs
        . docker based commands to channel-setup.md
        . CONFIGURATION_TRANSACTION validation - https://jira.hyperledger.org/browse/FAB-1639
        . further MSP integration (still uses default MSP)
        . absorption of deliver client management into gossip later - https://jira.hyperledger.org/browse/FAB-1580
        . adding specific configuration items to channel create - https://jira.hyperledger.org/browse/FAB-1642
      
      
      
      Steps to test chain create / join below. All commands assume shell
      in "fabric/" directory.
      
      Vagrant window 1 - start orderer
        cd orderer
        ORDERER_GENERAL_LOGLEVEL=debug ./orderer
      
      Vagrant window 2 - ask orderer to create a chain
        cd peer
        peer channel create -c myc1
      
        #on successful creation, a genesis block myc1.block is saved
        #in the same directory
      
      Vagrant window 3 - start the peer without **TEST_CHAINID**
                         (basically in a "chainless" mode)
      
        #to start with a clean env do "rm -rf /var/hyperledger/*"
        cd peer
        peer node start --peer-defaultchain=false
      
        #in "--peer-defaultchain=false" mode the peer has to join
        #chains to create leader and do transactions. It does not
        #have a default chain or ledger (the **TEST_CHAINID** chain)
      
      Vagrant window 4 - ask peer to join a chain
        cd peer
        peer channel join -b myc1.block
      
      At this point we can issue transactions
      
      Vagrant window 2 - deploy a chaincode to myc1
        cd peer
        peer chaincode deploy -C myc1 -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Args":["init","a","100","b","200"]}'
      
        #note the use of "-C myc1"
        #wait for 10 secs or so
      
      Vagrant window 2 - query chaincode
        cd peer
        peer chaincode query -C myc1 -n mycc -c '{"Args":["query","a"]}'
      
      Change-Id: I7d1d04e8a207eb57597a1e6eb8b986e1080e7811
      Signed-off-by: default avatarSrinivasan Muralidharan <muralisr@us.ibm.com>
      a93135b1
  26. 06 Jan, 2017 1 commit
    • Binh Q. Nguyen's avatar
      FAB-1022 Call gossip when a peer join channel · 2f6433f9
      Binh Q. Nguyen authored
      
      
      1/06/17 Fixing cscc and lscc path uniqueness
      12/21 Fixing MSP config path to work in both CI and local test
      12/19 Fixing PEER_CFG_PATH and config builder loader of certs to avoid CI failures
      12/19 Adding port to peer local IP
      
      Beside integrating gossip, this commit also includes:
      - changing the package of cscc to avoid import cycle
      - calling MSP to set up security configuration for chains
      - initializing system chaincodes for each chain
      - more unit tests.
      
      Change-Id: I62b3532e3c18ff95567cf5f80450286b63a1e959
      Signed-off-by: default avatarBinh Q. Nguyen <binhn@us.ibm.com>
      2f6433f9
  27. 13 Dec, 2016 1 commit