I was trying to understand this pizza sample build by Patrick Collins.
so my understanding is that when we send a transaction (for example store which stores a user provided number) all the nodes in the network first check for the transaction correctness i.e. signature and other parameters and then updates the state by executing function from contract and once all nodes reach the consensus this transaction of updating number gets added to blockchain
Now incase of oracle data transaction many of stackoverflow answers says that the oracle call is not executed by nodes to reach consesnsus which is because since we are just calling the external source for data and not really updating the state on the blockchain.
But here in this example https://github.com/PatrickAlphaC/vrf_pizza/blob/c39c03ea707234a814d3d57419111c8e049d87a9/contracts/VRF_Pizza.sol#L47
interface VRF_Pizza_RNG_Interface {
function create_random_pizza(uint256 userProvidedSeed) external returns (bytes32 requestId);
}
Contract Pizza{
function order_pizza(uint256 userProvidedSeed) public payable is_paid returns (bytes32){
pizza_orderers.push(msg.sender);
return VRF_Pizza_RNG_Interface(pizza_rng_address).create_random_pizza(userProvidedSeed);
}
}
Here we are updating pizza_orderers array which is state variable so this transaction call will be executed by all the nodes and will even fail as nodes will not provide LINK tokens for execution. Can anyone please tell me how this works and what am i missing here?