Amoy: bad block 51978200, state receiver swap not in any public release

Open
#2,528 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start by checking the Amoy genesis configuration in genesis-amoy.json, especially config.bor.blockAlloc, and trace how Bor applies system-contract code updates at block activations. Compare the configured code for 0x…1001 with the 6332-byte version reported at block 51978200, then identify the intended Bor release and corresponding mainnet activation. Done means confirming the activation details and explaining how operators can sync past the block.

Written by the indexing model from the issue text.

Description

Stale
System information

Bor client version: v2.10.3 (also reproduced on v2.10.0)

Heimdall client version: v0.13.2 (also reproduced on v0.12.1)

OS & Version: Ubuntu 24.04, Linux

Environment: Polygon Amoy

Type of node: Sentry, full node (path-based state scheme on PebbleDB)

Additional Information: No modifications to the client. Default config; [parallelevm] left at defaults.

Overview of the problem

Bor cannot import Amoy block 51978200 and has been stalled there since 2026-11-04. It reports a bad block with a state root mismatch, re-fetches the block from a peer, fails again, drops the peer, and loops indefinitely.

########## BAD BLOCK #########
Block: 51978200 (0xc45be4e3feff69f81b3258f6e1b3cd8d0584b34cf8f2cd78b116fee6157d8335)
Error: invalid merkle root (remote: cda5a9f5ff14c810179f05b09d4e0907848a035ce03490ef4e6748c33c59cc79 local: e17b3ce1e4b2dee4673d344492b35776f69347136d48b74b6383d3a44013d643)

The node's own chain is canonical right up to the failing block. Parent 51978199 matches the public chain exactly:

our node public chain
hash 0x9a481805e7248bfb6f272e2ef4fa37654255592e158c90da260be3542b1bde06 identical
stateRoot 0x63b4de282997f6177c209dee7c804800746389fcc8b962726e72410c84891806 identical

Block 51978200 is empty — gasUsed: 0x0, miner: 0x0000000000000000000000000000000000000000, and both transactionsRoot and receiptsRoot are the empty-trie root 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421. Bor's own logs confirm no state-sync records were applied around it (StateSyncData ... "total records"=0). So no transaction or bridge event accounts for the state change, yet the canonical state root moves.

What appears to be happening: the code of the state receiver contract 0x0000000000000000000000000000000000001001 is replaced on-chain at exactly block 51978200. Queried against a public archive node:

Block eth_getCode(0x…1001) size sha256 of the hex string
51978199 5052 bytes 691ef6aae6cf56c994165871851821b993b32cb27b0f7912b158d78c0fd80fe0
51978200 6332 bytes a22046b4b438c7252f6abce4147a138f073c68624c4acc1d45e0c3833b8c0999
51978300 6332 bytes a22046b4b438c7252f6abce4147a138f073c68624c4acc1d45e0c3833b8c0999

Our node holds the 5052-byte version, which is exactly what config.bor.blockAlloc at height 11865856 in the published genesis-amoy.json prescribes. The 6332-byte version does not appear anywhere in that file.

In v2.10.3's genesis-amoy.json, config.bor.blockAlloc contains only two heights, 11865856 and 12121856, and there is no fork key for any activation at or near 51978200 — the latest is austinBlock = 44120000. The file is byte-identical between v2.10.0 and v2.10.3 (sha256 d217770204f9dc3efca613bbd77eaffbb0b04909b0fc3143407f01345901f970).

So as far as we can tell, the network performs a system-contract code replacement at Amoy block 51978200 that no publicly released bor implements. Public RPC providers follow the chain past this block, so a build containing it clearly exists. We could not find it: there is no karwar reference anywhere in bor's source, no release after v2.10.3 (2026-10-15), and no announcement describing this activation. Heimdall's Karwar release (v0.13.2, 2026-11-03) documents heimdall activation heights but says nothing about a bor-side change.

Questions

  1. Is there a bor release or candidate that implements this activation? If it is currently a private build, when is the public one expected?
  2. What is the equivalent mainnet activation height? Mainnet's 0x…1001 still holds the 5052-byte code that blockAlloc height 62278656 prescribes, so the swap has not happened there yet, and operators on public releases will stall identically when it does.
Reproduction Steps
  1. Run a bor Amoy sentry on v2.10.3 with heimdall v0.13.2, synced to block 51978199.
  2. Let it attempt block 51978200.
  3. Bor logs BAD BLOCK with the state roots above and does not advance.

A fresh node syncing from a snapshot taken before 51978200 should reach the same wall.

Logs / Traces / Output / Error Messages
WARN Parallel state processor failed  number=51,978,200 hash=c45be4..7d8335
  err="invalid merkle root (remote: cda5a9f5ff14c810179f05b09d4e0907848a035ce03490ef4e6748c33c59cc79 local: e17b3ce1e4b2dee4673d344492b35776f69347136d48b74b6383d3a44013d643) dberr: %!w(<nil>)"
  pipelineMode=disabled parent=51,978,199 parentHash=9a4818..1bde06 parentRoot=63b4de..891806

INFO Skip duplicated bad block  number=51,978,200 hash=c45be4..7d8335
########## BAD BLOCK #########
Block: 51978200 (0xc45be4e3feff69f81b3258f6e1b3cd8d0584b34cf8f2cd78b116fee6157d8335)
Error: invalid merkle root (remote: cda5a9f5ff14c810179f05b09d4e0907848a035ce03490ef4e6748c33c59cc79 local: e17b3ce1e4b2dee4673d344492b35776f69347136d48b74b6383d3a44013d643) dberr: %!w(<nil>)

WARN Synchronisation failed, dropping peer  reason=invalid-chain
  err="retrieved hash chain is invalid: invalid merkle root (remote: cda5a9f5... local: e17b3ce1...)" mode=full
INFO Whitelisting milestone deferred  err="chain out of sync"

The same local: root is produced by the parallel processor and reported in the final BAD BLOCK, so the serial path reaches the same result.

Additional Information

Chain configuration printed at startup:

ChainConfig{ChainID:80002, HomesteadBlock:0, DAOForkBlock:<nil>, DAOForkSupport:true,
EIP150Block:0, EIP155Block:0, EIP158Block:0, ByzantiumBlock:0, ConstantinopleBlock:0,
PetersburgBlock:0, IstanbulBlock:0, MuirGlacierBlock:0, BerlinBlock:0, LondonBlock:73100,
ArrowGlacierBlock:<nil>, GrayGlacierBlock:<nil>, MergeNetsplitBlock:<nil>, ShanghaiBlock:73100,
CancunBlock:5423600, PragueBlock:22765056, VerkleBlock:<nil>, OsakaBlock:<nil>,
EnableVerkleAtGenesis:false, Engine: bor}

eth_syncing while stalled:

{"currentBlock":"0x3191fd7","highestBlock":"0x31a369a","startingBlock":"0x318ce08",
 "healedBytecodes":"0x0","healedTrienodes":"0x0","syncedAccounts":"0x0"}

Peers: 27. Disk: 35% used. Heimdall is healthy and at tip throughout (catching_up: false, advancing in real time), so this is not a bor/heimdall communication problem.

What we already ruled out

  • bor v2.10.0 and v2.10.3 — identical local root
  • heimdall v0.12.1 and v0.13.2 — identical local root
  • parallel and serial execution — identical local root
  • corrupt local state — the parent's state root matches canonical, and the validator-set contract 0x…1000 and the EIP-2935 history contract both match the public chain byte for byte; only 0x…1001 differs
  • a bad snapshot (as in #1683) — ruled out by the parent state matching
Dominant language
Go
Stars
1.1k
Forks
623
Avg merge
4d 14h
Merged PRs (30d)
34

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 0xPolygon/bor

All issues in 0xPolygon/bor

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.