Outputs spent within the same block or within a span of blocks (if we apply a batch at once) are "special"
We don't have to add/remove them to/from the Utreexo accumulator to verify inclusion proofs
Instead we can use a local cache and just check the order (input does not spend output from the transaction that comes after) and uniqueness (two inputs cannot spend the same output)
Such outputs are marked with cached flag
We need to post-process the data generated by the script to enable cached flag wherever it's necessary.
Note that it has to be done both for transaction outputs and for the corresponding outpoint data.
The way it can be done:
After all block data is generated, iterate over all blocks and collect cache hints
For every output - put it to the utxo set
For every input - check if the referenced output is in the set then update cache hints and set "cache" flag for the outpoint
Do a second pass where you set "cache" for outputs which are in the cache hints set
Hey @Gerson2102!
Thanks for showing interest.
We've created an application for you to contribute to Raito - Bitcoin ZK Client.
Go check it out on OnlyDust!
Context:
cached
flagWe need to post-process the data generated by the script to enable
cached
flag wherever it's necessary.Note that it has to be done both for transaction outputs and for the corresponding outpoint data.
The way it can be done:
Inject your logic here https://github.com/keep-starknet-strange/raito/blob/511857cf737714a8458a476dade9d064ecd68f19/scripts/data/generate_data.py#L277
You will need to find couple of block (or batches of blocks, but no more than 10) to test the logic.