HomePhabricator

[Chronik] Add `lookup_spent_coins` and `uncache_coins` to `ChronikBridge`

Description

[Chronik] Add lookup_spent_coins and uncache_coins to ChronikBridge

Summary:
This allows Chronik to use the already very optimized functions to access spent coins, which is useful when validating a raw tx, e.g. before broadcasting.

We also provide the coins that couldn't be found, and the coins to uncache if the tx didn't end up being broadcast.

This is so that clients can't fill our cache with useless old coins and slow down validation. This mirrors the behavoir of MemPoolAccept::PreChecks, which uncaches the queried coins if they don't end up being spent.

Test Plan: ninja check

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D15053

Details

Provenance
tobias_ruckAuthored on Dec 30 2023, 20:25
tobias_ruckPushed on Jan 4 2024, 21:28
Reviewer
Restricted Project
Differential Revision
D15053: [Chronik] Add `lookup_spent_coins` and `uncache_coins` to `ChronikBridge`
Parents
rABCf1c3e6067b58: [Chronik] Add `VerifyContext`, `verify` and `TokenTx` to bitcoinsuite-slp
Branches
Unknown
Tags
Unknown