virtualeconomy / v-systems

V Systems Reference Full Node
Other
115 stars 45 forks source link

vsys 0.4.2 may stop sync at any blocks #316

Open lcgogo opened 2 years ago

lcgogo commented 2 years ago

vsys 0.4.2 may stop sync at any blocks the error log is like below:

2022-04-10 01:44:06 INFO  [main] vsys.Application$ - Starting...
2022-04-10 01:44:06 INFO  [main] kamon.Kamon$Instance - Initializing Kamon...
2022-04-10 01:44:07 INFO  [lt-dispatcher-4] a.event.slf4j.Slf4jLogger - Slf4jLogger started
2022-04-10 01:44:07 INFO  [main] vsys.Application$ - VSYS Core v0.4.2 Blockchain Id: M
2022-04-10 01:44:07 INFO  [main] v.b.s.BlockchainUpdaterImpl - Constructing BlockchainUpdaterImpl, total blocks: 21633285, persisted: 21626085, topMemDiff: 0, bottomMemDiff: 0
2022-04-10 01:44:07 INFO  [main] v.b.s.BlockchainUpdaterImpl - State rebuild started, total blocks: 21633285, persisted: 21626085, topMemDiff: 0, bottomMemDiff: 0
2022-04-10 01:44:08 ERROR [main] v.actor.RootActorSystem$ - Error while initializing actor system vsys
java.lang.Exception: TransactionValidationError(GenericError(Tx id cannot be duplicated. Current height is: 21626086. Tx with such id already present),{"type":5,"id":"BQQAefhk7Mym4HNd36Jusecu2HFk3TN69bkYfS3rXAcp","recipient":"AR3BV6cgdM1GyNGEvM1YDPmejxZeZ8uJEd2","timestamp":1630230440002731072,"amount":3600000000,"currentBlockHeight":21626086})
    at vsys.blockchain.state.package$EitherExt2.explicitGet(package.scala:20)
    at vsys.blockchain.state.diffs.BlockDiffer$.$anonfun$unsafeDiffMany$1(BlockDiffer.scala:26)
    at scala.collection.TraversableOnce.$anonfun$foldLeft$1(TraversableOnce.scala:157)
    at scala.collection.TraversableOnce.$anonfun$foldLeft$1$adapted(TraversableOnce.scala:157)
    at scala.collection.Iterator.foreach(Iterator.scala:944)
    at scala.collection.Iterator.foreach$(Iterator.scala:944)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1432)
    at scala.collection.IterableLike.foreach(IterableLike.scala:71)
    at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
    at scala.collection.TraversableOnce.foldLeft(TraversableOnce.scala:157)
    at scala.collection.TraversableOnce.foldLeft$(TraversableOnce.scala:155)
    at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:104)
    at vsys.blockchain.state.diffs.BlockDiffer$.unsafeDiffMany(BlockDiffer.scala:25)
    at vsys.blockchain.state.BlockchainUpdaterImpl.$anonfun$unsafeDiffByRange$4(BlockchainUpdaterImpl.scala:33)
    at vsys.blockchain.state.StateWriterImpl$.withTime(StateWriter.scala:175)
    at vsys.blockchain.state.StateWriterImpl$.measureLog(StateWriter.scala:187)
    at vsys.blockchain.state.BlockchainUpdaterImpl.unsafeDiffByRange(BlockchainUpdaterImpl.scala:33)
    at vsys.blockchain.state.BlockchainUpdaterImpl.$anonfun$updatePersistedAndInMemory$2(BlockchainUpdaterImpl.scala:52)
    at vsys.blockchain.state.BlockchainUpdaterImpl.$anonfun$updatePersistedAndInMemory$2$adapted(BlockchainUpdaterImpl.scala:51)
    at scala.collection.immutable.Stream.foreach(Stream.scala:530)
    at vsys.blockchain.state.BlockchainUpdaterImpl.$anonfun$updatePersistedAndInMemory$1(BlockchainUpdaterImpl.scala:51)
    at vsys.blockchain.state.BlockchainUpdaterImpl.$anonfun$updatePersistedAndInMemory$1$adapted(BlockchainUpdaterImpl.scala:46)
    at vsys.utils.Synchronized.synchronizeOperation(Synchronized.scala:82)
    at vsys.utils.Synchronized.synchronizeOperation$(Synchronized.scala:79)
    at vsys.blockchain.state.BlockchainUpdaterImpl.synchronizeOperation(BlockchainUpdaterImpl.scala:19)
    at vsys.utils.Synchronized.write(Synchronized.scala:77)
    at vsys.utils.Synchronized.write$(Synchronized.scala:76)
    at vsys.blockchain.state.BlockchainUpdaterImpl.write(BlockchainUpdaterImpl.scala:19)
    at vsys.blockchain.state.BlockchainUpdaterImpl.vsys$blockchain$state$BlockchainUpdaterImpl$$updatePersistedAndInMemory(BlockchainUpdaterImpl.scala:46)
    at vsys.blockchain.state.BlockchainUpdaterImpl$.apply(BlockchainUpdaterImpl.scala:122)
    at vsys.blockchain.history.StorageFactory$.apply(StorageFactory.scala:24)
    at vsys.Application.<init>(Application.scala:49)
    at vsys.Application$$anon$1.<init>(Application.scala:254)
    at vsys.Application$.$anonfun$main$1(Application.scala:254)
    at vsys.Application$.$anonfun$main$1$adapted(Application.scala:244)
    at vsys.actor.RootActorSystem$.start(RootActorSystem.scala:25)
    at vsys.Application$.main(Application.scala:244)
    at vsys.Application.main(Application.scala)
ncying commented 2 years ago

This issue is generated when the server tries to write the data from the memory to the hard disk. It may be caused by the hardware directly. Since the default "Memory Diff" is 3600 blocks, bottom + top, then it needs to handle 7200 blocks.

Check the log here, 21633285 - 21626085 =7200, looks like some errors in the process(related to the physical machine).

The suggestion for this issue is to reduce the "Memory Diff" and resync the blockchain if this is generated. Change the blockchain settings in the conf file, for example, change to 500 as https://github.com/virtualeconomy/v-systems/blob/757273c368bce861803c45c9cdba8059a964e2ec/vsys-mainnet.conf#L43-L44

lcgogo commented 2 years ago

This issue is generated when the server tries to write the data from the memory to the hard disk. It may be caused by the hardware directly. Since the default "Memory Diff" is 3600 blocks, bottom + top, then it needs to handle 7200 blocks.

Check the log here, 21633285 - 21626085 =7200, looks like some errors in the process(related to the physical machine).

The suggestion for this issue is to reduce the "Memory Diff" and resync the blockchain if this is generated. Change the blockchain settings in the conf file, for example, change to 500 as

https://github.com/virtualeconomy/v-systems/blob/757273c368bce861803c45c9cdba8059a964e2ec/vsys-mainnet.conf#L43-L44

Thanks, will have a try.