You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replaying block transactions immediately after block update should succeed
Actual behaviour
replaying block transactions immediately after block update shows errors. adding a time.sleep(1) after getting the update and before replaying block transactions seems to make them go away
Steps to reproduce the behaviour
use the following script:
from typing import Optional
import json
import pprint
import subprocess
current = None
next_id = 1
def pop_id() -> int:
global next_id
result = next_id
next_id += 1
return result
def poll_for_new_block(prev: Optional[str]) -> str:
while True:
s = subprocess.check_output("""curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":%d}' localhost:8545""" % pop_id(), shell=True, stderr=subprocess.DEVNULL)
#print(s)
data = json.loads(s)
block_hash = data['result']['hash']
if prev is None or block_hash != prev:
return block_hash
current = poll_for_new_block(None)
while True:
current = poll_for_new_block(current)
data = json.loads(subprocess.check_output("""curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"trace_replayBlockTransactions","params":["%s", ["stateDiff"]],"id":%d}' localhost:8545""" % (current, pop_id()), shell=True, stderr=subprocess.DEVNULL))
pprint.pprint(data)
Backtrace
there will be a stream of errors in the output like:
{'error': {'code': -32000,
'message': 'first run for txIndex 0 error: nonce too low: address '
'0x1aCa6E70c0aA9A23a340B0F4308eb0dE520dBd9D, tx: 18 '
'state: 19'},
'id': 772,
'jsonrpc': '2.0'}
{'error': {'code': -32000,
'message': 'first run for txIndex 0 error: nonce too low: address '
'0xD6f859ba5076e7690b2056f697e5097f9FE836Ed, tx: 9483 '
'state: 9484'},
'id': 881,
'jsonrpc': '2.0'}
{'error': {'code': -32000,
'message': 'first run for txIndex 0 error: nonce too low: address '
'0xd78ceBa1f9291dadE3539bD558eB5D9B969ec66F, tx: 13213 '
'state: 13214'},
'id': 1034,
'jsonrpc': '2.0'}
The text was updated successfully, but these errors were encountered:
hmm... it's already 2nd similar issue (first #7686)
i will try to check - maybe we don't call "commit" after staged sync cycle.
in-theory we send notification after commit - so all data must be visible for readers.
System information
Erigon version:
./erigon --version
erigon version 2.45.1-stable-83398871
OS & Version: Linux
Chain/Network: erigon mainnet
Expected behaviour
replaying block transactions immediately after block update should succeed
Actual behaviour
replaying block transactions immediately after block update shows errors. adding a
time.sleep(1)
after getting the update and before replaying block transactions seems to make them go awaySteps to reproduce the behaviour
use the following script:
Backtrace
there will be a stream of errors in the output like:
The text was updated successfully, but these errors were encountered: