Skip to content

Ropsten corrupt database on reorg #23577

@omarsayha

Description

@omarsayha

System information

Geth version: v1.10.8
OS & Version: Ubuntu 18.04.4 LTS (Bionic Beaver)
Network: ropsten

Expected behaviour

eth_getBlockByNumber 0xA6A153 (10920275):

{
    ...
    "hash": "0x06533bf198874719a3de36317181459ad99a139d7a8555d4f209cc07fcf86483",
    "parentHash": "0xfd652086d220d506ae5b7cb80fde97d2f3f7028d346cc7d9d384a83d3d638532",
    ...
}

eth_getBlockByNumber 0xA6A152 (10920274):

{
    ...
    "hash": "0xfd652086d220d506ae5b7cb80fde97d2f3f7028d346cc7d9d384a83d3d638532",
    "parentHash": "0x1a481511d4b8e7a2ab55e5e03eabc81be7ccda47763da9ab18414074ae678355",
    ...
}

Actual behaviour

eth_getBlockByNumber 0xA6A153 (10920275) - different then expcted:

{
    ...
    "hash": "0x5b6007e7e4d44c0ff8df036c01c42bf2c15313fbd95cfa4c403bbc6051077e39",
    "parentHash": "0x2fd63eb95c8059a46b5afedb903ef1639b9414e9d38f70b3dfb0f733b7ced14f",
    ...
}

eth_getBlockByNumber 0xA6A152 (10920274) - same as expected:

{
    ...
    "hash": "0xfd652086d220d506ae5b7cb80fde97d2f3f7028d346cc7d9d384a83d3d638532",
    "parentHash": "0x1a481511d4b8e7a2ab55e5e03eabc81be7ccda47763da9ab18414074ae678355",
    ...
}

Note that the parentHash of 0xA6A153 is different than the hash of 0xA6A152.

Steps to reproduce the behaviour

Might be hard to reproduce as I expect it might be a race condition with rewinding reorgs that corrupts the database but here are the possibly relevant flags I used:

--syncmode fast --gcmode=full

And the relevant log lines that make me possibly suspect a race condition:

WARN [09-10|19:52:11.182] Rewinding blockchain target=11,008,644
WARN [09-10|19:52:14.253] Rewinding blockchain target=10,920,274

Backtrace

INFO [09-10|19:51:59.067] Aborting state snapshot generation       root=0e3236..87b644 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.021s     eta=150083h9m0.962s
INFO [09-10|19:51:59.067] Resuming state snapshot generation       root=3681db..0e4001 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.022s     eta=150086h5m44.054s
INFO [09-10|19:51:59.094] Aborting state snapshot generation       root=3681db..0e4001 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.048s     eta=150162h34m23.643s
INFO [09-10|19:51:59.094] Resuming state snapshot generation       root=6f944d..451a16 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.049s     eta=150165h31m2.118s
INFO [09-10|19:51:59.121] Aborting state snapshot generation       root=6f944d..451a16 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.076s     eta=150244h56m5.756s
INFO [09-10|19:51:59.121] Resuming state snapshot generation       root=fa6b66..554208 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.076s     eta=150244h56m5.756s
INFO [09-10|19:51:59.122] Imported new chain segment               blocks=6   txs=41  mgas=5.137  elapsed=172.800ms   mgasps=29.730 number=11,010,688 hash=88029d..cedea3 age=1m52s    dirty=8.71MiB
INFO [09-10|19:51:59.122] Imported new block headers               count=1    elapsed=48.782s     number=11,010,689 hash=5600cc..8dddfc age=1m46s
INFO [09-10|19:51:59.125] Downloader queue stats                   receiptTasks=0 blockTasks=0 itemSize=9.78KiB  throttle=8192
INFO [09-10|19:51:59.155] Aborting state snapshot generation       root=fa6b66..554208 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.109s     eta=150342h0m29.837s
INFO [09-10|19:51:59.155] Resuming state snapshot generation       root=cc0506..0499d4 at=000001..509af0 accounts=4   slots=0 storage=248.00B elapsed=51.109s     eta=150342h0m29.837s
INFO [09-10|19:51:59.155] Imported new chain segment               blocks=1   txs=7   mgas=0.871  elapsed=30.536ms    mgasps=28.511 number=11,010,689 hash=5600cc..8dddfc age=1m46s    dirty=8.83MiB
INFO [09-10|19:51:59.156] Imported new block headers               count=1    elapsed=33.179ms    number=11,010,690 hash=021234..bc72b7 age=1m36s
INFO [09-10|19:52:00.123] Indexing transactions                    blocks=2267 txs=22255 tail=8,658,010 total=8,660,277 elapsed=1.000s
INFO [09-10|19:52:08.124] Indexing transactions                    blocks=17465 txs=304,113 tail=8,642,812 total=8,660,277 elapsed=9.000s
INFO [09-10|19:52:11.181] Aborting state snapshot generation       root=cc0506..0499d4 at=000003..efa94d accounts=5   slots=0 storage=318.00B elapsed=1m3.135s    eta=89917h35m40.373s
INFO [09-10|19:52:11.181] Resuming state snapshot generation       root=be77de..5c493a at=000003..efa94d accounts=5   slots=0 storage=318.00B elapsed=1m3.135s    eta=89917h35m40.373s
INFO [09-10|19:52:11.182] Imported new chain segment               blocks=1     txs=26      mgas=6.261  elapsed=12.022s     mgasps=0.521  number=11,010,690 hash=021234..bc72b7 age=1m48s    dirty=9.04MiB
INFO [09-10|19:52:11.182] Imported new block headers               count=3    elapsed=12.026s     number=11,010,693 hash=9ba175..d9bb6d
WARN [09-10|19:52:11.182] Invalid header encountered               number=11,010,695 hash=42b906..0974f7 parent=25c931..a3418f err="unknown ancestor"
WARN [09-10|19:52:11.182] Rewinding blockchain                     target=11,008,644
INFO [09-10|19:52:12.410] Loaded most recent local header          number=11,008,644 hash=a7c19f..910a25 td=34,729,223,946,089,062 age=5h58m45s
INFO [09-10|19:52:12.410] Loaded most recent local full block      number=0          hash=419410..ca4a2d td=1,048,576              age=52y5mo1w
INFO [09-10|19:52:12.410] Loaded most recent local fast block      number=11,008,644 hash=a7c19f..910a25 td=34,729,223,946,089,062 age=5h58m45s
INFO [09-10|19:52:12.410] Loaded last fast-sync pivot marker       number=11,010,598
WARN [09-10|19:52:12.410] Rolled back chain segment                header=11010693->11008644 fast=11010598->11008644 block=11010690->0 reason="unknown ancestor"
WARN [09-10|19:52:12.410] Synchronisation failed, dropping peer    peer=7bd8a743fb976875d4bd0430de8f3c5cf415758db0dcee463697c6580ba28736 err="retrieved hash chain is invalid: unknown ancestor"
WARN [09-10|19:52:14.253] Rewinding blockchain                     target=10,920,274
INFO [09-10|19:52:16.256] Indexing transactions                    blocks=44646 txs=614,681 tail=8,615,631 total=8,660,277 elapsed=17.133s
ERROR[09-10|19:52:18.697] Snapshot extension registration failed   peer=aa1d27f0 err="peer connected on snap without compatible eth support"
ERROR[09-10|19:52:21.247] Snapshot extension registration failed   peer=90896456 err="peer connected on snap without compatible eth support"
INFO [09-10|19:52:23.424] Generating state snapshot                root=be77de..5c493a at=000003..dee3ce accounts=6   slots=0 storage=388.00B elapsed=1m15.378s   eta=106692h59m28.394s
INFO [09-10|19:52:24.257] Indexing transactions                    blocks=75543 txs=862,733 tail=8,584,734 total=8,660,277 elapsed=25.133s
INFO [09-10|19:52:31.435] Generating state snapshot                root=be77de..5c493a in=000393..2778a9 at=ac689f..1f4d80 accounts=1866 slots=6794 storage=639.69KiB elapsed=1m23.389s   eta=424h18m49.322s
INFO [09-10|19:52:32.257] Indexing transactions                    blocks=104,670 txs=1,070,490 tail=8,555,607 total=8,660,277 elapsed=33.134s
INFO [09-10|19:52:39.437] Generating state snapshot                root=be77de..5c493a at=000b11..3ba175 accounts=5797 slots=12887 storage=1.31MiB   elapsed=1m31.391s   eta=150h16m28.83s
WARN [09-10|19:52:39.920] Checkpoint challenge timed out, dropping id=d9fc0b76ace2534f conn=inbound addr=88.198.26.100:37446             type=erigon/v2021.09.2-al...
INFO [09-10|19:52:40.258] Indexing transactions                    blocks=121,430 txs=1,403,189 tail=8,538,847 total=8,660,277 elapsed=41.134s
ERROR[09-10|19:52:41.698] Snapshot extension registration failed   peer=70d956b8 err="peer connected on snap without compatible eth support"
INFO [09-10|19:52:43.592] Writing clean trie cache to disk         path=/mnt/data/.ethereum/geth/triecache threads=1
INFO [09-10|19:52:43.852] Regenerated local transaction journal    transactions=9    accounts=5
INFO [09-10|19:52:45.261] Persisted the clean trie cache           path=/mnt/data/.ethereum/geth/triecache elapsed=1.669s
INFO [09-10|19:52:47.437] Generating state snapshot                root=be77de..5c493a at=001009..6fd975 accounts=8394 slots=19868 storage=1.97MiB   elapsed=1m39.391s   eta=112h47m24.806s
INFO [09-10|19:52:48.258] Indexing transactions                    blocks=138,821 txs=1,715,584 tail=8,521,456 total=8,660,277 elapsed=49.135s
INFO [09-10|19:52:55.437] Generating state snapshot                root=be77de..5c493a at=001783..6641a1 accounts=12275 slots=31399 storage=3.03MiB   elapsed=1m47.392s   eta=83h6m53.369s
INFO [09-10|19:52:56.260] Indexing transactions                    blocks=156,201 txs=1,997,066 tail=8,504,076 total=8,660,277 elapsed=57.136s
INFO [09-10|19:53:03.437] Generating state snapshot                root=be77de..5c493a at=001faf..f85894 accounts=16581 slots=36315 storage=3.65MiB   elapsed=1m55.392s   eta=66h15m43.676s
INFO [09-10|19:53:04.260] Indexing transactions                    blocks=170,693 txs=2,257,924 tail=8,489,584 total=8,660,277 elapsed=1m5.136s

Let me know if there is any other relevant information I can provide, thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions