Skip to content

Commit

Permalink
Merge pull request #2513 from planetarium/main-merge-release-170
Browse files Browse the repository at this point in the history
Main merge release 170
  • Loading branch information
ipdae authored Jul 29, 2024
2 parents 4e9d8dd + 0bf6945 commit 8f4762d
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Lib9c
Submodule Lib9c updated 97 files
+2 −2 .Lib9c.Benchmarks/Lib9c.Benchmarks.csproj
+9 −0 .Lib9c.Tests/Action/ActionContext.cs
+34 −28 .Lib9c.Tests/Action/AdventureBoss/ClaimAdventureBossRewardTest.cs
+52 −21 .Lib9c.Tests/Action/AdventureBoss/ExploreAdventureBossTest.cs
+3 −3 .Lib9c.Tests/Action/AdventureBoss/SweepAdventureBossTest.cs
+12 −3 .Lib9c.Tests/Action/AdventureBoss/UnlockFloorTest.cs
+4 −4 .Lib9c.Tests/Action/AdventureBoss/WantedTest.cs
+3 −2 .Lib9c.Tests/Action/BuyTest.cs
+2 −1 .Lib9c.Tests/Action/CombinationEquipmentTest.cs
+193 −2 .Lib9c.Tests/Action/ItemEnhancementTest.cs
+5 −0 .Lib9c.Tests/Action/RaidTest.cs
+2 −2 .Lib9c.Tests/Action/Scenario/GrimoireScenarioTest.cs
+3 −2 .Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs
+861 −0 .Lib9c.Tests/Fixtures/TableCSV/Cost/EnhancementCostSheetFixtures.cs
+1 −1 .Lib9c.Tests/Lib9c.Tests.csproj
+12 −10 .Lib9c.Tests/Model/AdventureBoss/AdventureBossSimulatorTest.cs
+18 −0 .Lib9c.Tests/Model/Item/EquipmentTest.cs
+41 −23 .Lib9c.Tests/Policy/BlockPolicyTest.cs
+3 −2 .Lib9c.Tests/TableData/ArenaSheetTest.cs
+1 −1 .Lib9c.Tools/Lib9c.Tools.csproj
+1 −1 .Lib9c.Tools/SubCommand/State.cs
+1 −1 .Libplanet
+1 −1 ...anet.Extensions.ActionEvaluatorCommonComponents/Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj
+2 −1 .Libplanet.Extensions.ActionEvaluatorCommonComponents/PreEvaluationBlockMarshaller.cs
+10 −4 .github/workflows/main.yml
+3 −2 .github/workflows/publish.yml
+1 −1 @planetarium/lib9c/jsr.json
+1 −1 @planetarium/lib9c/package.json
+47 −0 @planetarium/lib9c/src/actions/create_avatar.ts
+5 −0 @planetarium/lib9c/src/index.ts
+33 −0 @planetarium/lib9c/tests/actions/create_avatar.test.ts
+15 −0 Lib9c.Abstractions/IItemEnhancementV5.cs
+1 −1 Lib9c.Abstractions/Lib9c.Abstractions.csproj
+3 −3 Lib9c.DevExtensions/Lib9c.DevExtensions.csproj
+2 −0 Lib9c.Policy/Policy/DebugPolicy.cs
+1 −1 Lib9c.Proposer/Lib9c.Proposer.csproj
+1 −0 Lib9c.Proposer/Proposer.cs
+11 −11 Lib9c.sln
+2 −1 Lib9c/Action/AuraSummon.cs
+2 −1 Lib9c/Action/Buy.cs
+3 −2 Lib9c/Action/BuyProduct.cs
+2 −1 Lib9c/Action/CombinationEquipment.cs
+92 −0 Lib9c/Action/HackAndSlash.cs
+90 −7 Lib9c/Action/ItemEnhancement.cs
+2 −1 Lib9c/Action/ItemEnhancement11.cs
+2 −1 Lib9c/Action/ItemEnhancement12.cs
+16 −12 Lib9c/Action/ItemEnhancement13.cs
+2 −1 Lib9c/Action/PetEnhancement.cs
+6 −1 Lib9c/Action/Raid.cs
+2 −1 Lib9c/Action/RuneEnhancement.cs
+2 −1 Lib9c/Action/RuneSummon.cs
+2 −1 Lib9c/Action/UnlockRuneSlot.cs
+0 −6 Lib9c/Addresses.cs
+3 −15 Lib9c/GameConfig.cs
+3 −3 Lib9c/Helper/AdventureBossHelper.cs
+7 −3 Lib9c/Lib9c.csproj
+4 −4 Lib9c/Model/AdventureBoss/SeasonInfo.cs
+5 −5 Lib9c/TableCSV/AdventureBoss/AdventureBossContributionRewardSheet.csv
+80 −80 Lib9c/TableCSV/AdventureBoss/AdventureBossFloorFirstRewardSheet.csv
+81 −81 Lib9c/TableCSV/AdventureBoss/AdventureBossFloorSheet.csv
+80 −80 Lib9c/TableCSV/AdventureBoss/AdventureBossFloorWaveSheet.csv
+8 −8 Lib9c/TableCSV/AdventureBoss/AdventureBossNcgRewardRatioSheet.csv
+4 −4 Lib9c/TableCSV/AdventureBoss/AdventureBossSheet.csv
+12 −12 Lib9c/TableCSV/AdventureBoss/AdventureBossUnlockFloorCostSheet.csv
+4 −4 Lib9c/TableCSV/AdventureBoss/AdventureBossWantedRewardSheet.csv
+10 −10 Lib9c/TableCSV/Arena/ArenaSheet.csv
+100 −100 Lib9c/TableCSV/Character/CharacterLevelSheet.csv
+148 −122 Lib9c/TableCSV/CollectionSheet.csv
+472 −361 Lib9c/TableCSV/Cost/EnhancementCostSheetV3.csv
+59 −21 Lib9c/TableCSV/Crystal/CrystalEquipmentGrindingSheet.csv
+6 −6 Lib9c/TableCSV/GameConfigSheet.csv
+4 −3 Lib9c/TableCSV/Item/CostumeItemSheet.csv
+7 −5 Lib9c/TableCSV/Item/CostumeStatSheet.csv
+82 −1 Lib9c/TableCSV/Item/EquipmentItemOptionSheet.csv
+114 −75 Lib9c/TableCSV/Item/EquipmentItemRecipeSheet.csv
+81 −43 Lib9c/TableCSV/Item/EquipmentItemSheet.csv
+585 −546 Lib9c/TableCSV/Item/EquipmentItemSubRecipeSheetV2.csv
+40 −1 Lib9c/TableCSV/Item/ItemRequirementSheet.csv
+28 −2 Lib9c/TableCSV/Item/MaterialItemSheet.csv
+6 −1 Lib9c/TableCSV/Rune/RuneListSheet.csv
+1,501 −1 Lib9c/TableCSV/Rune/RuneOptionSheet.csv
+1,501 −1 Lib9c/TableCSV/RuneCostSheet.csv
+6 −1 Lib9c/TableCSV/RuneSheet.csv
+3 −3 Lib9c/TableCSV/Skill/ActionBuffSheet.csv
+1 −1 Lib9c/TableCSV/Skill/BuffLinkSheet.csv
+2 −2 Lib9c/TableCSV/Skill/DeBuffLimitSheet.csv
+1 −1 Lib9c/TableCSV/Skill/SkillActionBuffSheet.csv
+66 −1 Lib9c/TableCSV/Skill/SkillBuffSheet.csv
+25 −4 Lib9c/TableCSV/Skill/SkillSheet.csv
+45 −10 Lib9c/TableCSV/Skill/StatBuffSheet.csv
+7 −4 Lib9c/TableCSV/Summon/SummonSheet.csv
+202 −202 Lib9c/TableCSV/WorldAndStage/StageSheet.csv
+231 −231 Lib9c/TableCSV/WorldAndStage/StageWaveSheet.csv
+7 −7 Lib9c/TableCSV/WorldBoss/WorldBossListSheet.csv
+5 −0 Lib9c/TableData/Cost/EnhancementCostSheetV3.cs
+0 −5 Lib9c/TableData/Item/ItemRequirementSheet.cs
+1 −1 Libplanet.Crypto.Secp256k1/Libplanet.Crypto.Secp256k1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Libplanet.Crypto;
using Libplanet.Types.Tx;
using ArgumentOutOfRangeException = System.ArgumentOutOfRangeException;
using Libplanet.Types.Evidence;

namespace Libplanet.Extensions.ForkableActionEvaluator.Tests;

Expand Down Expand Up @@ -135,4 +136,6 @@ public MockBlock(long blockIndex)
public BlockCommit? LastCommit { get; }
public IReadOnlyList<ITransaction> Transactions { get; }
public HashDigest<SHA256> PreEvaluationHash { get; }
public IReadOnlyList<EvidenceBase> Evidence { get; }
public HashDigest<SHA256>? EvidenceHash { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Lib9c.Plugin.Shared\Lib9c.Plugin.Shared.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Libplanet.Headless/Libplanet.Headless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet.Net\Libplanet.Net.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\src\Libplanet.Net\Libplanet.Net.csproj" />
<ProjectReference Include="..\NineChronicles.RPC.Shared\NineChronicles.RPC.Shared\NineChronicles.RPC.Shared.csproj" />
<ProjectReference Include="..\Libplanet.Extensions.ForkableActionEvaluator\Libplanet.Extensions.ForkableActionEvaluator.csproj" />
<ProjectReference Include="..\Libplanet.Extensions.PluggedActionEvaluator\Libplanet.Extensions.PluggedActionEvaluator.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ private Block MineGenesisBlock()
block.Hash,
DateTimeOffset.UtcNow,
validator.PublicKey,
null,
VoteFlag.PreCommit).Sign(validator)))
: null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void AppendEmptyBlock(BlockChain blockChain)
block.Hash,
new[]
{
new VoteMetadata(block.Index, 0, block.Hash, block.Timestamp, ValidatorKey.PublicKey, VoteFlag.PreCommit).Sign(ValidatorKey),
new VoteMetadata(block.Index, 0, block.Hash, block.Timestamp, ValidatorKey.PublicKey, null, VoteFlag.PreCommit).Sign(ValidatorKey),
}.ToImmutableArray());
blockChain.Append(block, blockCommit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="MagicOnion.Client" Version="5.0.3" />
<PackageReference Include="MagicOnion.Client" Version="6.1.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NineChronicles.Headless.Executable\NineChronicles.Headless.Executable.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet.Mocks\Libplanet.Mocks.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

</Project>
28 changes: 14 additions & 14 deletions NineChronicles.Headless.Executable.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Headless", "Libpl
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Headless.Tests", "Libplanet.Headless.Tests\Libplanet.Headless.Tests.csproj", "{0B82AB6A-32B1-4F76-B965-B56B052057D4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Analyzers", "Lib9c\.Libplanet\Libplanet.Analyzers\Libplanet.Analyzers.csproj", "{AACC51F4-D38A-4094-BF50-BDC981848517}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Analyzers", "Lib9c\.Libplanet\tools\Libplanet.Analyzers\Libplanet.Analyzers.csproj", "{AACC51F4-D38A-4094-BF50-BDC981848517}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NineChronicles.Headless", "NineChronicles.Headless\NineChronicles.Headless.csproj", "{AE6FE611-BB8E-4E85-8623-34608EC868CD}"
EndProject
Expand All @@ -19,17 +19,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c", "Lib9c\Lib9c\Lib9c.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NineChronicles.RPC.Shared", "NineChronicles.RPC.Shared\NineChronicles.RPC.Shared\NineChronicles.RPC.Shared.csproj", "{106573F6-F9C1-41B7-8F02-40E76F177C24}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet", "Lib9c\.Libplanet\Libplanet\Libplanet.csproj", "{E18779D4-103C-42D2-A94F-EEB801B32750}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet", "Lib9c\.Libplanet\src\Libplanet\Libplanet.csproj", "{E18779D4-103C-42D2-A94F-EEB801B32750}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.RocksDBStore", "Lib9c\.Libplanet\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj", "{2C079592-8EDC-4911-AFF9-828419E0FDC1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.RocksDBStore", "Lib9c\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj", "{2C079592-8EDC-4911-AFF9-828419E0FDC1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Stun", "Lib9c\.Libplanet\Libplanet.Stun\Libplanet.Stun.csproj", "{3B2875B4-B6C6-4929-B885-18A922110ED2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Stun", "Lib9c\.Libplanet\src\Libplanet.Stun\Libplanet.Stun.csproj", "{3B2875B4-B6C6-4929-B885-18A922110ED2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NineChronicles.Headless.Executable.Tests", "NineChronicles.Headless.Executable.Tests\NineChronicles.Headless.Executable.Tests.csproj", "{6E38A2CF-B93F-4CD5-9CAC-DE121998FF18}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.Cocona", "Lib9c\.Libplanet\Libplanet.Extensions.Cocona\Libplanet.Extensions.Cocona.csproj", "{B1C7C07A-2394-4778-A328-D536C7FC3CDD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.Cocona", "Lib9c\.Libplanet\tools\Libplanet.Extensions.Cocona\Libplanet.Extensions.Cocona.csproj", "{B1C7C07A-2394-4778-A328-D536C7FC3CDD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Explorer", "Lib9c\.Libplanet\Libplanet.Explorer\Libplanet.Explorer.csproj", "{D1AAC8D1-742F-4E71-A3B3-651069B6C0F7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Explorer", "Lib9c\.Libplanet\tools\Libplanet.Explorer\Libplanet.Explorer.csproj", "{D1AAC8D1-742F-4E71-A3B3-651069B6C0F7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4D8FC180-CD64-4774-B9BF-BF290C01BB1A}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -38,7 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.DevExtensions", "Lib9c\Lib9c.DevExtensions\Lib9c.DevExtensions.csproj", "{8411BF58-22E7-4174-AEE6-7332FE690906}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Net", "Lib9c\.Libplanet\Libplanet.Net\Libplanet.Net.csproj", "{858AEAB3-CC9C-41C4-9727-4243708FD803}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Net", "Lib9c\.Libplanet\src\Libplanet.Net\Libplanet.Net.csproj", "{858AEAB3-CC9C-41C4-9727-4243708FD803}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.MessagePack", "Lib9c\Lib9c.MessagePack\Lib9c.MessagePack.csproj", "{A9513460-EE7A-455F-A823-5005DB6BA8FC}"
EndProject
Expand All @@ -60,15 +60,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.Forkab
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Libplanet", ".Libplanet", "{69F04D28-2B2E-454D-9B15-4D708EEEA8B5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Action", "Lib9c\.Libplanet\Libplanet.Action\Libplanet.Action.csproj", "{EB464A50-9976-4DEA-B170-F72C4FB73A9C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Action", "Lib9c\.Libplanet\src\Libplanet.Action\Libplanet.Action.csproj", "{EB464A50-9976-4DEA-B170-F72C4FB73A9C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Common", "Lib9c\.Libplanet\Libplanet.Common\Libplanet.Common.csproj", "{95FB2620-540C-4498-9DAE-65198E89680C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Common", "Lib9c\.Libplanet\src\Libplanet.Common\Libplanet.Common.csproj", "{95FB2620-540C-4498-9DAE-65198E89680C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Types", "Lib9c\.Libplanet\Libplanet.Types\Libplanet.Types.csproj", "{FC65B031-F6EE-4561-A365-47B6FDD1C114}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Types", "Lib9c\.Libplanet\src\Libplanet.Types\Libplanet.Types.csproj", "{FC65B031-F6EE-4561-A365-47B6FDD1C114}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Store", "Lib9c\.Libplanet\Libplanet.Store\Libplanet.Store.csproj", "{2FF6DADC-5E7A-4F03-94D5-2CF50DED8C29}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Store", "Lib9c\.Libplanet\src\Libplanet.Store\Libplanet.Store.csproj", "{2FF6DADC-5E7A-4F03-94D5-2CF50DED8C29}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Crypto", "Lib9c\.Libplanet\Libplanet.Crypto\Libplanet.Crypto.csproj", "{2C3AD392-38A1-4E07-B1F9-694EE4A1E0C0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Crypto", "Lib9c\.Libplanet\src\Libplanet.Crypto\Libplanet.Crypto.csproj", "{2C3AD392-38A1-4E07-B1F9-694EE4A1E0C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.ActionEvaluatorCommonComponents", "Lib9c\.Libplanet.Extensions.ActionEvaluatorCommonComponents\Libplanet.Extensions.ActionEvaluatorCommonComponents.csproj", "{A6922395-36E5-4B0A-BEBD-9BCE34D08722}"
EndProject
Expand All @@ -78,9 +78,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Extensions.Plugge
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib9c.Plugin.Shared", "Lib9c\.Lib9c.Plugin.Shared\Lib9c.Plugin.Shared.csproj", "{3D32DA34-E619-429F-8421-848FF4F14417}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Mocks", "Lib9c\.Libplanet\Libplanet.Mocks\Libplanet.Mocks.csproj", "{F79B695B-6FCC-43F5-AEE4-88E484382B9B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Mocks", "Lib9c\.Libplanet\test\Libplanet.Mocks\Libplanet.Mocks.csproj", "{F79B695B-6FCC-43F5-AEE4-88E484382B9B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Store.Remote", "Lib9c\.Libplanet\Libplanet.Store.Remote\Libplanet.Store.Remote.csproj", "{D1E15F81-8765-4DCA-9299-675415686C23}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Store.Remote", "Lib9c\.Libplanet\src\Libplanet.Store.Remote\Libplanet.Store.Remote.csproj", "{D1E15F81-8765-4DCA-9299-675415686C23}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Libplanet.Action.State;
using Libplanet.Types.Tx;
using Serilog;
using Libplanet.Types.Evidence;

namespace NineChronicles.Headless.Executable.Commands
{
Expand Down Expand Up @@ -61,6 +62,8 @@ public ActionContext(
// NOTE: Replay does not support block actions.
public IReadOnlyList<ITransaction> Txs => ImmutableList<ITransaction>.Empty;

public IReadOnlyList<EvidenceBase> Evidence => ImmutableList<EvidenceBase>.Empty;

public void UseGas(long gas)
{
}
Expand Down
7 changes: 5 additions & 2 deletions NineChronicles.Headless.Executable/Commands/ReplayCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,14 @@ public int RemoteTx(
var stateRootHash = HashDigest<SHA256>.FromString(block!.StateRootHash!);
var privateKey = new PrivateKey();
var blockMetadata = new BlockMetadata(
0, DateTimeOffset.Now, privateKey.PublicKey, null, null, null);
0, DateTimeOffset.Now, privateKey.PublicKey, null, null, null, null);
var blockContent = new BlockContent(blockMetadata);
var preEvaluationBlock = blockContent.Propose();
var b = preEvaluationBlock.Sign(privateKey, stateRootHash);
return new BlockDigest(b.Header, ImmutableArray<ImmutableArray<byte>>.Empty);
return new BlockDigest(
header: b.Header,
txIds: ImmutableArray<ImmutableArray<byte>>.Empty,
evidenceIds: ImmutableArray<ImmutableArray<byte>>.Empty);
}
};

Expand Down
3 changes: 2 additions & 1 deletion NineChronicles.Headless.Executable/Commands/StateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ IStateStore stateStore
throw new CommandExitedException($"The block of {blockHash} doesn't exist.", -1);
var preEvalBlock = new PreEvaluationBlock(
block,
block.Transactions
block.Transactions,
block.Evidence
);
stderr.WriteLine(
"[{0}/{1}] Executing block #{2} {3}...",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
<PackageReference Include="GraphQL.Client" Version="5.1.1" />
<PackageReference Include="GraphQL.Client.Serializer.SystemTextJson" Version="5.1.1" />
<PackageReference Include="Destructurama.Attributed" Version="2.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="Pyroscope" Version="0.8.14" />
<PackageReference Include="Pyroscope.OpenTelemetry" Version="0.2.0" />
<PackageReference Include="Sentry.Serilog" Version="3.23.0" />
<PackageReference Include="Sentry" Version="3.23.0" />
<PackageReference Include="Sentry.AspNetCore.Grpc" Version="3.22.0" />
Expand All @@ -42,10 +48,11 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lib9c\.Libplanet\Libplanet.Extensions.Cocona\Libplanet.Extensions.Cocona.csproj" />
<ProjectReference Include="..\Lib9c\.Libplanet\tools\Libplanet.Extensions.Cocona\Libplanet.Extensions.Cocona.csproj" />
<ProjectReference Include="..\Lib9c\Lib9c.Utils\Lib9c.Utils.csproj" />
<ProjectReference Include="..\Lib9c\Lib9c.Abstractions\Lib9c.Abstractions.csproj" />
<ProjectReference Include="..\NineChronicles.Headless\NineChronicles.Headless.csproj" />
Expand Down
29 changes: 28 additions & 1 deletion NineChronicles.Headless.Executable/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
using OpenTelemetry;
using OpenTelemetry.Metrics;
using Nekoyume;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;

namespace NineChronicles.Headless.Executable
{
Expand Down Expand Up @@ -474,15 +476,40 @@ IActionLoader MakeSingleActionLoader()
MaxTransactionPerBlock = headlessConfig.MaxTransactionPerBlock
};
var arenaMemoryCache = new StateMemoryCache();
string otlpEndpoint = Environment.GetEnvironmentVariable("OTLP_ENDPOINT") ?? "http://localhost:4317";
hostBuilder.ConfigureServices(services =>
{
services.AddSingleton(_ => standaloneContext);
services.AddSingleton<ConcurrentDictionary<string, ITransaction>>();
services.AddOpenTelemetry()
.ConfigureResource(resource => resource.AddService(
serviceName: Assembly.GetEntryAssembly()?.GetName().Name ?? "NineChronicles.Headless",
serviceVersion: Assembly.GetEntryAssembly()?.GetName().Version?.ToString(),
serviceInstanceId: Environment.MachineName
).AddAttributes(new Dictionary<string, object>
{
{ "deployment.environment", Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Unknown" },
}))
.WithMetrics(
builder => builder
.AddMeter("NineChronicles")
.AddPrometheusExporter());
.AddMeter("MagicOnion.Server")
.AddAspNetCoreInstrumentation()
.AddRuntimeInstrumentation()
.AddPrometheusExporter())
.WithTracing(
builder => builder
.AddSource("Lib9c.Action.HackAndSlash")
.AddSource("Libplanet.Action.State")
.AddSource("Libplanet.Blockchain.BlockChainStates")
//.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddProcessor(new Pyroscope.OpenTelemetry.PyroscopeSpanProcessor())
.AddOtlpExporter(opt =>
{
opt.Endpoint = new Uri(otlpEndpoint, UriKind.Absolute);
})
);
// worker
if (arenaParticipantsSync)
Expand Down
Loading

0 comments on commit 8f4762d

Please sign in to comment.