feat(pswap): add min_fill_amount to PswapNoteStorage#3235
Open
Sertug17 wants to merge 1 commit into
Open
Conversation
c8405c8 to
489cc4b
Compare
- Add optional min_fill_amount: Option<u64> field to PswapNoteStorage - Increase NUM_STORAGE_ITEMS from 7 to 8 - Fix creator_account_id serialization order ([prefix, suffix] → [suffix, prefix]) - Update From/TryFrom implementations for 8-element storage layout - Add tests for new storage roundtrip Fixes 0xMiden#3203 Related: 0xMiden#3169
489cc4b to
dcc1ad3
Compare
Author
|
@VAIBHAVJINDAL3012 @partylikeits1983 @PhilippGackstatter This PR is now ready for review. It includes both the Rust and MASM implementations discussed in #3203: Rust side:
MASM side:
All 8 pswap tests pass. Let me know if you'd like any changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
min_fill_amountfield toPswapNoteStorage, allowing PSWAP note creators to set a minimum fill threshold. This prevents griefing via tiny partial fills that produce dust P2ID payback notes.Changes
Storage Layout
[0][1][2][3][4-5][6]0= None)Related Issues
Checklist
cargo check -p miden-standardspassescargo test -p miden-standards pswappasses (8/8 tests)Notes
The MASM
pswap.masmscript now includes themin_fill_amountcheck inexecute_pswap. Iffill_amount < min_fill_amount(andmin_fill_amount != 0), the transaction aborts withERR_PSWAP_FILL_BELOW_MINIMUM.