Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: base asset UTXO consolidation #3717

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Feb 18, 2025

I put relates and not closes because this one deals only with base asset UTXOs currently, while #3645 isn't confined only to it.

Release notes

In this release, we:

  • Added an account.consolidateCoins() method for consolidating base asset dust coins

Summary

The implementation follows the workflow defined in #3645 (comment). The happy path is covered and I'm now working on the error throwing branch.

Questions

  1. As long as the whole transaction has enough to cover the fee, this implementation works even for dust UTXOs that aren't worth consolidating, i.e. the UTXO is worth so little that it can't pay for its predicate execution or signature verification. Do we want to allow that?
  2. This one is more food for thought and can be a separate issue, but it's related to the topic. Generally, do we want to have a mechanism of letting users know that the UTXOs that they're about to get from executing their transaction will be dust coins that can only be spent at a loss as described in the first question?

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@nedsalk nedsalk added the feat Issue is a feature label Feb 18, 2025
@nedsalk nedsalk self-assigned this Feb 18, 2025
Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 8:56am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 8:56am
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 8:56am

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.67%(-0.48%) 70.43%(-0.26%) 74.89%(-0.41%) 76.67%(-0.48%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 ✨ packages/abi-coder/src/utils/scriptData.ts 0%
(+0%)
0%
(+0%)
0%
(+0%)
0%
(+0%)
🔴 packages/account/src/account.ts 64.5%
(-16.08%)
59.34%
(-11.89%)
70.83%
(-11.67%)
63.98%
(-16.36%)
🔴 packages/account/src/connectors/fuel-connector.ts 30%
(+1.43%)
100%
(+0%)
4.54%
(-0.22%)
30%
(+1.43%)
🔴 packages/account/src/connectors/fuel.ts 96.75%
(+0.02%)
90.66%
(+0%)
93.33%
(+0%)
96.87%
(+0.02%)
🔴 packages/account/src/predicate/predicate.ts 23.52%
(-1.09%)
24.24%
(+0%)
9.09%
(-0.91%)
22.22%
(-0.96%)
🔴 packages/account/src/providers/provider.ts 67.53%
(+0.58%)
59.8%
(+2.73%)
68.04%
(+0%)
67.29%
(+0.56%)
🔴 packages/errors/src/test-utils/expect-to-throw-fuel-error.ts 91.66%
(-0.34%)
88.88%
(+0%)
100%
(+0%)
91.66%
(-0.34%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant