archethic-node
archethic-node copied to clipboard
Validation nodes should ensure utxo in ContractContext
Is your feature request related to a problem?
Currently when a contract is executed, the Worker fetch the contract UTXOs, filter them and uses them in contract execution. Then it send the used UTXOs in the Contract Context to the validation nodes. The validation the ensure the UTXOs really exists and are well filtered. But the Worker could have send / uses not all the UTXOs availables and the contract execution result could not be valid
Describe the solution you'd like
The validation nodes should also ensure that the Contract Context contains all the inputs it should. Validation nodes could filter the UTXOs they fetched, and if there is more UTXOs in their list than in the Contract Context, they could determine if the additional UTXOs should have been also retrieved by the Worker based on the timestamp of those UTXOs.
For instance if the additional UTXOs has a timestamp after the Worker execution, it is normal and the Worker could not have retrieved it. But if the additional UTXO timestamp is from 1 days ago, the Worker should have retrieved it so the Contract Context inputs are invalid
Additional context
No response
Epic
No response