erigon icon indicating copy to clipboard operation
erigon copied to clipboard

trace_block randomly returns first run for txIndex 0 error

Open ella-quicknode opened this issue 2 years ago • 9 comments

System information

Erigon version: erigon/2.52.5/linux-amd64/go1.20.10

OS & Version: 22.04.3 LTS (GNU/Linux 5.15.0-1046-oracle x86_64)

Chain/Network: Eth-Mainnet archive node

Chain/Network:

Expected behaviour

Return correct data

Actual behaviour

Very randomly, the node returns this error.

Error: {'code': -32000, 'message': 'first run for txIndex 0 error: nonce too high: address 0x0000000000000000000000000000000000000000, tx: 164313 state: 0'}

Timestamp and the block number.

Timestamp: 2023-10-24 15:06:47
Block Number: 18420905

Steps to reproduce the behaviour

Here is the stand alone web3 python script, you can remove the hostname resolve override function and put in the RPC url, this script will be running for 5 hours, query 1 block down from the tip.

ella-quicknode avatar Oct 24 '23 16:10 ella-quicknode

Bump

quickchase avatar Mar 05 '24 14:03 quickchase

For added context, this also affects trace_transaction.

I tried tracing a recent block, saw that it failed with this error, then grabbed each tx from the block (with getBlock) and tried trace_transaction on the same Erigon client for each tx. It fails with the same error.

'{"method":"trace_transaction","params":["0xafd0d1cd58b7476c838e9fc8d2dc68dd47c7f11bfcd41f25829946fc7b07be32"],"id":1,"jsonrpc":"2.0"}' 
 
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"first run for txIndex 0 error: nonce too high: address 0x0000000000000000000000000000000000000000, tx: 19250 state: 0"}}

jwelch-qn avatar Mar 08 '24 02:03 jwelch-qn

trace_transaction it's a bit another story. I think i can fix it, i will take a look.

AskAlexSharov avatar Mar 08 '24 08:03 AskAlexSharov

about trace_transaction here is the fix: https://github.com/ledgerwatch/erigon/pull/9641

AskAlexSharov avatar Mar 08 '24 08:03 AskAlexSharov

same for debug_traceBlockByHash https://github.com/ledgerwatch/erigon/pull/9616

trace_block - it's another story - don't know yet why you may see error

AskAlexSharov avatar Mar 08 '24 08:03 AskAlexSharov

maybe related fixv: https://github.com/ledgerwatch/erigon/pull/9684

AskAlexSharov avatar Mar 12 '24 04:03 AskAlexSharov

this problem stil present i have a services with Quick Node and i have the issue random,

curl https://damp-flashy-waterfall.xdai.quiknode.pro/f6679a16b04a01a745a92052eaa19f71f686b7cb/ \ 17:23:58 -X POST \ -H "Content-Type: application/json" \ --data '{"method":"trace_block","params":["0x1f4aef0"],"id":1,"jsonrpc":"2.0"}'

when i request twice fail!!!

Another Exam: ValueError: Problem with payload={'id': 6, 'jsonrpc': '2.0', 'method': 'trace_block', 'params': ['0x1f42532']} result={'jsonrpc': '2.0', 'id': 6, 'error': {'code': -32000, 'message': 'first run for txIndex 0 error: nonce too high: address 0x0000000000000000000000000000000000000000, tx: 26891 state: 0'}}

when request about block 32777522

and this repeat with blocks:

  • 32777411
  • 32777446
  • 32777452
  • 32777484
  • 32777498

and is the same behavior

alfredolopez80 avatar Mar 19 '24 17:03 alfredolopez80

@alfredolopez80 https://github.com/ledgerwatch/erigon/pull/9684 didn’t help?

AskAlexSharov avatar Mar 20 '24 05:03 AskAlexSharov

@alfredolopez80 just a quick reminder that you have exposed the endpoint token, if it's not intended you will need to roll your endpoint.

ella-quicknode avatar Mar 20 '24 07:03 ella-quicknode

Just want to register the same issue with trace_block here as I've mentioned in https://github.com/ledgerwatch/erigon/issues/9990#issuecomment-2145604364

erigon: 2.59.3 and chain: polygon-mainnet-archive.

cshintov avatar Jun 03 '24 19:06 cshintov

Hopefully fixed by https://github.com/ledgerwatch/erigon/pull/10737

somnergy avatar Jun 28 '24 13:06 somnergy