I read somewhere that the 'state' is only updated at the end of each block. I've also read that each block contains a specific sequence of transactions, and thus implicitly 'updates' the state within a block. This might be semantics, but I just want to be certain about how state variables are updated: will a transaction that alters the state do so before the next transaction, regardless of whether it is in the same block?
To be clear: assume a contract variable
Book is 10 ETH, so that users can take bets against this 10 ETH. Each time a transaction bets an amount
Book is decreased by
Book = Book - X. Bets are restricted so that
Book>=0 at all times:
require(Book - X >= 0) at the top of the betting function. If Bob bets 6 ETH, and Alice bets 6 ETH, this would obviously be counter to my requirement. However, if their transactions are in the same block, would the second transaction be rejected?