Giter VIP home page Giter VIP logo

Comments (3)

srderson avatar srderson commented on June 13, 2024

@manish-sethi and I met this morning to discuss the DB design. @manish-sethi made many good points as to why the transactions should not be separated from the block bytes. These include

  • Query performance: Much faster to read a block from the DB
  • Storage performance: No need to calculate hash of every transaction when storing a block
  • Size: Transaction data may actually be smaller than the hash

The plan is to create column families that will act as indexes and map transaction hashes to the block # and transaction index in the block. Calculating the transaction hash will be performed in a separate thread so that it does not slow down transaction processing.

from fabric.

srderson avatar srderson commented on June 13, 2024

One though about the column family that maps transactions hashes to block # and transaction index number. Currently, a transaction hash is not unique. You could send the same transaction in different blocks or the same block. To make transaction hashes unique, we need to do one of the following

  1. Create a GUID and store that in the transaction
  2. Transactions will need a sender. Maybe this is always unique due to our use of butterfly keys? Is every token unique?
  3. Some other idea to make the transaction hash unique

@jeffgarratt If we do one of these, the transaction hash will be unique and that can be used as the ID.

from fabric.

manish-sethi avatar manish-sethi commented on June 13, 2024

Added a separate column family to RocksDB for maintaining a mapping between queries keys and (blockId,txIndex). When a new block is committed, the entries in this column families are made in a separate thread. The client query thread waits for index completion up to the block level that the client thread notices when the query arrives.

@srderson we can make this configurable to add entries into this column families if we prefer to have these only on the peer nodes and not on the validator.

Deferring the implementation of some of the queries to issue #73 because of missing information in proto structures as yet.

from fabric.

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.