Skip to content

Comments

fix(sdk-coin-flrp): update fromAddresses in delegator tx#8179

Draft
joshisakshi wants to merge 3 commits intomasterfrom
SC-5648
Draft

fix(sdk-coin-flrp): update fromAddresses in delegator tx#8179
joshisakshi wants to merge 3 commits intomasterfrom
SC-5648

Conversation

@joshisakshi
Copy link
Contributor

@joshisakshi joshisakshi commented Feb 19, 2026

TICKET: SC-5648

Summary:

  • Change fromAddressesBytes from [userAddress] to sorted _fromAddresses

  • Sort fromAddressesBytes before passing to FlareJS to match sorted UTXO addresses

  • Fixes 'No addresses match UTXO owners' error in HSM firmware tests

  • Clarify comments about reward distribution (determined by stake output addresses, not rewardAddresses parameter)"

  • Change output threshold

    • Issue: FlareJS defaults change outputs to threshold=1 for multisig wallets
    • Impact: Any single compromised key could steal change funds
    • Fix: Apply threshold correction (same pattern as ExportInPTxBuilder)
  • Add comprehensive test coverage (33 tests)

    • Core validation (nodeID, amount, duration, required fields)
    • BitGo multisig patterns (2-of-3, 2-of-2)
    • Multiple UTXOs, change outputs, round-trip serialization
    • Real-world scenarios (multiple/sequential delegations)

@joshisakshi joshisakshi changed the title fix(sdk-coin-flrp): update fromAddresses to match UTXO owners in dele… fix(sdk-coin-flrp): update fromAddresses in delegator tx Feb 19, 2026
Comment on lines 333 to 337
const fixedUnsignedTx = new UnsignedTx(correctedDelegatorTx, [], new FlareUtils.AddressMaps([]), []);

this.transaction.setTransaction(fixedUnsignedTx);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ExportInPTxBuilder , after the threshold fix, the code also reconstructs _utxos from the corrected transaction's inputs and builds proper credentials + addressMaps using createCredentialForUtxo / createAddressMapForUtxo with sigIndices.
Here, you're passing empty arrays [] for both credentials and addressMaps. Is this intentional? I assume the delegator tx builder handles credential creation differently (perhaps during signing), but wanted to confirm this doesn't break
signing for multisig wallets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch , have addressed the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants