Skip to content

Conversation

@sandtreader
Copy link
Collaborator

Reverts UTXOIdentifier to being (tx_hash, output_index), enabling bootstrap from snapshot.

Work In Progress!

Description

Reverts UTXOIdentifier - and hence storage key in UTXOState - to being tx hash based, removing memory optimisation through UTXORegistry in TxUnpacker (which has been removed).

This also means the REST queries need to look up TX hashes to get block hashes and tx indexes within the block - there is a new GetBlockHashesAndIndexOfTransactionHashes query to do this, but it needs implementing. I'm not sure if ChainStore has the indexes to do this.

Related Issue(s)

Fixes #448

How was this tested?

Not yet tested - multiple test builds broken at the moment

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

The memory use of AddressState will explode with this change - requires either spilling to disk and/or using CompactUTxOIdentifier internally and then a restituted GetUTXOHashes to look up as before.

Reviewer notes / Areas to focus

Builds release but not test

Requires implementation of GetBlockHashesAndIndexOfTransactionHashes
in ChainStore, to enable REST to look up block hashes and tx indexes
from tx hashes

Memory use of AddressState will explode with this change - requires
either spilling to disk and/or using CompactUTxOIdentifier internally
and then a restituted GetUTXOHashes to look up as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revert UTxOIdentifier to use TxHash

2 participants