Can we walk through how this would work with an actual contract C’?
Say I have a Token Contract that initializes my virtual root to give the owner the balance 1000000 tokens (see code here Block Persistent Storage for a general ref, I’m actually calculating the roots on each transfer, but with this proposal, we’re going to get rid of that).
So between collations I sent one address 700000 tokens and another address 700000 tokens. We end up with two logs of type TRANSFER 0xTHEM 700000.
Now I only have 1,000,000 so how do the validators handle this? The first virtual transaction passes and the second fails?
Question 1: How do they actually calculate that this second virtual transaction should fail? My contract doesn’t have access to storage so I can’t compare my balance. In the linked code I require a proof of current balance, but I won’t have that for transaction 2.
Question 2: How do I find out that transaction 2 failed?
Question 3: If someone sends me back 250,000 later, what is there to keep someone from ‘replaying’ my transaction 2 and spending my 700,000 and leaving me with 50,000.