HomePhabricator

[Chronik] Add `type Aux` to `Group` to assist with grouping members

Description

[Chronik] Add type Aux to Group to assist with grouping members

Summary:
Currently, it's difficult to feed auxillary data to groups, e.g. when grouping txs/utxos by token ID.

This wasn't apparent yet because the ScriptGroup and ValueGroup only depended on TxOutput, but some groups, e.g. groups that group by token ID or by plugin groups need auxillary data coming from previous computations.

Keeping these within the group struct doesn't really work; we want MempoolGroupUtxos and MempoolGroupHistory to be parametrized by the group, but auxillary data usually has a lifetime similar to that of the tx, not the mempool, so it becomes impossible to express in Rust.

Instead, we simply externalize the auxillary data which actually keeps the design quite clean.

Test Plan: ninja check-functional

Reviewers: Fabien, #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
tobias_ruckAuthored on Feb 5 2024, 09:36
tobias_ruckPushed on Feb 8 2024, 17:41
Reviewer
Restricted Project
Differential Revision
D15382: [Chronik] Add `type Aux` to `Group` to assist with grouping members
Parents
rABCe65654e804ce: test: Avoid rpc timeout in p2p_headers_sync_with_minchainwork
Branches
Unknown
Tags
Unknown