Suppose a contract has the following:
uint[] arr;
function func(int a, int b) {
arr.push(a);
arr.push(b);
}
If two clients call func at essentially the same time with (1, 2) and (3, 4), are the contents of arr guaranteed to be in the order of the calls?
You would expect the order of modifications to be something like:
// contract.func(1, 2) call #1
arr.push(1); // #1
arr.push(2); // #1
// contract.func(3, 4) call #2
arr.push(3); // #2
arr.push(4); // #2
// arr = [1, 2, 3, 4]
However, is it possible that the execution of events are interleaved as such:
// contract.func(1, 2) call #1
// contract.func(3, 4) call #2
arr.push(1); // #1
arr.push(2); // #2
arr.push(4); // #2
arr.push(3); // #1
// arr = [1, 2, 4, 3]
Thank you.