This may be a very silly question but it's something I haven't found an answer to. Let's say I have a view function in Solidity which does some operations and returns a result. Now I connect to a node and invoke this function on my contract. Where is this function actually executed? I'm assuming it's executed in the node I'm against. But let's say that this function is behaving very badly somehow in usual programming sense. For example it does some heavy computations like calculates prime numbers or something. Or let's say it's just an infinite recursion like this:
function my_func() public view returns(uint) {
if (1 == 0) {
return 0;
}
return this.my_func()
}
If something like this would be run on a node and since there is no gas involved as no transaction was created then I could potentially cause a lot of harm to the node wouldn't I? How does node protect itself from that?