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

The amount of returned dust coins is limited by factor relative to the amount of selected big coins #2610

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

rafal-ch
Copy link
Contributor

Description

This PR implements a slight change to the coins to spend algorithm w.r.t how many dust coins can be selected.

Each coins query can result in "free slots." For example, if max is set to 10 and the query is satisfied with 3 coins, 7 slots remain unused.

The previous algorithm randomly added up to 7 dust coins to fill these slots.
The new algorithm limits dust coins to at most 5 times the number of large coins, while still respecting the max limit on total coins.

This will prevent the "dust coin flood", ie. responses that contain a single big coin and 200 dust coins.

Checklist

  • New behavior is reflected in tests

Before requesting review

  • I have reviewed the code myself

After merging, notify other teams

@rafal-ch rafal-ch added the no changelog Skip the CI check of the changelog modification label Jan 21, 2025
@rafal-ch rafal-ch marked this pull request as ready for review January 21, 2025 21:06
Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

Would be nice to get approve from @hal3e

@rafal-ch rafal-ch requested a review from hal3e January 22, 2025 07:04
@rafal-ch
Copy link
Contributor Author

Would be nice to get approve from @hal3e

Sure. I've been looking for his GH handle :)
Now added as a reviewer.

@rafal-ch rafal-ch enabled auto-merge (squash) January 22, 2025 09:00
@rafal-ch rafal-ch merged commit 9e3dd3f into master Jan 22, 2025
31 checks passed
@rafal-ch rafal-ch deleted the rafal/dust_factor_in_coins_to_spend branch January 22, 2025 09:21
@MitchTurner MitchTurner mentioned this pull request Jan 22, 2025
MitchTurner added a commit that referenced this pull request Jan 22, 2025
## Version v0.41.1

* fault_proving(compression): include block_id in da compressed block
headers by @rymnc in #2551
* chore: Add myself and Andrea as codeowner for graphql API + related
crates by @netrome in #2570
* fix(integration_tests): remove flake from
produce_block__l1_committed_block_affects_gas_price by @rymnc in
#2566
* bugfix: Improve the `BlockCommitterHttpApi` client to use `url` apis
better by @MitchTurner in
#2599
* Fix version compatibility error by @AurelienFT in
#2608
* Improve error messages for responses from committer by @MitchTurner in
#2609
* Update async processor tests by @rafal-ch in
#2577
* The amount of returned dust coins is limited by factor relative to the
amount of selected big coins by @rafal-ch in
#2610
* fix(da_compression): invalid decompression of utxo id and CoinConfig
fix by @rymnc in #2593
* Use latest gas price to estimate next price for tx pool checks by
@MitchTurner in #2612
* Set Latest Recorded Height on startup by @MitchTurner in
#2603
* Use latest gas price to estimate next block gas price during dry runs
by @MitchTurner in #2615
* Check that fuel-core lib builds correctly without default features by
@rafal-ch in #2594
* Expose indexation status in `NodeInfo` endpoint by @rafal-ch in
#2595


**Full Changelog**:
v0.41.0...v0.41.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants