HomePhabricator

[Chronik] Add avalanche support

Description

[Chronik] Add avalanche support

Summary:
Add is_final to BlockInfo and BlockMetadata, signifying whether the block has been finalized by Avalanche. Encapsulate the state in an Avalanche struct in the indexer, which would also allow us to store the state of finalized transactions.

We store the height of the last finalized block in the indexer (in RAM), and update the height on BlockFinalized from CValidationInterface.

Nomenclature: is_final instead of is_finalized, to be in line with the isfinalblock RPC.

We assume that disconnects are either on non-finalized blocks or on the last finalized block.

Depends on D13693.

Test Plan: ninja && ./test/functional/test_runner.py chronik_avalanche

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Apr 12 2023, 18:16
tobias_ruckPushed on Apr 13 2023, 12:13
Reviewer
Restricted Project
Differential Revision
D13626: [Chronik] Add avalanche support
Parents
rABC91da94b6cded: [Chronik] Use struct init for `QueryTxs` instead of `new`
Branches
Unknown
Tags
Unknown