Deny fee thieves - #2563
Open
Mirko-von-Leipzig wants to merge 2 commits into
Open
Conversation
igamigo
approved these changes
Sep 4, 2026
| } | ||
|
|
||
| /// Returns the node that created the specified note. | ||
| pub(super) fn note_creator(&self, note: &miden_protocol::Word) -> Option<&N> { |
Collaborator
There was a problem hiding this comment.
Not related to this PR, but was there any reason why note identifiers within the mempool graph were typed as Word? Maybe because we used what used to be known as note commitment back then which didn't have a newtype. Would be nice for it to be NoteId now
| return false; | ||
| }; | ||
|
|
||
| !self.transaction_is_committed(creator) && is_fee_note(note) |
Collaborator
There was a problem hiding this comment.
nit: Consider checking the note script first here to short-circuit the && since it's the cheaper one
Suggested change
| !self.transaction_is_committed(creator) && is_fee_note(note) | |
| is_fee_note(note) && !self.transaction_is_committed(creator) |
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
We are working on adding batch fee support. Fee notes from transactions in a batch should be consumed by the batch builder. Currently there is nothing preventing a new transaction
afrom consuming an unbatched fee noteb'from transactionb, which will confuse the batch builder.This PR therefore rejects transactions which attempt to consume a fee note from another inflight transaction. We purposefully allow consuming committed (but unconsumed) fee notes because these have already passed through the fee collection process, and are therefore open to anyone. Its unclear why this would occur; but perhaps there will be some purpose to these in the future.
Closes #2558.
Changelog