Skip to content

Missing Block Headers During Chain Reorganization with SubscribeNewHeads on Erigon Versions 2.57.3 and 2.58 #9568

@indanielo

Description

@indanielo

System information
Erigon version: at least 2.57.3 and 2.58

OS & Version: Linux

Expected behaviour
When subscribing to new block headers using the SubscribeNewHeads method (as described in the Geth documentation: RPC Pub/Sub newHeads), I expect to receive all new block headers in real-time, including those that are part of a chain reorganization.

Actual behaviour
The subscription works correctly for most new block headers. However, during a chain reorganization, the first block of the reorg is received, but subsequent blocks are not. This results in missing block headers for the blocks that are part of the reorganization. Here are the logs showing the received block headers, with a missing block in the sequence during a reorganization:

Command for erigon and its rpc:

  • erigon --datadir=/mnt/bigdata/erigon-data --chain=mainnet --authrpc.addr 0.0.0.0 --authrpc.vhosts=* --http=false --torrent.download.rate=100mb --ws --private.api.addr=0.0.0.0:9090 --authrpc.jwtsecret=/mnt/bigdata/erigon-data/jwt.hex --nat any --log.console.verbosity info --metrics --metrics.addr 0.0.0.0 --maxpeers 200

  • rpcdaemon --datadir=/mnt/bigdata/erigon-data --http.addr 0.0.0.0 --http.vhosts=* --http.api=eth,erigon,web3,net,debug,trace,txpool,engine,ots,admin --http.corsdomain=* --http.port=8545 --private.api.addr=0.0.0.0:9090 --log.console.verbosity info --ws --metrics --metrics.addr 0.0.0.0

Observe date-time between 19347342 (reorged) and 19347343
2024/03/02 13:00:14 INFO New Block #19347341 -> hash: 0xb7d3984184200b203e9f25ffead478cb5a5c259f7ec3a8f9efdecf342cfb5829
2024/03/02 13:00:28 INFO New Block #19347342 -> hash: 0xefce71ab9437641251bfe076031e55f999b6f63b4d511cee05b7051b1b02dee3
2024/03/02 13:00:51 INFO New Block #19347343 -> hash: 0xc093b378ee0c6e5dc85deaa54a2f13f8d49ff6c5b19db78dada0718fcba9d50b
2024/03/02 13:01:01 INFO New Block #19347344 -> hash: 0x6edf3cc355133cedca5752dec53f0a520db29b26466dcbb9f2abcd315687ca07

Steps to reproduce the behaviour

  1. Subscribe to new block headers using the SubscribeNewHeads method in a script or application interfacing with Erigon.
  2. Wait for a chain reorganization event.
  3. Observe the received block headers, noting any missing headers that should have been received as part of the reorganization.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions