Code Monkey home page Code Monkey logo

ninechronicles.headless's Issues

Documentation

  • Add an introduction to NineChronicles.Headless
  • Add requirements section
  • Translate to English

Introduce tools for static code analysis

It is hard to stay code with stable coding style while developers to code, if the project become more and more bigger. So I suggest tot use tools for static code analysis, like StyleCopAnalyzers, SonarAnalyzer.CSharp.

RocksDbSharp.RocksDbException: 佉攠牲牯›潎猠慰散氠晥⁴湯搠癥捩䙥楡敬⁤潴圠楲整楆敬›㩃啜敳獲䭜屙灁䑰瑡屡潌慣屬汰湡瑥牡畩屭挹獜慴整敲⽦〰〰㤱氮杯›桔牥⁥獩渠瑯攠潮杵⁨灳捡⁥湯琠敨搠獩⹫਍

Sentry Issue: 9C-STANDALONE-QS

RocksDbSharp.RocksDbException: 佉攠牲牯›潎猠慰散氠晥⁴湯搠癥捩䙥楡敬⁤潴圠楲整楆敬›㩃啜敳獲䭜屙灁䑰瑡屡潌慣屬汰湡瑥牡畩屭挹獜慴整敲⽦〰〰㤱氮杯›桔牥⁥獩渠瑯攠潮杵⁨灳捡⁥湯琠敨搠獩⹫਍
  Module "RocksDbSharp.Native", in rocksdb_put
  Module "Libplanet.RocksDBStore.RocksDBStore", in StoreStateReference
  Module "Libplanet.Blockchain.BlockChain`1", in SetStates
  Module "Libplanet.Blockchain.BlockChain`1", in ExecuteActions
  Module "Libplanet.Blockchain.BlockChain`1", in Append
...
(7 additional frame(s) were not displayed)

Unexpected exception occurred during ProcessFillblock: "RocksDbSharp.RocksDbException: 佉攠牲牯›潎猠慰散氠晥⁴湯搠癥捩䙥楡敬⁤潴圠楲整楆敬›㩃啜敳獲䭜屙灁䑰瑡屡潌慣屬汰湡瑥牡畩屭挹獜慴整敲⽦〰〰㤱氮杯›桔牥⁥獩渠瑯攠潮杵⁨灳捡⁥湯琠敨搠獩⹫਍
   at RocksDbSharp.Native.rocksdb_put(IntPtr db, IntPtr writeOptions, Byte[] key, Int64 keyLength, Byte[] value, Int64 valueLength, ColumnFamilyHandle cf)
   at Libplanet.RocksDBStore.RocksDBStore.StoreStateReference(Guid chainId, IImmutableSet`1 keys, HashDigest`1 blockHash, Int64 blockIndex)
   at Libplanet.Blockchain.BlockChain`1.SetStates(Block`1 block, IReadOnlyList`1 actionEvaluations, Boolean buildStateReferences)
   at Libplanet.Blockchain.BlockChain`1.ExecuteActions(Block`1 block)
   at Libplanet.Blockchain.BlockChain`1.Append(Block`1 block, DateTimeOffset currentTime, Boolean evaluateActions, Boolean renderActions)
   at Libplanet.Net.Swarm`1.FillBlocksAsync(BoundPeer peer, BlockChain`1 blockChain, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Int64 receivedBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.FillBlocksAsync(BoundPeer peer, BlockChain`1 blockChain, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Int64 receivedBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.SyncPreviousBlocksAsync(BlockChain`1 blockChain, BoundPeer peer, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.ProcessFillblock(CancellationToken cancellationToken)"

Re-namining project

I guess "NineChonicles.Standalone" isn't proper to describe its behavior because it hasn't any UI and needs Unity Player as the frontend.

so I suggest "NineChronicles.Headless" for a new name for this project and target assembly name.

Rename publisher

We now name magic onion RPC publisher as ActionEvaluationPublisher, but it handles more than just "action evaluation"s. We have to rename it.

See also #58 (comment).

Introduce `chain tip` subcommand

Now, it provides the function to compare snapshot's metadata with current chain tip data, as graphql query query.validation.metadata. And it causes two issues:

  • Couple with NineChronicles.Snapshot.
  • Must turn on headless application to use the function.

So I suggested to introduce chain tip subcommand to describe tip of current chain without turning on the headless application.

System.ObjectDisposedException: The CancellationTokenSource has been disposed.

Sentry Issue: 9C-STANDALONE-QD

System.ObjectDisposedException: The CancellationTokenSource has been disposed.
  Module "Libplanet.Blockchain.BlockChain`1+<>c__DisplayClass47_0", in <MineBlock>g__WatchTip|0
  Module "Libplanet.Blockchain.BlockChain`1", in Swap
  Module "Libplanet.Net.Swarm`1", in SyncPreviousBlocksAsync
  Module "Libplanet.Net.Swarm`1", in ProcessFillblock
...
(1 additional frame(s) were not displayed)

Unexpected exception occurred during ProcessFillblock: "System.ObjectDisposedException: The CancellationTokenSource has been disposed.
   at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
   at Libplanet.Blockchain.BlockChain`1.<>c__DisplayClass47_0.<MineBlock>g__WatchTip|0(Object target, TipChangedEventArgs args)
   at Libplanet.Blockchain.BlockChain`1.Swap(BlockChain`1 other, Boolean render)
   at Libplanet.Net.Swarm`1.SyncPreviousBlocksAsync(BlockChain`1 blockChain, BoundPeer peer, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.ProcessFillblock(CancellationToken cancellationToken)"

Libplanet.Net.IceServerException: Can't find suitable server.

Sentry Issue: 9C-STANDALONE-QF

Libplanet.Net.IceServerException: Can't find suitable server.
  Module "Libplanet.Net.IceServer", in CreateTurnClient
  Module "Libplanet.Net.NetMQTransport", in InitializeTurnClient
  Module "Libplanet.Net.NetMQTransport", in CreatePermission
  Module "Libplanet.Net.NetMQTransport", in SendMessageWithReplyAsync
  Module "Libplanet.Net.NetMQTransport", in SendMessageWithReplyAsync
...
(26 additional frame(s) were not displayed)

Unexpected exception occurred during ProcessFillblock: "Libplanet.Net.IceServerException: Can't find suitable server.
   at Libplanet.Net.IceServer.CreateTurnClient(IEnumerable`1 iceServers)
   at Libplanet.Net.NetMQTransport.InitializeTurnClient()
   at Libplanet.Net.NetMQTransport.CreatePermission(BoundPeer peer)
   at Libplanet.Net.NetMQTransport.SendMessageWithReplyAsync(BoundPeer peer, Message message, Nullable`1 timeout, Int32 expectedResponses, CancellationToken cancellationToken)
   at Libplanet.Net.NetMQTransport.SendMessageWithReplyAsync(BoundPeer peer, Message message, Nullable`1 timeout, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.GetBlockHashes(BoundPeer peer, BlockLocator locator, Nullable`1 stop, CancellationToken cancellationToken)+MoveNext()
   at System.Collections.Generic.AsyncEnumerableHelpers.ToArrayWithLength[T](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in d:\a\1\s\Ix.NET\Source\System.Linq.Async\System\Linq\AsyncEnumerableHelpers.cs:line 49
   at System.Collections.Generic.AsyncEnumerableHelpers.ToArrayWithLength[T](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in d:\a\1\s\Ix.NET\Source\System.Linq.Async\System\Linq\AsyncEnumerableHelpers.cs:line 91
   at System.Collections.Generic.AsyncEnumerableHelpers.ToArray[T](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in d:\a\1\s\Ix.NET\Source\System.Linq.Async\System\Linq\AsyncEnumerableHelpers.cs:line 19
   at Libplanet.Net.Swarm`1.FillBlocksAsync(BoundPeer peer, BlockChain`1 blockChain, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Int64 receivedBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.SyncPreviousBlocksAsync(BlockChain`1 blockChain, BoundPeer peer, Nullable`1 stop, IProgress`1 progress, Int64 totalBlockCount, Boolean evaluateActions, CancellationToken cancellationToken)
   at Libplanet.Net.Swarm`1.ProcessFillblock(CancellationToken cancellationToken)"

Build GraphQL schema file automatically

Since, the GraphQL schema documentation introduced, the schema.graphql file was also introduced and it is updated in manually for each pull request. It seems easy to mistake so it should be automated in CI (i.e. GitHub Actions).

TURN relay server settings are ignored in `--libplanet-node`

--libplanet-node \
--workers=50 \
-V="100021/6ec8E598962F1f475504F82fD5bF3410eAE58B9B/MEQCIE0NunabTpYPEiaj4PqO1ua4PmbgVNDf50fVPKHYmuExAiByZpCsgom+Gtm3Er+Eb4J3mp2Nk4+ilAD40+wq8YM40g==/ZHUxNjpXaW5kb3dzQmluYXJ5VXJsdTU2Omh0dHBzOi8vZG93bmxvYWQubmluZS1jaHJvbmljbGVzLmNvbS92MTAwMDIxL1dpbmRvd3MuemlwdTE0Om1hY09TQmluYXJ5VXJsdTU3Omh0dHBzOi8vZG93bmxvYWQubmluZS1jaHJvbmljbGVzLmNvbS92MTAwMDIxL21hY09TLnRhci5nenU5OnRpbWVzdGFtcHUxMDoyMDIwLTExLTI3ZQ==" \
--trusted-app-protocol-version-signer=03eeedcd574708681afb3f02fb2aef7c643583089267d17af35e978ecaf2a1184e \
-G=https://9c-test.s3.ap-northeast-2.amazonaws.com/genesis-block-9c-main \
--port=31234 \
--store-path=/app/data/9c-main \
--store-type=rocksdb \
-I="turn://0ed3e48007413e7c2e638f13ddd75ad272c6c507e081bd76a75e4b7adc86c9af:0apejou+ycZFfwtREeXFKdfLj2gCclKzz5ZJ49Cmy6I=@turn-us.planetarium.dev:3478" \
-I="turn://0ed3e48007413e7c2e638f13ddd75ad272c6c507e081bd76a75e4b7adc86c9af:0apejou+ycZFfwtREeXFKdfLj2gCclKzz5ZJ49Cmy6I=@turn-us1.planetarium.dev:3478" \
-I="turn://0ed3e48007413e7c2e638f13ddd75ad272c6c507e081bd76a75e4b7adc86c9af:0apejou+ycZFfwtREeXFKdfLj2gCclKzz5ZJ49Cmy6I=@turn-us2.planetarium.dev:3478" \
--peer=027bd36895d68681290e570692ad3736750ceaab37be402442ffb203967f98f7b6,9c-main-seed-1.planetarium.dev,31234 \
--peer=02f164e3139e53eef2c17e52d99d343b8cbdb09eeed88af46c352b1c8be6329d71,9c-main-seed-2.planetarium.dev,31234 \
--peer=0247e289aa332260b99dfd50e578f779df9e6702d67e50848bb68f3e0737d9b9a5,9c-main-seed-3.planetarium.dev,31234

With the above options, NineChronicles.Standalone.Executable didn't seem to use the TURN relay server(--ice-server).

{"log":"[09:25:33 INF] Listen on 31234\n","stream":"stdout","time":"2020-11-30T09:25:33.467013884Z"}
{"log":"[09:25:33 DBG] Starting swarm...\n","stream":"stdout","time":"2020-11-30T09:25:33.468645177Z"}
{"log":"[09:25:33 DBG] Peer information : 0x0E7745D2e9553037f2B8c2A226Cb4F348920d221.Unspecified/0.0.0.0:31234.\n","stream":"stdout","time":"2020-11-30T09:25:33.469382688Z"}

Crashed with KeyNotFoundException

[2020-08-13 14:27:17.471] [info] Unhandled exception. 
[2020-08-13 14:27:17.486] [info] System.Collections.Generic.KeyNotFoundException: The given hash[8717e405a80ac0b35466e8cddc7873d2b5455275d3c81e5ac3605de491010000] was not found in this chain.
   at Libplanet.Blockchain.BlockChain`1.get_Item(HashDigest`1 blockHash)
   at Libplanet.Blockchain.BlockChain`1.GetRawState(String key, Nullable`1 offset, Boolean completeStates)
   at Libplanet.Blockchain.BlockChain`1.<>c__DisplayClass54_0.<EvaluateActions>b__2(Address a)
   at Libplanet.Action.AccountStateDeltaImpl.Libplanet.Action.IAccountStateDelta.GetState(Address address)
   at Nekoyume.Action.ActionBase.ActionEvaluation`1.<>c__DisplayClass27_0.<ToBytes>b__0(Address addr) in D:\a\9c-launcher\9c-launcher\nekoyume-unity\nekoyume\Assets\_Scripts\Lib9c\Action\ActionBase.cs:line 221
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
   at Nekoyume.Action.ActionBase.ActionEvaluation`1.ToBytes(IAccountStateDelta delta, IImmutableSet`1 updatedAddresses) in D:\a\9c-launcher\9c-launcher\nekoyume-unity\nekoyume\Assets\_Scripts\Lib9c\Action\ActionBase.cs:line 245
   at Nekoyume.Action.ActionBase.ActionEvaluation`1.GetObjectData(SerializationInfo info, StreamingContext context) in D:\a\9c-launcher\9c-launcher\nekoyume-unity\nekoyume\Assets\_Scripts\Lib9c\Action\ActionBase.cs:line 206
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, BinaryFormatterWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Boolean check)
   at NineChronicles.Standalone.ActionEvaluationPublisher.<>c__DisplayClass4_0.<<ExecuteAsync>b__1>d.MoveNext() in D:\a\9c-launcher\9c-launcher\nekoyume-unity\NineChronicles.Standalone\ActionEvaluationPublisher.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Amazon.CloudWatchLogs.AmazonCloudWatchLogsException: Rate exceeded


[2021-03-08 14:31:44.562] [info] Unexpected exception occurred during CreateLogStreamAsync. Amazon.CloudWatchLogs.AmazonCloudWatchLogsException: Rate exceeded
 ---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
   at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
   at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
   --- End of inner exception stack trace ---
   at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception)
   at Amazon.Runtime.Internal.ExceptionHandler`1.Handle(IExecutionContext executionContext, Exception exception)
   at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)
   at NineChronicles.Headless.Executable.AWSSink.EmitBatchAsync(IEnumerable`1 batch) in D:\a\9c-launcher\9c-launcher\NineChronicles.Headless\NineChronicles.Headless.Executable\AWSSink.cs:line 48

Log events in a single PutLogEvents request must be in chronological order

[2021-03-06 01:13:00.883] [info] Worker exception occurred: Amazon.CloudWatchLogs.Model.InvalidParameterException: Log events in a single PutLogEvents request must be in chronological order.
 ---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
   at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
   at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
   --- End of inner exception stack trace ---
   at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception)
   at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)
   at NineChronicles.Headless.Executable.AWSSink.PutLogEventsAsync(PutLogEventsRequest request, CancellationToken cancellationToken) in D:\a\9c-launcher\9c-launcher\NineChronicles.Headless\NineChronicles.Headless.Executable\AWSSink.cs:line 103
   at NineChronicles.Headless.Executable.AWSSink.EmitBatchAsync(IEnumerable`1 batch) in D:\a\9c-launcher\9c-launcher\NineChronicles.Headless\NineChronicles.Headless.Executable\AWSSink.cs:line 82.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.