-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base-node): improve contract utxo scanning (#4208)
Description --- ``` feat(blockchain-db): add {block_hash, output_type, contract_id} index to contract_index docs(chain-storage): document mapping for each lmdb database feat(chain-storage): replace fetch_all_constitutions with fetch_contract_outputs_for_block test(chain-storage): add unit tests for fetch_contract_outputs_for_block feat(base-node-service): replace get_constitutions with get_contract_outputs_for_block feat(base-node-grpc): use get_contract_outputs_for_block to fetch constitutions test(cucumber): mark `Publish contract acceptance` as broken test(cucumber): fix command to publish contract utxos ``` Motivation and Context --- `get_all_constitutions` is currently very inefficient and has to load the entire UTXO set. This PR adds a `<block_hash, output_type, contract_id>` index to contract_index db that allows efficient loading of contract outputs optionally filtered by type contained in a block. The get_constitutions grpc method now takes in a start_block_hash and streams utxos starting from that hash. How Has This Been Tested? --- Additional unit tests Manually, sync on igor * feat(blockchain-db): add {block_hash, output_type, output_hash} index to contract_index * docs(chain_storage/lmdb-db): document mapping for each lmdb database * feat(chain-storage): replace fetch_all_constitutions with fetch_contract_outputs_for_block * test(chain-storage): add unit tests for fetch_contract_outputs_for_block * feat(base-node-service): replace get_constitutions with get_contract_outputs_for_block * feat(base-node-grpc): use get_contract_outputs_for_block to fetch constitutions * test(cucumber): mark `Publish contract acceptance` as broken * test(cucumber): fix command to publish contract utxos * fix(chain-storage): fetch_chain_headers should return empty vec if query is out of range
- Loading branch information
Showing
21 changed files
with
694 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.