0xPolygonMiden / miden-client

Client library that facilitates interaction with the Miden rollup
MIT License
32 stars 27 forks source link

Introducing a new state for "stale/obsolete" transactions #172

Open mFragaBA opened 7 months ago

mFragaBA commented 7 months ago

This logic is probably fine for now, but in the future, we should also account for a note being spent in a different transaction. This won't happen for P2ID notes, but could happen for P2IDR notes etc.

This probably means that we should introduce another transaction status - e.g., discarded or obsolete. This may happen when the input note which a transaction was supposed to consumed was consumed by a different transaction.

Let's create an issue for this.

_Originally posted by @bobbinth in https://github.com/0xPolygonMiden/miden-client/pull/149#discussion_r1494070240_

tomyrd commented 3 days ago

Is there currently a way to "naturally" test this? If we have a note that is consumable by two clients, if both try to consume it at the same block one will be accepted and the other RPC request will fail instantly.

cc @igamigo @bobbinth

bobbinth commented 3 days ago

Yeah - no easy way to test it and actually, with the current node it won't be possible to get this results. For this to happen in the future, we'd need to: