planetarium / libplanet

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

Fix flaky `unity-test`s that are identifiable #2509

Closed OnedgeLee closed 1 year ago

OnedgeLee commented 1 year ago

Some of unity tests are flaky due to invalid signature, and need to be fixed.

FAIL Libplanet.Tests.Blockchain.BlockChainTest.MakeTransactionWithSystemAction: 0s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #2 #30b2ac8d92c00408a06676a728de95904e532178718e936d472c3c5811f9c0e5's signature is invalid.
  Public key: 037456f9cb6ec23d5cdc39ead2f783f4ca4e744d646458428e4f813d6267890b7c
  Invalid signature: 3045022100c5aa8d1581e5ddd513da5f74ab05fc959153b79b782ac08031c90bd342314f6b022036ff0e74f47c69c28ed3444d649ed8db865da1318a5d69d0b3c42ec50be600ab
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Tests.TestUtils.MineNextBlock[T] (Libplanet.Blocks.Block`1[T] previousBlock, Libplanet.Crypto.PrivateKey miner, System.Collections.Generic.IReadOnlyList`1[T] txs, System.Byte[] nonce, System.Int64 difficulty, System.Nullable`1[T] blockInterval, System.Int32 protocolVersion, Libplanet.HashDigest`1[T] stateRootHash) [0x00032] in /mnt/ramdisk/Libplanet.Tests/TestUtils.cs:433 
    at Libplanet.Tests.Store.StoreFixture..ctor (Libplanet.Action.IAction blockAction, System.Collections.Immutable.IImmutableSet`1[T] nativeTokens) [0x00268] in /mnt/ramdisk/Libplanet.Tests/Store/StoreFixture.cs:117 
    at Libplanet.Tests.Store.MemoryStoreFixture..ctor (Libplanet.Action.IAction blockAction) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Store/MemoryStoreFixture.cs:10 
    at Libplanet.Tests.Blockchain.BlockChainTest+<>c.<.ctor>b__20_0 (Libplanet.Action.IAction action) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:47 
    at Libplanet.Tests.Blockchain.BlockChainTest..ctor (Xunit.Abstractions.ITestOutputHelper output, System.Func`2[T,TResult] getStoreFixture) [0x00117] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:70 
    at Libplanet.Tests.Blockchain.BlockChainTest..ctor (Xunit.Abstractions.ITestOutputHelper output) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:47 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Blockchain.DefaultStoreBlockChainTest.GetStateWithRecalculation: 0s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #2 #84557a68dccb291b2a73d5df432766c3e7dcba0f685c5a08afca0948c3532bff's signature is invalid.
  Public key: 037456f9cb6ec23d5cdc39ead2f783f4ca4e744d646458428e4f813d6267890b7c
  Invalid signature: 30450221008f270d0b23db8fe560f3c64a89c5894d743e8ac092155041afad839730b5c11b022072025c16177d676b4d2f2c47fc311dd0f43a99dbad9da8c9893e7ed39e581f61
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Tests.TestUtils.MineNextBlock[T] (Libplanet.Blocks.Block`1[T] previousBlock, Libplanet.Crypto.PrivateKey miner, System.Collections.Generic.IReadOnlyList`1[T] txs, System.Byte[] nonce, System.Int64 difficulty, System.Nullable`1[T] blockInterval, System.Int32 protocolVersion, Libplanet.HashDigest`1[T] stateRootHash) [0x00032] in /mnt/ramdisk/Libplanet.Tests/TestUtils.cs:433 
    at Libplanet.Tests.Store.StoreFixture..ctor (Libplanet.Action.IAction blockAction, System.Collections.Immutable.IImmutableSet`1[T] nativeTokens) [0x00268] in /mnt/ramdisk/Libplanet.Tests/Store/StoreFixture.cs:117 
    at Libplanet.Tests.Store.DefaultStoreFixture..ctor (System.Boolean memory, Libplanet.Action.IAction blockAction) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Store/DefaultStoreFixture.cs:12 
    at Libplanet.Tests.Blockchain.DefaultStoreBlockChainTest+<>c.<.ctor>b__0_0 (Libplanet.Action.IAction action) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Blockchain/DefaultStoreBlockChainTest.cs:9 
    at Libplanet.Tests.Blockchain.BlockChainTest..ctor (Xunit.Abstractions.ITestOutputHelper output, System.Func`2[T,TResult] getStoreFixture) [0x00117] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:70 
    at Libplanet.Tests.Blockchain.DefaultStoreBlockChainTest..ctor (Xunit.Abstractions.ITestOutputHelper output) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Blockchain/DefaultStoreBlockChainTest.cs:9 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Store.DefaultStoreTest.DeleteChainIdWithForks: 0s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #1 #4d87d1f97196b0bc3aeb9918da1c854d1feb29f03c14c7992f520acca61f7771's signature is invalid.
  Public key: 037456f9cb6ec23d5cdc39ead2f783f4ca4e744d646458428e4f813d6267890b7c
  Invalid signature: 30450221009706432a85380015a24e5381fbf664b1deec4de73298d082adf23652961d251c02204733d9a4360a9215128bf1655f7102aaa85845988f074e0cc2f3618ef826e9d7
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Tests.TestUtils.MineNextBlock[T] (Libplanet.Blocks.Block`1[T] previousBlock, Libplanet.Crypto.PrivateKey miner, System.Collections.Generic.IReadOnlyList`1[T] txs, System.Byte[] nonce, System.Int64 difficulty, System.Nullable`1[T] blockInterval, System.Int32 protocolVersion, Libplanet.HashDigest`1[T] stateRootHash) [0x00032] in /mnt/ramdisk/Libplanet.Tests/TestUtils.cs:433 
    at Libplanet.Tests.Store.StoreFixture..ctor (Libplanet.Action.IAction blockAction, System.Collections.Immutable.IImmutableSet`1[T] nativeTokens) [0x00217] in /mnt/ramdisk/Libplanet.Tests/Store/StoreFixture.cs:115 
    at Libplanet.Tests.Store.DefaultStoreFixture..ctor (System.Boolean memory, Libplanet.Action.IAction blockAction) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Store/DefaultStoreFixture.cs:12 
    at Libplanet.Tests.Store.DefaultStoreTest..ctor (Xunit.Abstractions.ITestOutputHelper testOutputHelper) [0x0000d] in /mnt/ramdisk/Libplanet.Tests/Store/DefaultStoreTest.cs:18 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Store.BlockSetTest.CanDetectInvalidHash: 0s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #3 #34baea6f3764c3f4052dc7911637f4ff1bb7008230a2883ba355384a7e6092d1's signature is invalid.
  Public key: 037456f9cb6ec23d5cdc39ead2f783f4ca4e744d646458428e4f813d6267890b7c
  Invalid signature: 3045022100f1836b756fbe3237a72419b9c380f7ca4228f4cabcb703a1c75b20fcb39d9af002204ccdeb5ea51116187ee1da7890726572fa0c3c69978c9d0f7b5b78e563e86ae5
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Tests.TestUtils.MineNextBlock[T] (Libplanet.Blocks.Block`1[T] previousBlock, Libplanet.Crypto.PrivateKey miner, System.Collections.Generic.IReadOnlyList`1[T] txs, System.Byte[] nonce, System.Int64 difficulty, System.Nullable`1[T] blockInterval, System.Int32 protocolVersion, Libplanet.HashDigest`1[T] stateRootHash) [0x00032] in /mnt/ramdisk/Libplanet.Tests/TestUtils.cs:433 
    at Libplanet.Tests.Store.StoreFixture..ctor (Libplanet.Action.IAction blockAction, System.Collections.Immutable.IImmutableSet`1[T] nativeTokens) [0x002b9] in /mnt/ramdisk/Libplanet.Tests/Store/StoreFixture.cs:119 
    at Libplanet.Tests.Store.MemoryStoreFixture..ctor (Libplanet.Action.IAction blockAction) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Store/MemoryStoreFixture.cs:10 
    at Libplanet.Tests.Store.BlockSetTest..ctor () [0x00006] in /mnt/ramdisk/Libplanet.Tests/Store/BlockSetTest.cs:17 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Blocks.BlockContentTest.TransactionsWithMissingNonce: 0s
  Libplanet.Tx.InvalidTxSignatureException: 19a6fa9e934ddb3268bd9f84b963ebb934ffa1794af5cea3b6a1a2e341af2878: The signature (3045022100abe3caabf2a46a297f2e4496f2c46d7e2f723e75fc42025d19f3ed7fce382d4e02200ffd36f7bef759b6c7ab43bc0f8959a0c463f88fd0f1faeaa209a8661506c4f0) is failed to verify.
    at Libplanet.Tx.Transaction`1[T].Validate () [0x00049] in /mnt/ramdisk/Libplanet/Tx/Transaction.cs:714 
    at Libplanet.Blocks.BlockContent`1[T]..ctor (Libplanet.Blocks.BlockMetadata metadata, System.Collections.Generic.IEnumerable`1[T] transactions) [0x000a9] in /mnt/ramdisk/Libplanet/Blocks/BlockContent.cs:113 
    at Libplanet.Tests.Fixtures.BlockContentFixture..ctor () [0x00305] in /mnt/ramdisk/Libplanet.Tests/Fixtures/BlockContentFixture.cs:120 
    at Libplanet.Tests.Blocks.BlockContentTest..ctor (Xunit.Abstractions.ITestOutputHelper output) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Blocks/BlockContentTest.cs:22 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Blockchain.Policies.BlockPolicyTest.GetNextBlockDifficulty: 0s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #3 #8c6d1c786bc2da9bfbe74197d576112138f0a7b096326726bcbf6c53d819ed31's signature is invalid.
  Public key: 037456f9cb6ec23d5cdc39ead2f783f4ca4e744d646458428e4f813d6267890b7c
  Invalid signature: 3045022100dd278ad47e3519d632efbc93f6aa0a7ef002f969aadf7b36e817f61a20dff58e0220568e049e40579364f85a7f24745570330857fde075a98ee428dac941cae376c6
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Tests.TestUtils.MineNextBlock[T] (Libplanet.Blocks.Block`1[T] previousBlock, Libplanet.Crypto.PrivateKey miner, System.Collections.Generic.IReadOnlyList`1[T] txs, System.Byte[] nonce, System.Int64 difficulty, System.Nullable`1[T] blockInterval, System.Int32 protocolVersion, Libplanet.HashDigest`1[T] stateRootHash) [0x00032] in /mnt/ramdisk/Libplanet.Tests/TestUtils.cs:433 
    at Libplanet.Tests.Store.StoreFixture..ctor (Libplanet.Action.IAction blockAction, System.Collections.Immutable.IImmutableSet`1[T] nativeTokens) [0x002b9] in /mnt/ramdisk/Libplanet.Tests/Store/StoreFixture.cs:119 
    at Libplanet.Tests.Store.MemoryStoreFixture..ctor (Libplanet.Action.IAction blockAction) [0x00000] in /mnt/ramdisk/Libplanet.Tests/Store/MemoryStoreFixture.cs:10 
    at Libplanet.Tests.Blockchain.Policies.BlockPolicyTest..ctor (Xunit.Abstractions.ITestOutputHelper output) [0x00006] in /mnt/ramdisk/Libplanet.Tests/Blockchain/Policies/BlockPolicyTest.cs:30 
    at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <a1e9f114a6e64f4eacb529fc802ec93d>:0
FAIL Libplanet.Tests.Blockchain.BlockChainTest.TipChanged: 0.2815928s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #1 #b32f85ecda73a8e2195b98147b9bb08188a058ae2859e1e5c7da95653ece1a58's signature is invalid.
  Public key: 02e8c66b6a1d25eb5bf5c2d6d92cb95f98a37781e801c64505bc6b4aba74fbec54
  Invalid signature: 3045022100d7de7b1320f46217197c196e5d6ebf23541896b27f3388848d4e210cd80885a802201f4e6b60878815fcfdf1aa11ec0ef96e91b0ee674966c60ca8f2f02e4e9af0e8
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].EvaluateActions (Libplanet.Crypto.PrivateKey privateKey, Libplanet.Blockchain.BlockChain`1[T] blockChain) [0x0001b] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:308 
    at Libplanet.Blockchain.BlockChain`1+<MineBlock>d__85[T].MoveNext () [0x00342] in /mnt/ramdisk/Libplanet/Blockchain/BlockChain.MineBlock.cs:200 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Libplanet.Blockchain.BlockChain`1+<MineBlock>d__84[T].MoveNext () [0x000f2] in /mnt/ramdisk/Libplanet/Blockchain/BlockChain.MineBlock.cs:59 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Libplanet.Tests.Blockchain.BlockChainTest+<TipChanged>d__67.MoveNext () [0x000b0] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:1930 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Xunit.Sdk.AsyncTestSyncContext+<>c__DisplayClass7_0.<Post>b__1 (System.Object _) [0x00000] in <0350163fda644960871a084e928b71dc>:0
OnedgeLee commented 1 year ago

Investigating on

FAIL Libplanet.Tests.Blockchain.BlockChainTest.TipChanged: 0.2815928s
  Libplanet.Blocks.InvalidBlockSignatureException: The block #1 #b32f85ecda73a8e2195b98147b9bb08188a058ae2859e1e5c7da95653ece1a58's signature is invalid.
  Public key: 02e8c66b6a1d25eb5bf5c2d6d92cb95f98a37781e801c64505bc6b4aba74fbec54
  Invalid signature: 3045022100d7de7b1320f46217197c196e5d6ebf23541896b27f3388848d4e210cd80885a802201f4e6b60878815fcfdf1aa11ec0ef96e91b0ee674966c60ca8f2f02e4e9af0e8
    at Libplanet.Blocks.BlockHeader..ctor (Libplanet.Blocks.PreEvaluationBlockHeader preEvaluationBlockHeader, System.ValueTuple`3[T1,T2,T3] proof) [0x00091] in /mnt/ramdisk/Libplanet/Blocks/BlockHeader.cs:83 
    at Libplanet.Blocks.Block`1[T]..ctor (Libplanet.Blocks.PreEvaluationBlock`1[T] preEvaluationBlock, System.ValueTuple`3[T1,T2,T3] proof) [0x00006] in /mnt/ramdisk/Libplanet/Blocks/Block.cs:90 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].Sign (Libplanet.Crypto.PrivateKey privateKey, Libplanet.HashDigest`1[T] stateRootHash) [0x0000e] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:197 
    at Libplanet.Blocks.PreEvaluationBlock`1[T].EvaluateActions (Libplanet.Crypto.PrivateKey privateKey, Libplanet.Blockchain.BlockChain`1[T] blockChain) [0x0001b] in /mnt/ramdisk/Libplanet/Blocks/PreEvaluationBlock.cs:308 
    at Libplanet.Blockchain.BlockChain`1+<MineBlock>d__85[T].MoveNext () [0x00342] in /mnt/ramdisk/Libplanet/Blockchain/BlockChain.MineBlock.cs:200 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Libplanet.Blockchain.BlockChain`1+<MineBlock>d__84[T].MoveNext () [0x000f2] in /mnt/ramdisk/Libplanet/Blockchain/BlockChain.MineBlock.cs:59 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Libplanet.Tests.Blockchain.BlockChainTest+<TipChanged>d__67.MoveNext () [0x000b0] in /mnt/ramdisk/Libplanet.Tests/Blockchain/BlockChainTest.cs:1930 
  --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <a1e9f114a6e64f4eacb529fc802ec93d>:0 
    at Xunit.Sdk.AsyncTestSyncContext+<>c__DisplayClass7_0.<Post>b__1 (System.Object _) [0x00000] in <0350163fda644960871a084e928b71dc>:0

First I suspect that xunit-unity-runner that CI executes has some problem on parallel test excution(fixture mixing or sth), but it seems not, since signature generation and verification is happend on same method, sequentially.

public Block<T> Sign(PrivateKey privateKey, HashDigest<SHA256> stateRootHash)
{
    ImmutableArray<byte> sig = Header.MakeSignature(privateKey, stateRootHash);
    return new Block<T>(
        this, (stateRootHash, sig, Header.DeriveBlockHash(stateRootHash, sig)));
}

So, now I'm suspecting problem on mono build. I'll perform tests on mono build, using dotcover.

OnedgeLee commented 1 year ago

Decision

This issue will be handled as below process:

  1. Skip all tests that contains block mining
  2. Find tests that causes timeout, and skip them
  3. Find the reason for improper block signing, and fix it
  4. Find the reason for timeout, and fix it
OnedgeLee commented 1 year ago

For test skipping by [SkippableFact], [SkippableTheory], test class skipping cannot be accomplished. I've tried to find some way, but it doesn't seem there're some way that is quite easy. (https://github.com/xunit/xunit/issues/791) So, I've decided to apply class skipping on CI. It's just temporary, since those tests will be fixed within spring.