0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
25 stars 22 forks source link

Clear `consumer_transaction_id` from `InputNoteRecord` if note gets consumed by another transaction #379

Open tomyrd opened 3 weeks ago

tomyrd commented 3 weeks ago

What should be done?

Allow for local consumer transactions to be overridden.

How should it be done?

If a transaction wants to consume a note locally but another transaction ends up consuming it then we should remove the stale consumer_transaction_id value.

When is this task done?

The task is done when a note that was in the "Processing" state ends up being consumed by an external transaction and the "Consumed" state doesn't show the stale consumer account ID when showing the note.

This may be hard to test as the node responds with an error if the note is currently being consumed. This will not be the case when the chain is decentralized/accepts multiple competing transactions.

Additional context

This was discussed in this PR.