Skip to content

[Feature]: Account for changes in the signature threshold during packaging #1767

@djordon

Description

@djordon

Feature - Account for changes in the signature threshold during packaging

1. Description

We do not account for votes correctly when packaging requests into sweep transactions. We have two issues there:

  1. We treat "I vote against" the same as "I cannot sign for this even if I wanted to" at the packaging level, which can lead to deposits falling through the cracks here and there.
  2. We do not distinguish between the different thresholds for each of the inputs.

This is mainly a problem with deposits, where each deposit request may have a differing threshold or different associated signing set. Withdrawals are easier, signers only care about the set of signers who they can communicate with, which is the "current signing set", but the threshold that is associated with the current signing set may be ambiguous.

2. Technical Details

Packaging requests into a transaction should probably follow slightly different logic than what is currently in place. I think the logic should be as follows:

  1. Explicitly consider the signers UTXO as an input, whose votes against is the aggregate votes against for the transaction.
  2. Iterate through all the requests starting with deposits.
  3. Filter deposit requests that do not have enough votes for the request.
  4. Add a request to a sweep transaction if it's addition means that the signers will sign for all of the existing inputs in the transaction. Add it to a new transaction in the chain otherwise.

We'd still have the existing limits on the number of deposits and withdrawals, but so long as those aren't breached the logic above should work.

Note that we'd want to correctly account for the the different kinds of votes signers can "receive" from another signer about a request: a signer can sign and will, a signer can't sign so won't, a signer can sign but won't, and a signer can just not vote. We currently consider the last three states as equivalent during packaging, but we should only consider the last two as equivalent.

2.1 Acceptance Criteria

  • The packaging does not incorrectly exclude requests even when the signer set or signature threshold changes.

3. Related Issues and Pull Requests (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Needs Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions