Page MenuHomePhabricator

[avalanche] Only mine the finalized txs
ClosedPublic

Authored by Fabien on Jul 16 2025, 14:28.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC2f05cc1ec135: [avalanche] Only mine the finalized txs
Summary

This diff adds an option to the block assembler to use the finalized transactions radix avalanche_preconsensus_mine_radix_tree
for building the block template. This code is actually unreachable outside of tests so there is no change in behavior.

A follow-up diff will add a flag and a functional test for the feature. For now the tests are made of:

  • A benchmark to demonstrate the performance gain of this approach (about 15x faster on my machine)
  • Unit tests in the form of the actual miner tests running with preconsensus to check for regression. There are a few behavioral changes in the miner tests (e.g. due to CTOR, which is NOT enforced in the tests) but this is kept minimal.
Test Plan
ninja all check-all
ninja bench-bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Jul 16 2025, 14:28
PiRK added a subscriber: PiRK.
PiRK added inline comments.
src/node/miner.cpp
77 ↗(On Diff #54884)

What is the purpose of the double-negation !!avalanche ? I think testing the pointer directly would result in the same behavior.

138 ↗(On Diff #54884)

The acronym can be a bit confusing because of its common use as a shorthand for "constructor" in c++. "Canonical ordering" still fits the 80 chars per line

This revision is now accepted and ready to land.Jul 17 2025, 09:14
This revision was automatically updated to reflect the committed changes.