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>
  2. 15 Sep, 2017 1 commit
  3. 12 Aug, 2017 1 commit
    • Jason Yellick's avatar
      [FAB-5590] Add proto fields for isolated_data · 7e5e9552
      Jason Yellick authored
      The channel creation transaction needs a way to specify additional data
      that is not otherwise reflected in the standard config.  Still, it's
      desirable to specify this information in a consistent way, so it should
      be expressed using the same structures as the configuration.
      This CR introduces the notion of the 'isolated_data' field to the
      ConfigUpdate message.  For now, the only consumer will be the RSCC seed
      data information, which will be set to the key rscc_seed_data and will
      be the bytes of a common.Config message.
      Because we need to be able to be able to inspect this new config message
      type, we need a way to differentiate channel config from resource
      config.  Thus, this CR also introduces a 'type' field to both the Config
      message and the ConfigUpdate message.
      Change-Id: Ida6283dbeeca466aafd9bc6d027ce46e1baee0c6
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
  4. 30 May, 2017 1 commit
    • Gari Singh's avatar
      [FAB-4002] Upgrade to latest version of grpc-go · a1c67027
      Gari Singh authored
      There have been many updates to the grpc-go package
      since it was vendored in v0.6 and then v1.0.0.
      There are several defects / issues related to
      inactivity timeouts, connectivity, etc which can
      be more easily fixed using new features such as
      the client keepalive.
      This CR updates grpc-go as well as all of its
      dependencies and makes minor updates to the
      code where required as well as recompiles all of
      the protos using the protobuf compiler plugin
      required by this version of grpc-go.
      Note that for the updated vendoring, I chose
      to delete the old packages and add the
      updated ones as govendor is not perfect
      when it comes to trying to update packages.
      The only "new" code was adding custom server
      transport credentials in the comm package as
      the default provided by the grpc/credentials
      package was changed and breaks the functionality
      required for dynamically updating root certs for
      running grpc servers and new package config
      values for send/receive msg sizes as grpc-go
      now enforces them.  Changes were also made
      to any grpc clients and servers used in the
      code to leverage the new config values.
      There is one TODO which is to actually set
      the max send/receive msg sizes based on
      config.  This will need to be done for
      both the peer and the orderer.
      Also changed the license header to the new
      format for any new or modified files
      Change-Id: I41687a54aa21802203b04a339952881349042b70
      Signed-off-by: default avatarGari Singh <gari.r.singh@gmail.com>
  5. 30 Apr, 2017 1 commit
  6. 27 Apr, 2017 1 commit
    • jiangyaoguo's avatar
      [FAB-3330] validate chaincode version · f30fc741
      jiangyaoguo authored
      1. Add VsccOutputData struct to keep output of vscc.
      Vscc will return proposalResponsePayload(has verison info)
      bytes contained in ChaincodeAction.
      2. When committer validates transaction, check that the
      chaincode version in ProposalResponse matches the
      verision in lscc.
      3. Add new ValidateCode to distinguash two kinds of invalid
      reason because of chaincode upgrade.
      4. vsccValidatorImpl will return latest chaincodeInstance
      from lscc and vsccOutputData from vscc. So we can mock
      system chaincode in UT.
      5. Move ChaincodeInstance to sysccprovider to avoid
      cycle import.
      Change-Id: I45387f119054d64b57d28173cabda0194a9e3464
      Signed-off-by: default avatarjiangyaoguo <jiangyaoguo@gmail.com>
  7. 20 Apr, 2017 1 commit
    • jiangyaoguo's avatar
      [FAB-1516] committer side upgrade processing Part I · d88c3bc9
      jiangyaoguo authored
      This CR focuses on invalidating all transactions which
      are "invokes" to upgraded chaincodes in the same block.
      Invalid expired transactions in other blocks will be done
      as part II. Some envelop unpacking works are duplicate
      for logic part to be tested easier.
      Change-Id: Iea7d1d29a1927e73973319ce088b1435f9ff8b55
      Signed-off-by: default avatarjiangyaoguo <jiangyaoguo@gmail.com>
  8. 02 Apr, 2017 1 commit
    • Srinivasan Muralidharan's avatar
      FAB-2925 proto defn. for ChaincodeInstallPackage · 8a37f5bd
      Srinivasan Muralidharan authored
      This the first of CRs for "Chaincode Install Packaging"
      story (FAB-2859).
      Key changes below.
      Note that these core definitions are not used in the fabric
      (which still uses raw ChaincodeDeploymentSpec). Future CRs
      will incrementally use them.
      Defines ChaincodeInstallPackage with ChaincodeDeploymentSpec
      and endorsements (owners) over it. Key observation- owner signs
      introduce CHAINCODE_PACKAGE header type
      Defines two packaging functions - one for a owner
      and another for installer.
      Change-Id: Ie4b9ebb4aa08957f30c72dd576c90b119e4ea912
      Signed-off-by: default avatarSrinivasan Muralidharan <muralisr@us.ibm.com>
  9. 31 Mar, 2017 1 commit
    • Luis Sanchez's avatar
      [FAB-2678] o.h.protos to o.h.fabric.protos.peer · a37fa64b
      Luis Sanchez authored
      - rename package org.hyperledger.protos to
        * org.hyperledger.fabric.protos.peer
        * org.hyperledger.fabric.protos.common
        * org.hyperledger.fabric.protos.msp
        * org.hyperledger.fabric.protos.orderer
      - Specified java_outer_classname for protos where
        the proto file name conflicts with a message name.
      - regenerated the protobuf/grpc code for python and go
      - renamed some proto files to snake_case.
      Change-Id: I24bf07efe3fa9e1a144cd470bbaeb200af6f18d6
      Signed-off-by: default avatarLuis Sanchez <sanchezl@us.ibm.com>
  10. 27 Feb, 2017 1 commit
  11. 24 Feb, 2017 1 commit
  12. 19 Feb, 2017 1 commit
  13. 18 Feb, 2017 1 commit
    • denyeart's avatar
      Remove dup Transaction timestamp and version fields · 907689c4
      denyeart authored
      The Transaction timestamp and version fields are duplicates
      of fields that are already on the transaction's ChainHeader, and
      nobody is using them.  The header is the appropriate place for these
      fields, not in the Transaction itself.  Note, there is a 1-to-1
      relationship between the ChainHeader and the Transaction, no
      reason to include the fields twice.
      Change-Id: I039d4ca07d51d27d0e9c4b1a00f9b39db2ba08c8
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
  14. 11 Feb, 2017 1 commit
    • denyeart's avatar
      [FAB-2024] Add valid indicator to GetTransactionById · f8dd7a32
      denyeart authored
      When clients retrieve a transaction from ledger, they need to know whether the
      transaction was validated or invalidated by committing peer.
      GetTransactionByID API needs to retrieve the transaction Envelope
      from block storage, and return it to a client, and indicate whether the
      transaction was validated or invalidated by committing peer. So that the
      originally submitted transaction Envelope is not modified, a new
      ProcessedTransaction wrapper is returned.
      Also removed InvalidTransaction, since it is not used.
      Change-Id: I7a4ec2b56b120f5df4ef18f0df415bab1a7dc9d1
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
  15. 10 Feb, 2017 2 commits
    • Jason Yellick's avatar
      [FAB-2029] Fix proto enum style · 31b9c402
      Jason Yellick authored
      Per the official proto style guide, enums should be UPPER_CASE but the
      current code has a mixture of UPPER_CASE and CamelCase.  This is
      internal inconsistency is a problem, and this CR fixes the fabric protos
      to adhere to the official proto style.
      Change-Id: I95af90f29f9e8fa8a6eecbb528516cccc3187979
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
    • Jason Yellick's avatar
      [FAB-2027] Proto style fixes · cdecb52c
      Jason Yellick authored
      Per https://jira.hyperledger.org/browse/FAB-2026
       the proto style in
      fabric is inconsistent and violates accepted proto style guidelines.
      This CR makes the non-golang code invasive proto changes to conform with
      the style guide.
      In particular, protoc converts lower_underscore_separated to
      LowerUnderscoreSeparated which means that most of our existing fields
      can be normalized to the official proto style with no code changes.
      This does not fix fields which contained upper case abbreviations
      particularly fields ending in 'ID' like txID which must become tx_id and
      will be translated to TxId.
      This does not fix the enum fields which by proto style should be
      UPPER_CASE as this will also require code changes.
      Change-Id: Id32d6caba43be9e1c6b1f638be284071bf52f0fd
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
  16. 18 Jan, 2017 1 commit