Page MenuHomePhabricator

[avalanche] Store the conflicting proofs
AbandonedPublic

Authored by Fabien on Oct 28 2021, 14:29.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Summary

This diffs store the conflicting proofs as a set (for uniqueness) in a map with the conflicting id as a key. This will make it possible to retrieve which proof is actually conflicting with the one being voted on, and flip our position. This diff only adds the structure and updates the tests, so there is no change in behavior.

Ref T1854.

Depends on D10394.

Test Plan
ninja all check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_peermanager_conflicting_proofs_map
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17128
Build 34088: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-clang-tidy · build-clang · build-debug
Build 34087: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Oct 28 2021, 14:29
deadalnix requested changes to this revision.Nov 1 2021, 23:01
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/avalanche/peermanager.cpp
328

That's an OOM vector, no?

This revision now requires changes to proceed.Nov 1 2021, 23:01
src/avalanche/peermanager.h
189

That does not seems to me to be the right approach. What you want is a way to query which proof is attached to what UTXO efficiently. You have that you can loop over the proof's input. If you need a cache to speed this up later, then consider doing this, but that doesn't seem necessary in the first iteration.