HomePhabricator

[avalanche] Sort the stakes inside a proof

Description

[avalanche] Sort the stakes inside a proof

Summary:
This diff computes a stake id and use it to sort the stakes in the proof, so the proof id is deterministic for a set or stakes.

This prevents proofs from conflicting when the same set of UTXO is shuffled inside the proof.

I deliberately did not update the stake hash used for computing the signature so single stake utxos remain valid and I don't have to update all the tests.

Ref T1676.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Maniphest Tasks: T1676

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

Details

Provenance
FabienAuthored on Sep 9 2021, 10:35
FabienPushed on Sep 13 2021, 19:04
Reviewer
Restricted Project
Differential Revision
D10076: [avalanche] Sort the stakes inside a proof
Parents
rABCbbfe3dc1abd8: [Cashtab] correct error in parsing tx history for op ret txs
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task

Event Timeline

Klakurka added inline comments.
/src/avalanche/proofbuilder.cpp
54

Do we have a task for this?

/src/avalanche/proofbuilder.cpp
54

We have D10077.