0

I wonder what would happen in following hyphotwtical scenario.

  1. Transaction is being sent with blockchain state A. In this state transaction consume 100_000 gas and sender has enough funds to pay for it.

  2. Local GETH receive tx and broadcast it.

  3. Blockchain fork happens and now blockchain is in state B. In this state same transaction consume 1_000_000 gas and sender does not have this much ETH to pay for it.

  4. After some time I request transaction details with eth_transactionByHash api call or similar web3 call.

What would be response then? Will ETH report that tax is not found or it return response with some indication that tax actually failed?

0

All transactions must have a gas limit. This is the max amount the sender wants to spend, in gas, on a transaction. Any transaction with 21k+ gas limit (the minimum) can be added in a block. If a transaction runs out of gas mid execution, it's reverted. The eth_transactionByHash call will just return the transaction, but eth_getTransactionreceipt will contain a status field, which will either be 1 for success or 0 for failure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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