Lesson 1: Are computationally expensive pure functions free of gas cost? #680
-
Hi, I have two questions.
function getAnswer(uint256 _a,uint256 _b) public pure returns(uint256){
uint256 ans;
for(int i=0;i<1000000000;i++){
//do somtehing ans=f(_a,_b)
}
return ans;
} Is the above function still free to call? If yes, how is the node which is doing all the computation getting rewarded? 2.Do you think blockchain is economically viable than centralized server-client architecture ? (not sure if I am missing something!). I mean, for a very simple transaction i.e changing the value of a variable costing me 0.0001eth(~0.4$). Of course blockchain gives some good characteristics over the other. Your thoughts? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @shashibheemanapally
Also, you are right this is actually expensive because we are using Ethereum network, but there are other blockchain specialized on other things which are a lot cheaper, and anyways this should be solved when ethereum 2.0 arrives. |
Beta Was this translation helpful? Give feedback.
Hello @shashibheemanapally