I was thinking about a scenario where one contract depends on another contract's state.
contract a may want to decide on its next state update based on the current state of
contract b by calling
contract b's read function.
But what happens if:
- Alice triggers this function on
- At the same time (In the same block) Bob triggers a function that updates the state on
- When this function from
contract atries to get the state from
contract b, it could be that the state has already changed for
contract bbecause of Bob's transaction from step 2 has already executed BEFORE Alice's transaction, or it could be Bob's transaction hasn't executed yet.
So it looks like there can be two different scenarios depending on the order in which Alice's function and Bob's function gets executed within the same block. Am I missing something?
How do people deal with this situation?