I have to apologize for not being very familiar with solidity or the EVM ahead of time.
Say that in the contract there are several state variables, a
, b
, c
.
It would seem like that if I wrote a function within the contract with logic that's something like,
if a > 5 then
b = 3
else
c = 2
then I run into a pretty big risk that depend on when this call is run, the function will branch into different sections because the contract call has no understanding for whether or not the value a
that it is accessing has received enough confirmations for me to be confident that it won't produce unpredictable results. At one time when you run it, it could branch into b=3
, at another later time it could branch into c=3
all depending on the ordering and which previous block won out.
Is this a valid concern? Is this allowed in smart contracts? Is there a way for me to elevate this type of branching logic into some sort of higher, application-level code to make sure that I do not produce temporarily different outcomes depending on which split second I queried it from a full node?
Thanks!