What is the mechanism to know whether miners/validators have indeed executed one's contract, instead of just blindly validating it?
Using terms from the question, the process of "validating" a transaction that invokes a contract, involves "executing" the contract.
"Blindly validating" suggests you are asking about "light clients", such as clients on mobile or less powerful devices. For such clients, they will have to obtain proofs from "full nodes" that have executed the contract, and then verify the proof to determine whether to accept the data provided by the "full node". The mechanism is proofs, one example from Bitcoin is its SPV.
Or, in case you are asking "How can I know that my transaction has made it into the blockchain?":
Call getTransactionReceipt()
with the transaction hash that was passed back to you when you submitted it. If the receipt contains a value in the blockNumber
field then it's been included in a mined block.
Also, if your transaction was a contract creation, check the contractAddress
to see if the contract creation worked.
Or if your transaction was a contract function call, and the function made use of the log()
facility to record a result, that result can be read from the receipt's logs
field