I am afraid of a possible replay attack when paying to a smart contract. Given these 3 assumptions
An action gas cost may change according to the state of the blockchain (even if its the same action).
If I payed to some smart contract (that I didnt created myself), and it run out of gas, I need to retransmit the same funds in a new transaction, with a higher gas price and the next nonce.
If an action runs out of gas, it may be re-added to the blockchain and run without running out of gas
Assuming all of those actions, a reply attack is possible! (I understand that waiting for many blocks to avoid forks is a possibility... but it just sounds like a very partials solution)
Any insights?
===EDIT===
Pseudo code of the problem
tx1={from=me, to=contract, nonce=10, gas limit=100'000,...}
Send (tx1)
tx1 run out of gas (needed 100'001 gas..)
tx2={from=me, to=contract, nonce=11, gas limit=200'000,...}
Send (tx2)
Blockchain fork occurred, and tx1 revaluated and tx 1 now approved
tx2 approved too
Doable spend occurred