Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain: Add UtxoBackend interface. #2652

Merged
merged 12 commits into from
May 25, 2021
Merged

Commits on May 22, 2021

  1. blockchain: Remove UtxoCacher DB Tx dependency.

    This removes the dependency that the UtxoCacher interface and UtxoCache
    implementation currently have on the database.Tx interface.  This is
    necessary since the UtxoCache will move away from the current database
    interface in favor of an interface that is better suited for the UTXO
    database in a subsequent commit.
    rstaudt2 committed May 22, 2021
    Configuration menu
    Copy the full SHA
    6713b50 View commit details
    Browse the repository at this point in the history
  2. blockchain: Add UtxoBackend interface.

    This adds a UtxoBackend interface and LevelDbUtxoBackend type, which
    implements that interface.  This UtxoBackend interface will allow
    different backend implementations to be used by the UtxoCache rather
    than interacting directly with the database layer as it does currently.
    
    In subsequent commits, interface methods and the corresponding
    implementation will be added to UtxoBackend one at a time in order to
    ease the review process as things move around.
    rstaudt2 committed May 22, 2021
    Configuration menu
    Copy the full SHA
    08f00c6 View commit details
    Browse the repository at this point in the history
  3. blockchain: Export UtxoSetState.

    This exports the UtxoSetState type since it will be used in the
    UtxoBackend interface in a subsequent commit.
    rstaudt2 committed May 22, 2021
    Configuration menu
    Copy the full SHA
    38245b4 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2021

  1. blockchain: Add FetchEntry to UtxoBackend.

    This adds the FetchEntry method to the UtxoBackend interface and
    LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add FetchEntry method to UtxoBackend interface
    - Add FetchEntry method to LevelDbUtxoBackend
    - Move dbFetchUtxoEntry to LevelDbUtxoBackend
    - Add backend tests for FetchEntry
    - Update UtxoCache to fetch entries from the backend rather than from
      the database directly
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    12b1413 View commit details
    Browse the repository at this point in the history
  2. blockchain: Add PutUtxos to UtxoBackend.

    This adds the PutUtxos method to the UtxoBackend interface and
    LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add PutUtxos method to UtxoBackend interface, which atomically updates
      the UTXO set and state
    - Add PutUtxos method to LevelDbUtxoBackend
    - Move dbPutUtxoEntry to LevelDbUtxoBackend
    - Add backend tests for PutUtxos
    - Update UtxoCache to use PutUtxos rather than updating the database
      directly
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    fdeccb7 View commit details
    Browse the repository at this point in the history
  3. blockchain: Add FetchState to UtxoBackend.

    This adds the FetchState method to the UtxoBackend interface and
    LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add FetchState method to UtxoBackend interface
    - Add FetchState method to LevelDbUtxoBackend
    - Add backend tests for FetchState
    - Update UtxoCache to use FetchState rather than querying the database
      directly
    - Remove dbPutUtxoSetState and dbFetchUtxoSetState since they are no
      longer used
    - Add FetchBackendState to the UtxoCache so that the state can be
      fetched through the cache
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    2ca281c View commit details
    Browse the repository at this point in the history
  4. blockchain: Add FetchStats to UtxoBackend.

    This adds the FetchStats method to the UtxoBackend interface and
    LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add FetchStats method to UtxoBackend interface
    - Add FetchStats method to LevelDbUtxoBackend
    - Move dbFetchUtxoStats to LevelDbUtxoBackend
    - Add FetchStats to the UtxoCache so that the stats can be fetched
      through the cache
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    736431e View commit details
    Browse the repository at this point in the history
  5. blockchain: Add FetchInfo to UtxoBackend.

    This adds the FetchInfo, InitInfo, and PutInfo methods to the
    UtxoBackend interface and LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add FetchInfo, InitInfo, and PutInfo methods to UtxoBackend interface
    - Add FetchInfo, InitInfo, and PutInfo methods to LevelDbUtxoBackend
    - Move dbPutUtxoDatabaseInfo, dbFetchUtxoDatabaseInfo, and associated
      variables to LevelDbUtxoBackend
    - Move initUtxoDbInfo, createUtxoDbInfo, and associated variables to
      LevelDbUtxoBackend
    - Rename and export utxoDatabaseInfo to UtxoBackendInfo
    - Add backend tests for putting and fetching the UTXO backend info
    - Add utxoBackend to BlockChain Config since BlockChain handles
      initializing the UTXO backend
    - Remove utxoDbInfo from BlockChain and instead access the UTXO backend
      info through the UTXO backend
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    fc5b682 View commit details
    Browse the repository at this point in the history
  6. blockchain: Move LoadUtxoDB to UtxoBackend.

    This moves LoadUtxoDB and the associated helper functions and variables
    from utxodb.go to utxobackend.go since LoadUtxoDB is specific to the
    LevelDbUtxoBackend implementation of the UtxoBackend interface.
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    995ad0d View commit details
    Browse the repository at this point in the history
  7. blockchain: Add Upgrade to UtxoBackend.

    This adds the Upgrade method to the UtxoBackend interface and
    LevelDbUtxoBackend implementation.
    
    A summary of the changes is as follows:
    - Add Upgrade method to UtxoBackend interface
    - Add Upgrade method to LevelDbUtxoBackend
    - Remove initUtxoState and instead handle upgrading through the
      UtxoCache Initialize method
    - Pass the UTXO backend into upgradeUtxoDb rather than the entire
      BlockChain instance
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    bde64ff View commit details
    Browse the repository at this point in the history
  8. multi: Remove UTXO db in BlockChain and UtxoCache.

    This removes the UTXO db from the BlockChain and UtxoCache types.
    BlockChain now only accesses the UTXO db through the UtxoCache and the
    UtxoCache now only accesses the UTXO db through the UtxoBackend.
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    ce56291 View commit details
    Browse the repository at this point in the history
  9. blockchain: Export ViewFilteredSet.

    This exports the ViewFilteredSet type since it is used in the UtxoCacher
    interface.
    rstaudt2 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    b5f4d54 View commit details
    Browse the repository at this point in the history