On #208 we added a check to see whether to store the created input notes (after executing a transaction and sending it to the node) or not. To achieve that we resort to the following heuristic:
If the note is a known one (P2ID, P2IDR), check the script hash and inputs to see if any of the stored accounts can consume it. This would be the "fast" path.
Otherwise, try consuming the note. If we can, we suppose eventually in the future it will also be possible.
Number 1 hasn't got many issues, but 2 has two:
since the transactions haven't been committed yet, we can't execute the transaction (it's currently not possible to execute transactions if they haven't been recorded on-chain)
secondly, we can't be sure if a note will be consumable in the future. @bobbinth suggested an approach here
yeah - good point, executing notes which haven't been recorded on-chain is not currently possible. same applies to notes which are "spendable" in the future (we won't be able to execute them against a future block).
I think these problems deserve a separate issue.
On #208 we added a check to see whether to store the created input notes (after executing a transaction and sending it to the node) or not. To achieve that we resort to the following heuristic:
Number 1 hasn't got many issues, but 2 has two:
secondly, we can't be sure if a note will be consumable in the future. @bobbinth suggested an approach here
yeah - good point, executing notes which haven't been recorded on-chain is not currently possible. same applies to notes which are "spendable" in the future (we won't be able to execute them against a future block). I think these problems deserve a separate issue.
_Originally posted by @bobbinth in https://github.com/0xPolygonMiden/miden-client/pull/208#discussion_r1523506120_