1. 17 Jul, 2018 1 commit
  2. 08 Jun, 2018 1 commit
    • manish's avatar
      [FAB-8557] Fix overwriting txid in block index · f6c97e0f
      manish authored
      
      
      This CR fixes the current behavior of block store index.
      In the current implemetation, the indexes that maintain
      different pieces of information by txid are overwritten
      by a duplicate txid (if any). This CR reverses this behavior
      and keeps the first appearance of txid in the index. The future
      duplicate txids will not overwrite it.
      
      Though, either of these behaviors (keeping the first tx or
      keeping the last tx) are not fully justified, primarily because
      the problem itself is a paradox - in the sense that the ids
      (that are supposed to be unique by definition) are duplicated.
      However, the justification of moving from the current behavior
      to the proposed behavior is that, its easy for someone to replay
      the transaction or simply use an existing txid in a bogus transaction
      just to exploit the current behavior of overwriting the block storage
      index and preventing the legitimate user to query about the status
      of their transactions.
      
      Change-Id: I3b81ae61c756ef78253b58a94644778716fb0e16
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
      f6c97e0f
  3. 15 Nov, 2017 1 commit
  4. 30 Oct, 2017 1 commit
    • manish's avatar
      [FAB-6779] Allow rebuilding block storage indexes · 1daabff7
      manish authored
      
      
      This CR allows building of block storage indexes.
      For rebuilding the indexes, existing index folder would need to be dropped.
      However, please note that this would drop (and rebuild) the indexes for all
      the chains because they share the underlying leveldb.
      
      Also, enabled the flush/synch of batch writting to leveldb (statedb, block indexes, and historydb).
      
      Change-Id: I6a926ab765df4bbb6543d6a3960359d95d60fd68
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
      1daabff7
  5. 26 Jul, 2017 1 commit
  6. 18 May, 2017 1 commit
  7. 04 May, 2017 1 commit
  8. 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
  9. 27 Feb, 2017 1 commit
  10. 18 Feb, 2017 1 commit
    • Luis Sanchez's avatar
      [FAB-2214] 1st block in chain is block 0, not 1 · e49f25fc
      Luis Sanchez authored
      
      
      Made the following changes to fsblkstorage provider:
      
      * Block numbers start at 0, not 1.
      
      * Blockchain height should be last block number + 1.
      
      * A block's Block.Header.Number should be equal to
        the Blockchain height when AddBlock() is called.
      
      * Updated ledger tests to use random temporary dir.
      
      * Update core endorser tests to generate valid block
        numbers.
      
      Change-Id: I0208cd6a4b9da462c29d06126fa651f4c0dcd2fc
      Signed-off-by: default avatarLuis Sanchez <sanchezl@us.ibm.com>
      e49f25fc
  11. 12 Feb, 2017 2 commits
  12. 09 Feb, 2017 1 commit
    • denyeart's avatar
      [FAB-2052] Finish ledger API GetHistoryForKey() · 9d90fdf6
      denyeart authored
      
      
      Finish the implementation for ledger API GetHistoryForKey().
      
      Lookup the history of key updates by blockNum:tranNum.
      
      For each history record, retrieve the txID and key value
      from block storage. This requires passing a block storage handle
      into the history query executor, and exposing the block storage
      test environment to other packages. Historic txID and key value
      is returned to client to enable simple provenance scenarios.
      
      Added tests for GetHistoryForKey() including recovery scenarios.
      One test required a fix to block storage syncIndex().
      Also tested end-to-end with peer.
      
      Change-Id: I988130e9682f5d8d707c4ec37753bc0e7e297269
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
      9d90fdf6
  13. 08 Feb, 2017 1 commit
  14. 04 Feb, 2017 1 commit
    • denyeart's avatar
      [FAB-2009] Add RetrieveTxByBlockNumTranNum · 96cd9a73
      denyeart authored
      
      
      History database returns the list of (blockNum,tranNum) that
      updated a key.
      RetrieveTxByBlockNumTranNum will allow kvledger
      to retrieve transaction history for this list of key updates.
      
      Change-Id: I9ff3ed6c273c57b65223b283c4f602910e5982bf
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
      96cd9a73
  15. 03 Feb, 2017 1 commit
    • manish's avatar
      Move Blockstorage code under /fabric/common package · 2a16532c
      manish authored
      https://jira.hyperledger.org/browse/FAB-2022
      
      
      
      This changes introduced by this CR
      - Moves the block storage code from package
      core/ledger/blkstorage to common/ledger/blkstorage
      
      - Splits the ledger_interface.go so as to move common interfaces
      and data type to common/ledger package
      
      - Moves some of the util functions to common/ledger package
      
      - Moves core/ledger/ordererledger package to orderer/ledger/fsledger
      orderer folks can futher rename/refactor this as seems suitable to them
      
      Change-Id: I759e16f00dc2ec9bb62196121083cf48eae76948
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
      2a16532c
  16. 27 Jan, 2017 1 commit
    • denyeart's avatar
      [FAB-1885] GetTransactionByID to return Tran Envelope · 9ca80f1f
      denyeart authored
      
      
      QSCC GetTransactionByID should return a Transaction  Envelope,
      not a Transaction. The Envelope contains the signature and
      Payload, which contains the transaction header and Transaction.
      
      Clients will want the transaction header information when retrieving
      the transaction.  They may also want the signature to verify that
      the transaction hasn't changed since the time they submitted it.
      The return type will change from Transaction proto to Envelope proto.
      
      Change-Id: I1de238035c3b6cd00abb3ed8506c54566ee0f2b0
      Signed-off-by: default avatardenyeart <enyeart@us.ibm.com>
      9ca80f1f
  17. 19 Jan, 2017 1 commit
  18. 17 Jan, 2017 1 commit
    • manish's avatar
      SingleLevelDB for block index · 8cdd0f4d
      manish authored
      https://jira.hyperledger.org/browse/FAB-1664
      
      
      
      This changeset:
      - Renames package ledger/util/db to ledger/util/leveldbhelper
      - Implements a leveldb provider
        (that enables using same leveldb instance as a multiple logical dbs)
        in util package for being able to reuse across statedb, index,
        and later for historydb
      - Implements a provider as a single point of invocation
        for managing multiple block storage
      - Uses a single leveldb instance for block storage index
      - Makes the structures other than providers as private
        to their respective packages
      
      Change-Id: I5f0b3b9aa8ef3ac1ccdce4f3c6fa6d842b5318c1
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
      8cdd0f4d
  19. 05 Jan, 2017 1 commit
    • Artem Barger's avatar
      Code cleanup, removing duplicates of envelope decoding · 152ce786
      Artem Barger authored
      
      
      There are several places in the code which implements
      logic of decoding byte array into Envelope, there is
      method available inside txutils.go called GetEnvelopeFromBlock,
      there is GetEnvelope from proputils.go and there is
      ExtractEnvelope from commonutils.go.
      
      This commits removes duplicate and switching to reuse single
      method from txutils.go.
      
      Change-Id: Ia7a963cfd0df85377ef4294d2dba33cca1eb904b
      Signed-off-by: default avatarArtem Barger <bartem@il.ibm.com>
      152ce786
  20. 13 Dec, 2016 1 commit
    • Mari Wade's avatar
      FAB-1336 Add new ledger blockstorage index. · 458c5212
      Mari Wade authored
      
      
      Add a new ledger blockstorage index for History
      that will map (blocknum,trannum) to the file storage
      location for this block transaction
      
      This index will be used for the API  GetTransactionsForKey()
      for (chaincode1,key1).  It will do a key range query on chaincode1~key1
      to pick up all chaincode1~key1 records.  Results will indicate
      the set of (blocknum,trannum) transactions that updated this key.
      
      Change-Id: I81da09e5526d7e2966634c78a03d34011d514442
      Signed-off-by: default avatarMari Wade <mariwade@us.ibm.com>
      458c5212
  21. 10 Dec, 2016 1 commit
  22. 01 Dec, 2016 1 commit
  23. 28 Nov, 2016 1 commit
  24. 27 Nov, 2016 1 commit
    • Srinivasan Muralidharan's avatar
      FAB-1198-rm old pb.Transaction, pb.Block · 61affa05
      Srinivasan Muralidharan authored
      NOTE - Removing of old proto.Transaction is the cause for
      the large change set. It affects chaincode framework and
      all users of the framework such as endorser, system chaincodes,
      unit tests etc.
      
      Transaction2 is renamed to Transaction.
      Response2 is renamed to Response.
      Message2 is renamed to Message.
      
      The changes are fully described in
          https://jira.hyperledger.org/browse/FAB-1198
      
      
      
      Summary
      =======
         . Remove old Transaction and rename Transaction2
         . Cleanup of Chaincode protobuf message
         . Add TxID for SDK and higher layers to optionally
           set (currently errors if not set)
      
      ChaincodeMessage removes QUERY and QUERY_CHAINCODE enums.
      
      Shim interface does not enforce Query or QueryChaincode.
      
      chaincode_example02 and 05 implement Query function via
      the Invoke implementation.
      
      The "noop" system chaincode is removed
         . it was using Transaction which is not an endorser
           artifact any longer
         . there are many system chaincodes to that thoroughly
           test sys chaincode functions
      
      Change-Id: Ib77b7e5a6756eac47e888309816076580ae505e7
      Signed-off-by: default avatarSrinivasan Muralidharan <muralisr@us.ibm.com>
      61affa05
  25. 14 Nov, 2016 1 commit
  26. 11 Nov, 2016 1 commit
  27. 09 Nov, 2016 1 commit
  28. 01 Nov, 2016 1 commit
  29. 28 Oct, 2016 1 commit
  30. 26 Oct, 2016 1 commit
  31. 28 Sep, 2016 1 commit
  32. 26 Sep, 2016 1 commit
  33. 20 Sep, 2016 1 commit
    • manish's avatar
      Disable WAL for block storage DB · 0df6a8d1
      manish authored
      
      
      (Rocks) DB WAL adds overheads while using the DB for saving checkpoints
      for block storage. Avoiding writing to WAL translates the write workload
      (appending blocks to the blockfile) into a sequential disk writes.
      
      This commit changes the way checkpoints are saved - checkpoints are
      written to DB as before, however since WAL is disabled, the checkpoint
      stays in-memory only. The in-memory checkpoint is flushed explicitly to
      disk (via DB flush) at the time of new block file creation. The in-memory
      checkpoint would implicitly also be flushed to memory at the time of DB
      shutdown. However, if a crash takes place, the checkpoint available in the
      DB would be behind the actual block file status. In order to handle this
      crash scenario, this commit also adds code to perform a scan of the block
      file beyond the last saved checkpoint and update the checkpoint.
      
      Change-Id: Ie88646b225abaa50b595833f5e7ed8d4facae920
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
      0df6a8d1
  34. 15 Sep, 2016 1 commit