From c35a636f43a4483d910b707191f0a6f09fafee1f Mon Sep 17 00:00:00 2001 From: Whisker17 Date: Wed, 9 Aug 2023 11:05:25 +0800 Subject: [PATCH] update evaluation --- evaluations/tracking_chain_m1_whisker.md | 295 ++++++++++++++++++++++- 1 file changed, 291 insertions(+), 4 deletions(-) diff --git a/evaluations/tracking_chain_m1_whisker.md b/evaluations/tracking_chain_m1_whisker.md index e69c576d4..3ca3ae45a 100644 --- a/evaluations/tracking_chain_m1_whisker.md +++ b/evaluations/tracking_chain_m1_whisker.md @@ -26,17 +26,19 @@ ## General Notes -Todo +TodoOverall, this is a solid project, well documented and scripts, and all promised features work as expected. ## Issues -- todo +- Swagger does not work. + +![image](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/fcd7167b-4101-433b-aec9-822f9e68cb55) ## Logs -### ut +### Unit Tests -- Test hash: 039c49e90924f4af224961d4e2429b64fea3a7ff +- Test hash: d27509aa1b26bd6b429ed7ae279244d55d7a8550
@@ -44,11 +46,296 @@ Todo ```bash +Starting test execution, please wait... +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.10) +[xUnit.net 00:00:00.70] Discovering: TrackingChain.UnitTest +[xUnit.net 00:00:00.73] Discovered: TrackingChain.UnitTest +[xUnit.net 00:00:00.73] Starting: TrackingChain.UnitTest + Passed TrackingChain.UnitTest.Domain.TransactionPoolTest.SetLokedShouldBeSetData [8 ms] + Passed TrackingChain.UnitTest.Domain.AccountTest.GetFirstRandomWriterAddress [5 ms] + Passed TrackingChain.UnitTest.Domain.AccountTest.AccountShouldBePopulateCorrectly [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPoolTest.SetCompletedShouldBeSetTrue [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPoolTest.UnlockShouldBeCleanData [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionRegistryTest.TransactionRegistryShouldBePopulateCorrectly [11 ms] + Passed TrackingChain.UnitTest.Domain.TransactionTriageTest.TransactionPendingShouldBePopulateCorrectly [11 ms] + Passed TrackingChain.UnitTest.Domain.TransactionTriageTest.SetInPoolShouldBeSetTrue [< 1 ms] + Passed TrackingChain.UnitTest.Domain.AccountTest.GetFirstRandomWatcherAddress [1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPoolTest.TransactionPoolShouldBePopulateCorrectly [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionTriageTest.SetCompletedShouldBeSetTrue [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionRegistryTest.SetToRegistryShouldBePopolateReceptData [3 ms] + Passed TrackingChain.UnitTest.Domain.TransactionRegistryTest.ShouldBeSetToPending [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionRegistryTest.ShouldBeSetToPool [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPendingTest.SetLockedShouldBeSetData [34 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPendingTest.TransactionPendingShouldBePopulateCorrectly [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPendingTest.SetCompletedShouldBeSetTrue [< 1 ms] + Passed TrackingChain.UnitTest.Domain.TransactionPendingTest.UnlockShouldBeCleanData [< 1 ms] + Passed TrackingChain.UnitTest.Triage.TrackingEntryUseCaseTest.AddTransactionAsyncShouldGetGuidAsync [474 ms] + Passed TrackingChain.UnitTest.Triage.RegistryServiceTest.GetSmartContractAsync [674 ms] + Passed TrackingChain.UnitTest.TransactionGenerator.TransactionGeneratorServiceTest.SetToPendinglShouldSetRegistryInPendingAsync [676 ms] + Passed TrackingChain.UnitTest.AggregatorPool.AggregatorServiceTest.SetToPoolShouldSetRegistryInPoolAsync [677 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.TransactionWatcherServiceTest.SetToPendinglShouldSetRegistryInComplitedAsync [678 ms] + Passed TrackingChain.UnitTest.AggregatorPool.EnqueuerPoolUseCaseTest.EnqueueTransactionAsync [686 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingStatusShouldBeFindElementAsync [687 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.PendingTransactionWatcherUseCaseTest.AddTransactionAsyncShouldGetGuidAsync [691 ms] + Passed TrackingChain.UnitTest.TransactionGenerator.PoolDequeuerUseCaseTest.AddTransactionAsyncShouldGetGuidAsync [695 ms] + Passed TrackingChain.UnitTest.AggregatorPool.AggregatorServiceTest.EnqueueShouldCreatePool [20 ms] + Passed TrackingChain.UnitTest.AggregatorPool.AggregatorServiceTest.EnqueueShouldSetTriageInPool [1 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetSmartContractForTransactionShouldNotFoundContractByCategoryNameAsync [703 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetSmartContractForTransactionShouldNotFoundContractByAuthorityNameAsync [4 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetProfileGroupForTransactionShouldFindContractByCategoryNullAsync [2 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingPoolsAsync [24 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetSmartContractForTransactionShouldFindContractByAuthorityNameAsync [3 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingTriagesAsync [8 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingStatusShouldBeReturNullAsync [1 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingShouldBeReturNullAsync [1 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingPendingsAsync [7 ms] + Passed TrackingChain.UnitTest.TransactionGenerator.TransactionGeneratorServiceTest.ShouldGetOnlyUnlockedTransactionForProfileAsync [60 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingSuccessfullyAsync [9 ms] + Passed TrackingChain.UnitTest.TransactionGenerator.TransactionGeneratorServiceTest.ShouldBeCreateTransactionPendingAsync [8 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingFailedsAsync [8 ms] + Passed TrackingChain.UnitTest.Triage.AnalyticUseCaseTest.GetTrackingShouldBeFindElementAsync [1 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.TransactionWatcherServiceTest.GetOnlyUnlockedTransactionShouldFilterWatchingFromAsync [74 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.TransactionWatcherServiceTest.ShouldBeSetTransactionTriageCompletedAsync [6 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.ShouldGetTriageFirstInEvenWithMultipleCodeAndLockedCaseAsync [48 ms] +[xUnit.net 00:00:01.57] Finished: TrackingChain.UnitTest + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.ShouldGetTriageExcludeAllCoeInPoolAsync [1 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.TransactionWatcherServiceTest.ShouldGetOnlyUnlockedTransactionForProfileAsync [5 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.ShouldGetTriageFirstInAsync [1 ms] + Passed TrackingChain.UnitTest.TransactionWatcher.TransactionWatcherServiceTest.ShouldBeSetTransactionPoolCompletedAsync [6 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.AddTransactionAsync [6 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.ShouldGetTriageFirstInEvenWithMultipleCodeAsync [2 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.ShouldGetTriageExcludeCompletedAsync [1 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetProfileGroupForTransactionShouldFindContractByAuthorityNullAsync [1 ms] + Passed TrackingChain.UnitTest.Triage.TransactionTriageServiceTest.GetSmartContractForTransactionShouldFindContractByCategoryNameAsync [1 ms] + +Test Run Successful. +Total tests: 55 + Passed: 55 + Total time: 1.9871 Seconds + 1>Done Building Project "/opt/src/Whisker17/w3f-test/TrackingChain/test/TrackingChain.UnitTest/TrackingChain.UnitTest.csproj" (VSTest target(s)). + +Build succeeded. + + "/opt/src/Whisker17/w3f-test/TrackingChain/test/TrackingChain.UnitTest/TrackingChain.UnitTest.csproj" (VSTest target) (1:7) -> + "/opt/src/Whisker17/w3f-test/TrackingChain/test/TrackingChain.UnitTest/TrackingChain.UnitTest.csproj" (default target) (1:8) -> + "/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.Generic.Client/Substrate.Generic.Client.csproj" (default target) (7:8) -> + "/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj" (default target) (16:15) -> + (CoreCompile target) -> + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Model/Extrinsics/UnCheckedExtrinsic.cs(57,23): warning CS0108: 'UnCheckedExtrinsic.Encode()' hides inherited member 'Extrinsic.Encode()'. Use the new keyword if hiding was intended. [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Modules/System.cs(42,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Modules/System.cs(55,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Modules/System.cs(102,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Modules/System.cs(116,35): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + /opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Model/Types/Base/BaseEnumExt.cs(80626,21): warning CS0162: Unreachable code detected [/opt/src/Whisker17/w3f-test/TrackingChain/src/Substrate.NetApi/Substrate.NetApi.csproj::TargetFramework=net7.0] + + 6 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:57.16 + +``` + +
+ +### Integration Tests + +- Test hash: d27509aa1b26bd6b429ed7ae279244d55d7a8550 + +- Tracking Data Insert and receive + +![image](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/97f3eab5-b3b8-4d4f-865a-7fb88d04d051) + +
+ + Web Application Recevied Tracking Data + +```bash + +[10:18:57.283 INF][]: Now listening on: http://0.0.0.0:12345 Microsoft.Hosting.Lifetime +[10:18:57.307 INF][]: Application started. Press Ctrl+C to shut down. Microsoft.Hosting.Lifetime +[10:18:57.307 INF][]: Hosting environment: Production Microsoft.Hosting.Lifetime +[10:18:57.307 INF][]: Content root path: /opt/src/Whisker17/w3f-test/TrackingChain/triage-web-application-v0.1.0-alpha-linuxselfcontained Microsoft.Hosting.Lifetime +[10:19:11.247 WRN][0HMSOFS2D3LHU:00000001]: Failed to determine the https port for redirect. Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware +[10:19:12.354 INF][0HMSOFS2D3LHU:00000001]: Tracking Entry for Code:T-SHIRT-524313 Data:{"code":"Cut"} Category:Moonbase EVM SmartContract:0x55D64aB19C01e135b86429D9367DfCEE3EF615a3 ProfileGroup:db909755-29d0-4aa4-8815-c77232743991 TrackingChain.TransactionTriageCore.UseCases.TrackingEntryUseCase +[10:22:16.895 INF][0HMSOFS2D3LI0:00000001]: Tracking Entry for Code:T-SHIRT-524313 Data:{"code":"Cut"} Category:Rococo Ink SmartContract:5C557tarfZcHfxAeCLd67wNjuQCiuvaJr23Qd56kPjUxn382 ProfileGroup:51d944e7-cc29-4ca2-9b4d-78a07a503a52 TrackingChain.TransactionTriageCore.UseCases.TrackingEntryUseCase +[10:26:32.778 INF][0HMSOFS2D3LI2:00000001]: Tracking Entry for Code:T-SHIRT-524313 Data:{"code":"Cut"} Category:Shibuya Ink SmartContract:XqLt7FSZrn8nffSGkRYWZKn4JCWZBvHNH3sTRnQL4qDr2Dp ProfileGroup:71d944e7-cc29-4ca2-9b4d-78a07a503a52 TrackingChain.TransactionTriageCore.UseCases.TrackingEntryUseCase + +``` + +
+ +
+ + Pool Take Triage Data + +```bash +[10:18:34.248 INF][]: Pool Enqueuer Worker running. TrackingChain.AggregatorPoolWorker.PoolEnqueuerWorker +[10:18:34.817 WRN][]: The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased. Microsoft.EntityFrameworkCore.Query +[10:18:34.925 WRN][]: The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased. Microsoft.EntityFrameworkCore.Query +[10:18:34.972 INF][]: Application started. Press Ctrl+C to shut down. Microsoft.Hosting.Lifetime +[10:18:34.973 INF][]: Hosting environment: Production Microsoft.Hosting.Lifetime +[10:18:34.973 INF][]: Content root path: /opt/src/Whisker17/w3f-test/TrackingChain/aggregator-pool-worker-v0.1.0-alpha-linuxselfcontained Microsoft.Hosting.Lifetime +[10:19:12.922 INF][]: Transaction InPool for TrackingGuid:202699c0-951a-497d-8bde-7c9b2d5f7d5c SmartContracAddress:0x55D64aB19C01e135b86429D9367DfCEE3EF615a3 ProfileGroup:db909755-29d0-4aa4-8815-c77232743991 TrackingChain.AggregatorPoolCore.Services.AggregatorService +[10:22:17.854 INF][]: Transaction InPool for TrackingGuid:a68f1397-8fec-4173-b5f5-119da1803c03 SmartContracAddress:5C557tarfZcHfxAeCLd67wNjuQCiuvaJr23Qd56kPjUxn382 ProfileGroup:51d944e7-cc29-4ca2-9b4d-78a07a503a52 TrackingChain.AggregatorPoolCore.Services.AggregatorService +[10:26:33.336 INF][]: Transaction InPool for TrackingGuid:435a16fb-f9cb-46a4-b857-fbb20c194aba SmartContracAddress:XqLt7FSZrn8nffSGkRYWZKn4JCWZBvHNH3sTRnQL4qDr2Dp ProfileGroup:71d944e7-cc29-4ca2-9b4d-78a07a503a52 TrackingChain.AggregatorPoolCore.Services.AggregatorService ```
+
+ + Generator Take Pool Data + +```bash +[10:18:40.808 INF][]: Pool Dequeuer Worker running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:40.834 INF][]: Start Child PoolDequeuer 1f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.472 INF][]: Start Child PoolDequeuer 2f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.485 INF][]: Start Child PoolDequeuer 4f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.521 INF][]: Start Child PoolDequeuer 5f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.522 INF][]: Start Child PoolDequeuer 6f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.522 INF][]: Start Child PoolDequeuer 8f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.522 INF][]: Start Child PoolDequeuer 9f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TrackingChain.TransactionGeneratorWorker.PoolDequeuerWorker +[10:18:41.526 INF][]: Application started. Press Ctrl+C to shut down. Microsoft.Hosting.Lifetime +[10:18:41.526 INF][]: Hosting environment: Production Microsoft.Hosting.Lifetime +[10:18:41.526 INF][]: Content root path: /opt/src/Whisker17/w3f-test/TrackingChain/transaction-generator-worker-v0.1.0-alpha-linuxselfcontained Microsoft.Hosting.Lifetime +[10:18:41.746 WRN][]: The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased. Microsoft.EntityFrameworkCore.Query +[10:19:13.969 ERR][]: An exception occurred in the database while saving changes for context type 'TrackingChain.TrackingChainCore.EntityFramework.Context.ApplicationDbContext'. +Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithRowsAffectedOnlyAsync(Int32 commandIndex, RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Update +Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithRowsAffectedOnlyAsync(Int32 commandIndex, RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) +[10:19:16.374 INF][]: Transaction OnChain for TrackingGuid:202699c0-951a-497d-8bde-7c9b2d5f7d5c TxHash:0x67c3610578ff81d2b44af3e851534c1dc490579f5efb44315ba66e8ab602470e SmartContracAddress:0x55D64aB19C01e135b86429D9367DfCEE3EF615a3 TrackingChain.TransactionGeneratorCore.UseCases.PoolDequeuerUseCase +[10:22:22.595 INF][]: Transaction OnChain for TrackingGuid:a68f1397-8fec-4173-b5f5-119da1803c03 TxHash:0xFDAAC62250FB5B132A1E1D897E556C50A4E2C4829D09FFE152919B6008FFA462 SmartContracAddress:5C557tarfZcHfxAeCLd67wNjuQCiuvaJr23Qd56kPjUxn382 TrackingChain.TransactionGeneratorCore.UseCases.PoolDequeuerUseCase +[10:26:40.516 INF][]: Transaction OnChain for TrackingGuid:435a16fb-f9cb-46a4-b857-fbb20c194aba TxHash:0x5743A677A9FE4E571CE14B4367B8AADF1B2E86DD6F5E72BEE1BC85E0353CE758 SmartContracAddress:XqLt7FSZrn8nffSGkRYWZKn4JCWZBvHNH3sTRnQL4qDr2Dp TrackingChain.TransactionGeneratorCore.UseCases.PoolDequeuerUseCase + + +``` + +
+ +
+ + Watcher Take Pending Data + +```bash +[10:18:43.834 INF][]: Pending Transaction Checker Worker running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:43.864 INF][]: Start Child Checker 1f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.511 INF][]: Start Child Checker 2f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.528 INF][]: Start Child Checker 4f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.564 INF][]: Start Child Checker 5f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.564 INF][]: Start Child Checker 6f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.565 INF][]: Start Child Checker 8f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.565 INF][]: Start Child Checker 9f8e591b-6a9c-486e-ab2b-2b42abbf5b23 task running. TransactionWatcherWorker.PendingTransactionCheckerWorker +[10:18:44.568 INF][]: Application started. Press Ctrl+C to shut down. Microsoft.Hosting.Lifetime +[10:18:44.569 INF][]: Hosting environment: Production Microsoft.Hosting.Lifetime +[10:18:44.569 INF][]: Content root path: /opt/src/Whisker17/w3f-test/TrackingChain/transaction-watcher-worker-v0.1.0-alpha-linuxselfcontained Microsoft.Hosting.Lifetime +[10:18:44.786 WRN][]: The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased. Microsoft.EntityFrameworkCore.Query +[10:20:47.161 ERR][]: An exception occurred in the database while saving changes for context type 'TrackingChain.TrackingChainCore.EntityFramework.Context.ApplicationDbContext'. +Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithRowsAffectedOnlyAsync(Int32 commandIndex, RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.Update +Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyExceptionAsync(RelationalDataReader reader, Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithRowsAffectedOnlyAsync(Int32 commandIndex, RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) +[10:20:48.046 INF][]: Transaction Completed for TrackingGuid:202699c0-951a-497d-8bde-7c9b2d5f7d5c Successful:True TrackingChain.TransactionWatcherCore.UseCases.PendingTransactionWatcherUseCase +[10:23:53.260 INF][]: Transaction Completed for TrackingGuid:a68f1397-8fec-4173-b5f5-119da1803c03 Successful:null TrackingChain.TransactionWatcherCore.UseCases.PendingTransactionWatcherUseCase +[10:28:11.704 INF][]: Transaction Completed for TrackingGuid:435a16fb-f9cb-46a4-b857-fbb20c194aba Successful:True TrackingChain.TransactionWatcherCore.UseCases.PendingTransactionWatcherUseCase + +``` + +
+ +#### DB proof + +![TransactionTriages](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/2ac00784-4430-46a2-97b2-8566e0ad2a72) + +![TransactionPools](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/569a6ff7-a40f-4f10-a499-e52a80b2ebfe) + +![TransactionPendings](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/74428aa2-2d9d-42de-8dbe-6de325ebc1ce) + +![TransactionRegistries](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/e5d23a0e-48dd-4f2c-bdb3-fbdb6e2e581b) + +#### API proof + +
+ Tracking Data + +```bash +➜ Downloads curl -X GET 'http://localhost:5000/Analytic/Tracking/435a16fb-f9cb-46a4-b857-fbb20c194aba' -H 'accept: text/plain' + +{"code":"T-SHIRT-524313","chainNumberId":101,"chainType":"Substrate","dataValue":"{\"code\":\"Cut\"}","lastTransactionHash":"0x5743A677A9FE4E571CE14B4367B8AADF1B2E86DD6F5E72BEE1BC85E0353CE758","receivedDate":"2023-08-09T02:58:59.1106943Z","receiptBlockHash":"0x5d3b20f3e48bee4ac9bedc373bd0f9e3baf0224785a9468daf6b936273a02584","receiptBlockNumber":"4385991","receiptCumulativeGasUsed":"2210073401122954","receiptEffectiveGasPrice":"","receiptFrom":"bbmFD13HJdRJhEHXJYcN9JCrr3ZCzHS2UVXHZXv6uDbFhLp","receiptGasUsed":"","receiptSuccessful":true,"receiptTo":"","receiptTransactionHash":"0x5743a677a9fe4e571ce14b4367b8aadf1b2e86dd6f5e72bee1bc85e0353ce758","registryDate":"2023-08-09T02:28:11.7032902","smartContractExtraInfo":"{\"InsertTrackSelectorValue\":\"0x1ba63d86\",\"ProofSize\":125952,\"RefTime\":4793859072,\"BasicWeight\":49000000000,\"ByteWeight\":1000000000,\"SupportedClient\":0,\"WaitingSecondsForWatcherTx\":90}","smartContractId":3,"smartContractAddress":"XqLt7FSZrn8nffSGkRYWZKn4JCWZBvHNH3sTRnQL4qDr2Dp","trackingId":"435a16fb-f9cb-46a4-b857-fbb20c194aba","transactionStep":"Completed","triageDate":"2023-08-09T02:26:32.7748857","pendingDate":"2023-08-09T02:26:40.5080335","poolDate":"2023-08-09T02:26:33.3363955","profileGroupId":"71d944e7-cc29-4ca2-9b4d-78a07a503a52"}% + +``` + +```bash +➜ Downloads curl -X GET 'http://localhost:5000/Analytic/Tracking/Successfully/10/1' -H 'accept: text/plain' + +[{"code":"T-SHIRT-524313","chainNumberId":1287,"chainType":"EVM","dataValue":"{\"code\":\"Cut\"}","lastTransactionHash":"0x67c3610578ff81d2b44af3e851534c1dc490579f5efb44315ba66e8ab602470e","receivedDate":"2023-08-09T03:00:48.4701875Z","receiptBlockHash":"0x0b60f9140ee921da9f6bb4e7bf5d82075318b6821e17eb58fcc2af906d37985c","receiptBlockNumber":"0x4a7b13","receiptCumulativeGasUsed":"0xb833a","receiptEffectiveGasPrice":"0x861749c","receiptFrom":"0xc3cc9704d54722b1e3c7f11ee77064aac2206238","receiptGasUsed":"0x19662","receiptSuccessful":true,"receiptTo":"0x55d64ab19c01e135b86429d9367dfcee3ef615a3","receiptTransactionHash":"0x67c3610578ff81d2b44af3e851534c1dc490579f5efb44315ba66e8ab602470e","registryDate":"2023-08-09T02:20:47.9962996","smartContractExtraInfo":"{\"WaitingSecondsForWatcherTx\":90}","smartContractId":2,"smartContractAddress":"0x55D64aB19C01e135b86429D9367DfCEE3EF615a3","trackingId":"202699c0-951a-497d-8bde-7c9b2d5f7d5c","transactionStep":"Completed","triageDate":"2023-08-09T02:19:12.2024521","pendingDate":"2023-08-09T02:19:16.3282996","poolDate":"2023-08-09T02:19:12.9200032","profileGroupId":"db909755-29d0-4aa4-8815-c77232743991"},{"code":"T-SHIRT-524313","chainNumberId":9420,"chainType":"Substrate","dataValue":"{\"code\":\"Cut\"}","lastTransactionHash":"0xFDAAC62250FB5B132A1E1D897E556C50A4E2C4829D09FFE152919B6008FFA462","receivedDate":"2023-08-09T03:00:48.4703484Z","receiptBlockHash":"","receiptBlockNumber":"","receiptCumulativeGasUsed":"","receiptEffectiveGasPrice":"","receiptFrom":"","receiptGasUsed":"","receiptSuccessful":null,"receiptTo":"","receiptTransactionHash":"","registryDate":"2023-08-09T02:23:53.2579838","smartContractExtraInfo":"{\"InsertTrackSelectorValue\":\"0x1ba63d86\",\"ProofSize\":125952,\"RefTime\":4793859072,\"BasicWeight\":6682666644,\"ByteWeight\":333333,\"SupportedClient\":1,\"WaitingSecondsForWatcherTx\":90}","smartContractId":4,"smartContractAddress":"5C557tarfZcHfxAeCLd67wNjuQCiuvaJr23Qd56kPjUxn382","trackingId":"a68f1397-8fec-4173-b5f5-119da1803c03","transactionStep":"Completed","triageDate":"2023-08-09T02:22:16.8905128","pendingDate":"2023-08-09T02:22:22.5857494","poolDate":"2023-08-09T02:22:17.8541303","profileGroupId":"51d944e7-cc29-4ca2-9b4d-78a07a503a52"},{"code":"T-SHIRT-524313","chainNumberId":101,"chainType":"Substrate","dataValue":"{\"code\":\"Cut\"}","lastTransactionHash":"0x5743A677A9FE4E571CE14B4367B8AADF1B2E86DD6F5E72BEE1BC85E0353CE758","receivedDate":"2023-08-09T03:00:48.4703659Z","receiptBlockHash":"0x5d3b20f3e48bee4ac9bedc373bd0f9e3baf0224785a9468daf6b936273a02584","receiptBlockNumber":"4385991","receiptCumulativeGasUsed":"2210073401122954","receiptEffectiveGasPrice":"","receiptFrom":"bbmFD13HJdRJhEHXJYcN9JCrr3ZCzHS2UVXHZXv6uDbFhLp","receiptGasUsed":"","receiptSuccessful":true,"receiptTo":"","receiptTransactionHash":"0x5743a677a9fe4e571ce14b4367b8aadf1b2e86dd6f5e72bee1bc85e0353ce758","registryDate":"2023-08-09T02:28:11.7032902","smartContractExtraInfo":"{\"InsertTrackSelectorValue\":\"0x1ba63d86\",\"ProofSize\":125952,\"RefTime\":4793859072,\"BasicWeight\":49000000000,\"ByteWeight\":1000000000,\"SupportedClient\":0,\"WaitingSecondsForWatcherTx\":90}","smartContractId":3,"smartContractAddress":"XqLt7FSZrn8nffSGkRYWZKn4JCWZBvHNH3sTRnQL4qDr2Dp","trackingId":"435a16fb-f9cb-46a4-b857-fbb20c194aba","transactionStep":"Completed","triageDate":"2023-08-09T02:26:32.7748857","pendingDate":"2023-08-09T02:26:40.5080335","poolDate":"2023-08-09T02:26:33.3363955","profileGroupId":"71d944e7-cc29-4ca2-9b4d-78a07a503a52"}]% + +``` + +```bash +➜ Downloads curl -X GET 'http://localhost:5000/Analytic/Tracking/Status/435a16fb-f9cb-46a4-b857-fbb20c194aba' -H 'accept: text/plain' + +{"receiptSuccessful":true,"registryDate":"2023-08-09T02:28:11.7032902","trackingId":"435a16fb-f9cb-46a4-b857-fbb20c194aba","transactionStep":"Completed","triageDate":"2023-08-09T02:26:32.7748857","pendingDate":"2023-08-09T02:26:40.5080335","poolDate":"2023-08-09T02:26:33.3363955"}% + +``` + +
+ +#### Subscan tx + +- [tx](https://shibuya.subscan.io/extrinsic/4385991-3) +![image](https://github.com/w3f/Grant-Milestone-Delivery/assets/12571049/ec8b8392-fb0f-4510-9a89-b1e0c3a4e693) +