Skip to content

[Question] Sync fails after restoring month-old mainnet snapshot with ContractValidateException on next block #6758

@GuyOrShay

Description

@GuyOrShay

I restored a Tron FullNode from a mainnet snapshot that is about one month old.
The node starts normally and begins sync.
It successfully processes block 81720260, but fails on block 81720261 with:

No contract or not a smart contract
org.tron.core.exception.ContractValidateException: No contract or not a smart contract

After that, the node marks the block as BAD_BLOCK, disconnects from the peer, and repeatedly reconnects.

Environment

Network: mainnet
Java-Tron version: 4.8.0
Snapshot age: approximately 1 month old
transHistory.switch: off
Node discovery disabled, syncing from active peer
Expected behavior
The node should continue syncing past block 81720260 using the restored snapshot.

Actual behavior
Sync stops at block 81720260.
Block 81720261 fails validation with ContractValidateException and triggers BAD_BLOCK disconnect.

Relevant logs
11:44:16.817 INFO [sync-handle-block] DB Pending tx size: 0.
11:44:16.817 INFO [sync-handle-block] DB PushBlock block number: 81720260, cost/txs: 526/543 false.
11:44:16.817 INFO [sync-handle-block] net Success process block Num:81720260,ID:0000000004def3c4e597f9ccdd350eab5938262b1f762db89cc4377abee3748c
11:44:16.818 INFO [sync-handle-block] DB Block num: 81720261, re-push-size: 0, pending-size: 0, block-tx-size: 468, verify-tx-size: 468
11:44:16.968 INFO [sync-handle-block] VM No contract or not a smart contract
11:44:16.970 ERROR [sync-handle-block] DB No contract or not a smart contract
org.tron.core.exception.ContractValidateException: No contract or not a smart contract
at org.tron.core.actuator.VMActuator.call(VMActuator.java:474)
at org.tron.core.actuator.VMActuator.validate(VMActuator.java:159)
at org.tron.common.runtime.RuntimeImpl.execute(RuntimeImpl.java:59)
at org.tron.core.db.TransactionTrace.exec(TransactionTrace.java:189)
at org.tron.core.db.Manager.processTransaction(Manager.java:1541)
at org.tron.core.db.Manager.processBlock(Manager.java:1871)
at org.tron.core.db.Manager.applyBlock(Manager.java:1068)
at org.tron.core.db.Manager.pushBlock(Manager.java:1375)
at org.tron.core.net.TronNetDelegate.processBlock(TronNetDelegate.java:270)
at org.tron.core.net.service.sync.SyncService.processSyncBlock(SyncService.java:307)
at org.tron.core.net.service.sync.SyncService.lambda$handleSyncBlock$9(SyncService.java:293)
at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1597)
at org.tron.core.net.service.sync.SyncService.handleSyncBlock(SyncService.java:272)
at org.tron.core.net.service.sync.SyncService.lambda$init$1(SyncService.java:88)
at org.tron.common.es.ExecutorServiceManager.lambda$scheduleWithFixedDelay$1(ExecutorServiceManager.java:105)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
11:44:16.972 INFO [sync-handle-block] DB Pending tx size: 0.
11:44:16.972 ERROR [sync-handle-block] net Process block failed, Num:81720261,ID:0000000004def3c59d6c4042d9bc9ce0fffd4a037e1444af4a238e858488ceb7, reason: No contract or not a smart contract
11:44:16.972 ERROR [sync-handle-block] net Process sync block Num:81720261,ID:0000000004def3c59d6c4042d9bc9ce0fffd4a037e1444af4a238e858488ceb7 failed, type: 10, bad block
11:44:16.972 INFO [sync-handle-block] net Send peer /10.0.4.254:18889 message type: P2P_DISCONNECT
reason: BAD_BLOCK

Questions

Is this a known issue when syncing from older snapshots?
Are there specific VM or state validation requirements for this sync range on mainnet?
Is there a recommended recovery path besides full resync (for example state repair or specific replay options)?

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