Closed Leonardiae closed 3 years ago
One can see this phenomenon clearly when stress testing Nodecore and adding a transaction every (say) 250 milliseconds. You count how many transactions are created and how many make it into the next block. There is often a difference and this amounts to the transactions added in the last seconds before the new block is found.
In this case 120 transactions are created in 30 seconds. Say ~100 will make it into the next block.
@Leonardiae Could you retest? Things should be much better with this in NodeCore.
Still seeing these errors in my logs (also without stresstesting). Few times a day:
2021-12-31 12:34:04.805+0100 WARN [pop-tasks-9] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:61] [pexaca979cb2] Failed: Operation has been cancelled for taking too long during task 'Confirm transaction'
2021-12-31 12:34:04.825+0100 DEBUG [si-poll] org.veriblock.miners.pop.securityinheriting.SecurityInheritingMonitor [SecurityInheritingMonitor.kt:348] Found new PHL block: 000000101a86923990a619e1189c949d9a8eb1ba65a0ac0a7af9d994a9d9b979 @ 6043 with no VBK publications
2021-12-31 12:34:04.810+0100 WARN [pop-tasks-10] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:61] [phl4cddbb94] Failed: Error while trying to get PoP Mining Instruction from PHL
2021-12-31 12:34:04.825+0100 DEBUG [pop-tasks-9] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:59] [pexaca979cb2] Stack Trace:
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 3600000 ms
at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:186) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:156) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:69) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
2021-12-31 12:34:04.834+0100 DEBUG [pop-tasks-9] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:59] [pexaca979cb2] New state: Failed
2021-12-31 12:34:04.829+0100 DEBUG [pop-tasks-10] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:59] [phl4cddbb94] Stack Trace:
java.util.concurrent.CancellationException: Timed out waiting for 90000 ms
at io.ktor.client.engine.UtilsKt$attachToUserJob$cleanupHandler$1.invoke(Utils.kt:78) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.engine.UtilsKt$attachToUserJob$cleanupHandler$1.invoke(Utils.kt) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at kotlinx.coroutines.JobSupport.invokeOnCompletion(JobSupport.kt:1559) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.Job$DefaultImpls.invokeOnCompletion$default(Job.kt:353) ~[kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at io.ktor.client.engine.HttpClientEngineJvmKt.createCallContext(HttpClientEngineJvm.kt:26) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.engine.HttpClientEngine$DefaultImpls.executeWithinCallContext(HttpClientEngine.kt:77) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.engine.HttpClientEngine$install$1.invokeSuspend(HttpClientEngine.kt:66) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.engine.HttpClientEngine$install$1.invoke(HttpClientEngine.kt) ~[ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpSend$DefaultSender.execute(HttpSend.kt:124) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpSend$Feature$install$1.invokeSuspend(HttpSend.kt:88) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpSend$Feature$install$1.invoke(HttpSend.kt) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.proceedWith(PipelineContext.kt:178) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpPlainText$Feature$install$1.invokeSuspend(HttpPlainText.kt:138) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpPlainText$Feature$install$1.invoke(HttpPlainText.kt) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpRequestLifecycle$Feature$install$1.invokeSuspend(HttpRequestLifecycle.kt:37) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.features.HttpRequestLifecycle$Feature$install$1.invoke(HttpRequestLifecycle.kt) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31) [ktor-utils-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.HttpClient.execute(HttpClient.kt:185) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at io.ktor.client.statement.HttpStatement.executeUnsafe(HttpStatement.kt:104) [ktor-client-core-jvm-1.4.0.jar:1.4.0]
at org.veriblock.alt.plugins.bitcoin.BitcoinFamilyChain.getMiningInstruction(BitcoinFamilyChain.kt:951) [altchain-plugins-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.ApmTaskService$runTasksInternal$2.invokeSuspend(ApmTaskService.kt:58) [altchain-pop-miner-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.ApmTaskService$runTasksInternal$2.invoke(ApmTaskService.kt) [altchain-pop-miner-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.TaskService$runTask$2.invokeSuspend(TaskService.kt:64) [pop-miners-common-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.TaskService$runTask$2.invoke(TaskService.kt) [pop-miners-common-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(Undispatched.kt:102) [kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:148) [kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.TimeoutKt.withTimeout(Timeout.kt:44) [kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at kotlinx.coroutines.time.TimeKt.withTimeout(Time.kt:45) [kotlinx-coroutines-jdk8-1.4.1.jar:?]
at org.veriblock.miners.pop.service.TaskService.runTask(TaskService.kt:63) [pop-miners-common-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.ApmTaskService.runTasksInternal(ApmTaskService.kt:49) [altchain-pop-miner-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.ApmTaskService.runTasksInternal(ApmTaskService.kt:41) [altchain-pop-miner-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.TaskService.runTasks(TaskService.kt:30) [pop-miners-common-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at org.veriblock.miners.pop.service.AltchainPopMinerService$submit$1.invokeSuspend(AltchainPopMinerService.kt:328) [altchain-pop-miner-0.4.12-dev.10.uncommitted.jar:0.4.12-dev.10.uncommitted]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.4.10.jar:1.4.10-release-411 (1.4.10)]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) [kotlinx-coroutines-core-jvm-1.4.1.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_221]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_221]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
2021-12-31 12:34:04.834+0100 DEBUG [pop-tasks-10] org.veriblock.miners.pop.core.MiningOperation [OperationLogging.kt:59] [phl4cddbb94] New state: Failed
Nodecore related, closed
One error I see frequently on the APM is:
2020-08-19 07:41:33 pop-tasks- WARN MiningOperation - [vbtc0089040d] Failed: Operation has been cancelled for taking too long during task 'Confirm transaction'.
I believe in this case it's caused by a transaction being added to the network right before a new Veriblock block is found:
Nodecore log shows:
Here the complete operation log:
I have seen this behaviour many times in the past: Transactions which are added to the Veriblock network in the last few seconds before a block is found are removed from the mempool despit not making it into a block yet. In older versions of Nodecore there was a logline in the Nodecore log which mentioned that the mempool was cleared, my guess is that is whats causing this issue.
My expectation is that transactions that do no make it into a block stay in the mempool, so they can be added to the next block.