0

I apologize in advance if my question is stupid.

What I'm curious about is that transactions sent first must be recorded in the preceding block number?

As far as I know, just because you enter the pending state first does not mean you will be in the commit state first.

If so, can transactions sent later have a lower block number?

1 Answer 1

1

You are correct, a transaction you send after another can be included before the earlier one if you set a higher gas fee to it and it’s picked up by a miner before the earlier one.

A transaction sent doesn’t mean it was added to a block and processed yet.

Edit: there is actually two cases here:

  1. both transaction have the same nonce, and the first one included in a block will make the other one invalid since a nonce can only be used once
  2. the transactions have following nonce, and the higher nonce transaction will only be processed once the lower nonce transaction is processed.
3
  • 1
    You might want to add that the previous transaction will get reverted then as it uses the same nonce Dec 15, 2022 at 13:21
  • You are correct, I edited my answer Dec 15, 2022 at 13:46
  • Thanks for your help! After listening to you and thinking about it, if I want to save the cursor while processing the events that happened in the contract in order, I think I can use Nonce. Is that what I understand?
    – Primrose
    Dec 15, 2022 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.