planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 142 forks source link

InvalidBlockIndexException occurs during IBD #528

Closed limebell closed 4 years ago

limebell commented 4 years ago
2019-09-24 PM 7:03:57 +09:00: FillBlocksAsync() failed; retrying...: Libplanet.Blocks.InvalidBlockIndexException: the expected block index is 370, but its index is 369'

  at Libplanet.Blockchain.BlockChain`1[T].Append (Libplanet.Blocks.Block`1[T] block, System.DateTimeOffset currentTime, System.Boolean evaluateActions, System.Boolean renderActions) [0x00035] in <ded5f41b727f4d2a8edaa51acf068889>:0 

  at Libplanet.Net.Swarm`1+<>c__DisplayClass101_0[T].<FillBlocksAsync>b__0 (Libplanet.Blocks.Block`1[T] block) [0x0003c] in <ded5f41b727f4d2a8edaa51acf068889>:0 

  at System.Collections.Async.ForEachAsyncExtensions+<ForEachAsync>d__8`1[T].MoveNext () [0x0009d] in <5ab47007bd514ff3adcae97c30a0e967>:0 

--- End of stack trace from previous location where exception was thrown ---

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at Libplanet.Net.Swarm`1+<FillBlocksAsync>d__101[T].MoveNext () [0x0028d] in <ded5f41b727f4d2a8edaa51acf068889>:0 

--- End of stack trace from previous location where exception was thrown ---

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at Libplanet.Net.Swarm`1+<SyncPreviousBlocksAsync>d__99[T].MoveNext () [0x002e5] in <ded5f41b727f4d2a8edaa51acf068889>:0 
Libplanet.Blocks.InvalidBlockIndexException: the expected block index is 370, but its index is 369'

  at Libplanet.Blockchain.BlockChain`1[T].Append (Libplanet.Blocks.Block`1[T] block, System.DateTimeOffset currentTime, System.Boolean evaluateActions, System.Boolean renderActions) [0x00035] in <ded5f41b727f4d2a8edaa51acf068889>:0 

  at Libplanet.Net.Swarm`1+<>c__DisplayClass101_0[T].<FillBlocksAsync>b__0 (Libplanet.Blocks.Block`1[T] block) [0x0003c] in <ded5f41b727f4d2a8edaa51acf068889>:0 

  at System.Collections.Async.ForEachAsyncExtensions+<ForEachAsync>d__8`1[T].MoveNext () [0x0009d] in <5ab47007bd514ff3adcae97c30a0e967>:0 

--- End of stack trace from previous location where exception was thrown ---

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at Libplanet.Net.Swarm`1+<FillBlocksAsync>d__101[T].MoveNext () [0x0028d] in <ded5f41b727f4d2a8edaa51acf068889>:0 

--- End of stack trace from previous location where exception was thrown ---

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 

  at Libplanet.Net.Swarm`1+<SyncPreviousBlocksAsync>d__99[T].MoveNext () [0x002e5] in <ded5f41b727f4d2a8edaa51acf068889>:0 
limebell commented 4 years ago

This occurred in testing multi-miner environment, at no-miner (especially seed). And this happens at latest block of target IBD.

longfin commented 4 years ago

It seems that fork(reorg) is required not only in Swarm<T>.SyncPreviousBlocksAsync(), but also Swarm<T>.FIllBlockAsync()...

I'll investigate more.