From 4c1a232c36fe6de0cb622d5ca2a2c72714851677 Mon Sep 17 00:00:00 2001 From: moreal Date: Wed, 2 Oct 2024 15:11:49 +0900 Subject: [PATCH 01/16] Deserialize only transfer-asset actions --- NineChronicles.Headless/GraphTypes/StandaloneQuery.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs b/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs index 3cfeb63ff..c9ed20236 100644 --- a/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs +++ b/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs @@ -238,17 +238,20 @@ public StandaloneQuery(StandaloneContext standaloneContext, IKeyStore keyStore, var filtered = block.Transactions .Where(tx => tx.Actions.Count == 1) + .Where(tx => + tx.Actions[0] is Dictionary dictionary && dictionary.ContainsKey("type_id") && + dictionary["type_id"] is Text typeId && typeId == TransferAsset.TypeIdentifier) .Select(tx => ( transactionRepository.GetTxExecution(blockHash, tx.Id) ?? - throw new InvalidOperationException($"TxExecution {tx.Id} not found."), + throw new InvalidOperationException($"TxExecution {tx.Id} not found."), ToAction(tx.Actions[0]) )) .Where(pair => pair.Item2 is ITransferAsset) .Select(pair => (pair.Item1!, (ITransferAsset)pair.Item2)) .Where(pair => !pair.Item1.Fail && - (!recipient.HasValue || pair.Item2.Recipient == recipient) && - pair.Item2.Amount.Currency.Ticker == "NCG"); + (!recipient.HasValue || pair.Item2.Recipient == recipient) && + pair.Item2.Amount.Currency.Ticker == "NCG"); var histories = filtered.Select(pair => new TransferNCGHistory( From 32efc0ef84239d7f0da4877ad7f6d4fbeadb4c97 Mon Sep 17 00:00:00 2001 From: Yang Chun Ung Date: Thu, 17 Oct 2024 11:51:42 +0900 Subject: [PATCH 02/16] Bump lib9c main --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index 810b1d86a..af1ed0865 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit 810b1d86a3f11f9780c270671b845bfa7c8bd0a1 +Subproject commit af1ed08655712b90a40a7ebc5fde2dd063cd9cbc From 940ca4e11f90f1733bca31d9bdbe153b735049fb Mon Sep 17 00:00:00 2001 From: eugene-hong <58686228+eugene-doobu@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:13:13 +0900 Subject: [PATCH 03/16] add code rules --- ...nicles.Headless.Executable.sln.DotSettings | 99 ++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/NineChronicles.Headless.Executable.sln.DotSettings b/NineChronicles.Headless.Executable.sln.DotSettings index 61ddddd89..ab96c4bc4 100644 --- a/NineChronicles.Headless.Executable.sln.DotSettings +++ b/NineChronicles.Headless.Executable.sln.DotSettings @@ -1,3 +1,100 @@  + DO_NOT_SHOW + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + SUGGESTION + Required + Required + Required + Required + False + True + True + False + False + False + False + False + False + False + False + False + False + False + False + False + False + False + False + True + False + True + NEVER + NEVER + ALWAYS + True + False + 300 + AI + CRYSTAL + GARAGE + GO + HTTP NCG - True \ No newline at end of file + PACKAGE + SINGLE + VFX + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file From 4052de43c269b9693586a881a9f347ab89531443 Mon Sep 17 00:00:00 2001 From: eugene-hong <58686228+eugene-doobu@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:44:51 +0900 Subject: [PATCH 04/16] apply roslyn-code-rule(name space) --- NineChronicles.Headless.Executable.sln.DotSettings | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NineChronicles.Headless.Executable.sln.DotSettings b/NineChronicles.Headless.Executable.sln.DotSettings index ab96c4bc4..faba90398 100644 --- a/NineChronicles.Headless.Executable.sln.DotSettings +++ b/NineChronicles.Headless.Executable.sln.DotSettings @@ -13,6 +13,7 @@ Required Required False + BlockScoped True True False @@ -40,6 +41,8 @@ True False 300 + True + True AI CRYSTAL GARAGE From 9dfde00969240ca44c64c630b426d530585d6a3d Mon Sep 17 00:00:00 2001 From: eugene-hong <58686228+eugene-doobu@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:42:53 +0900 Subject: [PATCH 05/16] bump lib9c --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index d72847989..f6382bfea 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit d7284798938ba67750a05fd9e09317a550cff161 +Subproject commit f6382bfea11a68e794ae3ff13426064f121b500d From d967756363e1729295fba73a2f0bc97652be8fc8 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 22 Oct 2024 18:20:04 +0900 Subject: [PATCH 06/16] Bump lib9c --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index f6382bfea..a8058b946 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit f6382bfea11a68e794ae3ff13426064f121b500d +Subproject commit a8058b946c3d93a61bf4e4d977cb04900562ea13 From f2fe50650e08912b71c4665cb3d7cc292a4bfe18 Mon Sep 17 00:00:00 2001 From: hyeon Date: Tue, 22 Oct 2024 18:28:27 +0900 Subject: [PATCH 07/16] Bump lib9c --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index a8058b946..55b6e9e8c 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit a8058b946c3d93a61bf4e4d977cb04900562ea13 +Subproject commit 55b6e9e8cf83c8bf32a2d809b204803ca6fdc793 From e4ed419287a86b120e91e934848f9bdbc10377f6 Mon Sep 17 00:00:00 2001 From: hyeon Date: Thu, 24 Oct 2024 10:23:57 +0900 Subject: [PATCH 08/16] Bump lib9c: Bump libplanet to 5.3.2-alpha.1 --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index 55b6e9e8c..f33874a65 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit 55b6e9e8cf83c8bf32a2d809b204803ca6fdc793 +Subproject commit f33874a6536e6ba05c789a18cda47d5a4b0cafb7 From 87eb1492592ea0b93b3bbf5a89ab27aba5fd5279 Mon Sep 17 00:00:00 2001 From: hyeon Date: Fri, 25 Oct 2024 13:31:56 +0900 Subject: [PATCH 09/16] Bump lib9c: Fix option count --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index f33874a65..d4cfc48a4 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit f33874a6536e6ba05c789a18cda47d5a4b0cafb7 +Subproject commit d4cfc48a4f737ae8eeffb1a9b4cf89fe6fc6cd19 From 1bc531da6250844cbd67586797bf2539205d9d9a Mon Sep 17 00:00:00 2001 From: Gongkirby <9040__@naver.com> Date: Sun, 27 Oct 2024 14:28:42 +0900 Subject: [PATCH 10/16] chore: clean arenaParticipantsSync option --- NineChronicles.Headless.Executable/Configuration.cs | 4 ---- NineChronicles.Headless.Executable/Program.cs | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/NineChronicles.Headless.Executable/Configuration.cs b/NineChronicles.Headless.Executable/Configuration.cs index 2543b2c23..0f0d9c6f2 100644 --- a/NineChronicles.Headless.Executable/Configuration.cs +++ b/NineChronicles.Headless.Executable/Configuration.cs @@ -93,8 +93,6 @@ public class Configuration public AccessControlServiceOptions? AccessControlService { get; set; } - public int ArenaParticipantsSyncInterval { get; set; } = 1000; - public void Overwrite( string? appProtocolVersionString, string[]? trustedAppProtocolVersionSignerStrings, @@ -143,7 +141,6 @@ public void Overwrite( double? consensusTargetBlockIntervalMilliseconds, int? consensusProposeSecondBase, int? maxTransactionPerBlock, - int? arenaParticipantsSyncInterval, bool? remoteKeyValueService ) { @@ -195,7 +192,6 @@ public void Overwrite( ConsensusTargetBlockIntervalMilliseconds = consensusTargetBlockIntervalMilliseconds ?? ConsensusTargetBlockIntervalMilliseconds; ConsensusProposeSecondBase = consensusProposeSecondBase ?? ConsensusProposeSecondBase; MaxTransactionPerBlock = maxTransactionPerBlock ?? MaxTransactionPerBlock; - ArenaParticipantsSyncInterval = arenaParticipantsSyncInterval ?? ArenaParticipantsSyncInterval; RemoteKeyValueService = remoteKeyValueService ?? RemoteKeyValueService; } } diff --git a/NineChronicles.Headless.Executable/Program.cs b/NineChronicles.Headless.Executable/Program.cs index db5821b8f..fcf00694f 100644 --- a/NineChronicles.Headless.Executable/Program.cs +++ b/NineChronicles.Headless.Executable/Program.cs @@ -215,10 +215,6 @@ public async Task Run( [Option("config", new[] { 'C' }, Description = "Absolute path of \"appsettings.json\" file to provide headless configurations.")] string? configPath = "appsettings.json", - [Option(Description = "arena participants list sync interval time")] - int? arenaParticipantsSyncInterval = null, - [Option(Description = "arena participants list sync enable")] - bool arenaParticipantsSync = true, [Option(Description = "[DANGER] Turn on RemoteKeyValueService to debug.")] bool remoteKeyValueService = false, [Ignore] CancellationToken? cancellationToken = null @@ -303,7 +299,7 @@ public async Task Run( txLifeTime, messageTimeout, tipTimeout, demandBuffer, skipPreload, minimumBroadcastTarget, bucketSize, chainTipStaleBehaviorType, txQuotaPerSigner, maximumPollPeers, consensusPort, consensusPrivateKeyString, consensusSeedStrings, consensusTargetBlockIntervalMilliseconds, consensusProposeSecondBase, - maxTransactionPerBlock, arenaParticipantsSyncInterval, remoteKeyValueService + maxTransactionPerBlock, remoteKeyValueService ); // Clean-up previous temporary log files. From 76c1e57c9d4b8e104930957359825fbcdc07efcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=9D=80=EB=B9=88=20Eunbeen=20Kang?= <145640625+river20s@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:38:39 +0900 Subject: [PATCH 11/16] Support more minterless currencies (#2612) --- NineChronicles.Headless/GraphTypes/CurrencyEnumType.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NineChronicles.Headless/GraphTypes/CurrencyEnumType.cs b/NineChronicles.Headless/GraphTypes/CurrencyEnumType.cs index ef6745ea3..84f467599 100644 --- a/NineChronicles.Headless/GraphTypes/CurrencyEnumType.cs +++ b/NineChronicles.Headless/GraphTypes/CurrencyEnumType.cs @@ -9,7 +9,13 @@ public enum CurrencyEnum CRYSTAL, NCG, GARAGE, - MEAD + MEAD, + RUNE_GOLDENLEAF, + RUNE_ADVENTURER, + RUNESTONE_FREYA_LIBERATION, + RUNESTONE_FREYA_BLESSING, + RUNESTONE_ODIN_WEAKNESS, + RUNESTONE_ODIN_WISDOM } public class CurrencyEnumType : EnumerationGraphType From 6f9c2eb19574fa360e6e36153499ce0d93e1390b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=9D=80=EB=B9=88=20Eunbeen=20Kang?= Date: Sun, 27 Oct 2024 16:06:52 +0900 Subject: [PATCH 12/16] Deprecate outdated ActionMutation --- NineChronicles.Headless/GraphTypes/ActionMutation.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/NineChronicles.Headless/GraphTypes/ActionMutation.cs b/NineChronicles.Headless/GraphTypes/ActionMutation.cs index 17e9f7e66..099735937 100644 --- a/NineChronicles.Headless/GraphTypes/ActionMutation.cs +++ b/NineChronicles.Headless/GraphTypes/ActionMutation.cs @@ -17,8 +17,11 @@ public class ActionMutation : ObjectGraphType { public ActionMutation(NineChroniclesNodeService service) { + DeprecationReason = "Since NCIP-15, it doesn't care account activation."; + Field>("createAvatar", description: "Create new avatar.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -96,6 +99,7 @@ public ActionMutation(NineChroniclesNodeService service) Field>("hackAndSlash", description: "Start stage to get material.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -179,6 +183,7 @@ public ActionMutation(NineChroniclesNodeService service) Field>("combinationEquipment", description: "Combine new equipment.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -239,6 +244,7 @@ public ActionMutation(NineChroniclesNodeService service) Field>("itemEnhancement", description: "Upgrade equipment.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -303,6 +309,7 @@ public ActionMutation(NineChroniclesNodeService service) Field>("dailyReward", description: "Get daily reward.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -345,6 +352,7 @@ public ActionMutation(NineChroniclesNodeService service) }); Field>("chargeActionPoint", description: "Charge Action Points using Material.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { @@ -388,6 +396,7 @@ public ActionMutation(NineChroniclesNodeService service) Field>("combinationConsumable", description: "Combine new Consumable.", + deprecationReason: DeprecationReason, arguments: new QueryArguments( new QueryArgument> { From af2e72214f1f3df4cd0adc900ad4655ca09061e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=9D=80=EB=B9=88=20Eunbeen=20Kang?= Date: Sun, 27 Oct 2024 16:13:54 +0900 Subject: [PATCH 13/16] Rewrite the deprecationReason --- NineChronicles.Headless/GraphTypes/ActionMutation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NineChronicles.Headless/GraphTypes/ActionMutation.cs b/NineChronicles.Headless/GraphTypes/ActionMutation.cs index 099735937..73e08e86b 100644 --- a/NineChronicles.Headless/GraphTypes/ActionMutation.cs +++ b/NineChronicles.Headless/GraphTypes/ActionMutation.cs @@ -17,7 +17,7 @@ public class ActionMutation : ObjectGraphType { public ActionMutation(NineChroniclesNodeService service) { - DeprecationReason = "Since NCIP-15, it doesn't care account activation."; + DeprecationReason = "This API is insecure and must not be used."; Field>("createAvatar", description: "Create new avatar.", From cfaeb2a97dfb414f77e89ce4ad19b7ddf432e3e3 Mon Sep 17 00:00:00 2001 From: Gongkirby <9040__@naver.com> Date: Sun, 27 Oct 2024 16:43:06 +0900 Subject: [PATCH 14/16] refactor: use buildx on push_doker_image --- .github/workflows/push_docker_image.yml | 50 ++++++++----------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index bd0911e71..ce5b82d87 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -48,28 +48,17 @@ jobs: docker run --rm --privileged multiarch/qemu-user-static \ --reset \ -p yes - - name: build-and-push-amd64 - run: | - docker build . \ - -f ${{ matrix.docker.dockerfile }}.amd64 \ - -t ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ - --build-arg COMMIT=git-${{ github.sha }} \ - --build-arg TARGETPLATFORM=linux/amd64 - docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 - - name: build-and-push-arm64v8 - run: | - docker build . \ - -f ${{ matrix.docker.dockerfile }}.arm64v8 \ - -t ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \ - --build-arg COMMIT=git-${{ github.sha }} \ - --build-arg TARGETPLATFORM=linux/arm64 - docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 - - name: merge-manifest-and-push - run: | - docker manifest create ${{ matrix.docker.repo }}:git-${{ github.sha }} \ - --amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ - --amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 - docker manifest push ${{ matrix.docker.repo }}:git-${{ github.sha }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm/v8,linux/amd64 + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: ${{ github.event_name != 'pull_request' }} + platforms: linux/arm64,linux/amd64 + tags: ${{ matrix.docker.repo }}:git-${{ github.sha }} + file: ${{ matrix.docker.dockerfile }} tag: name: tag (${{ matrix.docker.repo }}) @@ -87,7 +76,7 @@ jobs: --password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}' - name: push git tagged version run: | - docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 + docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }} if [[ -z "${{ github.event.inputs.imageTag }}" ]]; then export IMAGE_TAG=${{ github.ref_name }} else @@ -95,15 +84,6 @@ jobs: fi docker tag \ - ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ - ${{ matrix.docker.repo }}:$IMAGE_TAG-amd64 - docker push ${{ matrix.docker.repo }}:$IMAGE_TAG-amd64 - docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 - docker tag \ - ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \ - ${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8 - docker push ${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8 - docker manifest create ${{ matrix.docker.repo }}:$IMAGE_TAG \ - --amend ${{ matrix.docker.repo }}:$IMAGE_TAG-amd64 \ - --amend ${{ matrix.docker.repo }}:$IMAGE_TAG-arm64v8 - docker manifest push ${{ matrix.docker.repo }}:$IMAGE_TAG + ${{ matrix.docker.repo }}:git-${{ github.sha }} \ + ${{ matrix.docker.repo }}:$IMAGE_TAG + docker push ${{ matrix.docker.repo }}:$IMAGE_TAG From 29c4ac506010d433134d2eeda6dc77a0227c7958 Mon Sep 17 00:00:00 2001 From: hyeon Date: Mon, 28 Oct 2024 11:10:24 +0900 Subject: [PATCH 15/16] Bump lib9c to 1.19.0 --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index d4cfc48a4..9f1661102 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit d4cfc48a4f737ae8eeffb1a9b4cf89fe6fc6cd19 +Subproject commit 9f1661102a74ef38c4715061c7e8a36d8c544366 From 56c699c8d53aa850ce0e61c9ac7feae7f7e8832e Mon Sep 17 00:00:00 2001 From: moreal Date: Mon, 28 Oct 2024 11:08:48 +0900 Subject: [PATCH 16/16] ci(gh-actions): fix workflow to build docker image --- .github/workflows/push_docker_image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index ce5b82d87..238840de9 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -59,6 +59,7 @@ jobs: platforms: linux/arm64,linux/amd64 tags: ${{ matrix.docker.repo }}:git-${{ github.sha }} file: ${{ matrix.docker.dockerfile }} + build-args: COMMIT=git-${{ github.sha }} tag: name: tag (${{ matrix.docker.repo }})