[Solved] Question that relates to a smart contract, EVM, and mining in race condition

Jason Tran Asks: Question that relates to a smart contract, EVM, and mining in race condition
I have one question that relates to a smart contract, EVM, and mining.

Code:
contract Test {
  event Transfer(
    address indexed _from,
    address indexed _to,
    uint256 _amount,
    uint256 _seq
  );
  uint256 public _seq;

  function transfer(address _to, uint256 _amount) external {
     _seq++;
     emit Transfer(msg.sender, _to, _amount, _seq);
  }
}

Given:

  • At time t = 10: the state variable ‘_seq = 10’
  • There are 3 nodes calling transfer(), then generating transactions at the same time (t = 10)
    • Tx 1: _seq++ = 11 ==> emit Transfer(Node1.address, _to1, _amount1, 11)
    • Tx2: _seq++ = 11 ==> emit Transfer(Node2.address, _to2, _amount2, 11)
    • Tx3: _seq++ = 11 ==> emit Transfer(Node3.address, _to3, _amount3, 11) My question is:
  • Will the state variable ‘_seq’ be updated to 11 or 13 after these transactions are mined and added into a block?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.