Skip to content

Commit

Permalink
Merge pull request #2665 from planetarium/release/230
Browse files Browse the repository at this point in the history
Release/230 to main
  • Loading branch information
Atralupus authored Dec 19, 2024
2 parents 23e9524 + 36e4b3f commit 1d4b93a
Show file tree
Hide file tree
Showing 34 changed files with 482 additions and 1,465 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/push_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ jobs:
--password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}'
- name: push git tagged version
run: |
docker pull ${{ matrix.docker.repo }}:git-${{ github.sha }}
if [[ -z "${{ github.event.inputs.imageTag }}" ]]; then
export IMAGE_TAG=${{ github.ref_name }}
else
export IMAGE_TAG=${{ github.event.inputs.imageTag }}
fi
docker tag \
${{ matrix.docker.repo }}:git-${{ github.sha }} \
${{ matrix.docker.repo }}:$IMAGE_TAG
docker push ${{ matrix.docker.repo }}:$IMAGE_TAG
docker buildx imagetools create \
--progress=plain \
--tag ${{ matrix.docker.repo }}:$IMAGE_TAG \
${{ matrix.docker.repo }}:git-${{ github.sha }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<LibplanetVersion>5.4.1</LibplanetVersion>
<LibplanetVersion>5.4.2</LibplanetVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Lib9c
Submodule Lib9c updated 110 files
2 changes: 1 addition & 1 deletion Libplanet.Headless/Hosting/LibplanetNodeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ IActionEvaluator BuildActionEvaluator(IActionEvaluatorConfiguration actionEvalua
ConsensusPrivateKey = Properties.ConsensusPrivateKey,
ConsensusWorkers = 500,
TargetBlockInterval = TimeSpan.FromMilliseconds(Properties.ConsensusTargetBlockIntervalMilliseconds ?? 7000),
ContextTimeoutOptions = Properties.ContextTimeoutOption,
ContextOption = Properties.ContextOption,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class LibplanetNodeServiceProperties

public TimeSpan TipTimeout { get; set; } = TimeSpan.FromSeconds(60);

public ContextTimeoutOption ContextTimeoutOption { get; set; }
public ContextOption ContextOption { get; set; }

public int DemandBuffer { get; set; } = 1150;

Expand Down
22 changes: 0 additions & 22 deletions NineChronicles.Headless.Executable.sln
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ 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}") = "NineChronicles.Headless.Executor", "NineChronicles.Headless.Executor\NineChronicles.Headless.Executor.csproj", "{59AD477A-B23C-4E0B-AA26-A528B3BC5234}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -463,30 +461,10 @@ Global
{3D32DA34-E619-429F-8421-848FF4F14417}.Release|x64.Build.0 = Release|Any CPU
{3D32DA34-E619-429F-8421-848FF4F14417}.Release|x86.ActiveCfg = Release|Any CPU
{3D32DA34-E619-429F-8421-848FF4F14417}.Release|x86.Build.0 = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|x64.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|x64.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|x86.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Debug|x86.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|Any CPU.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|Any CPU.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|x64.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|x64.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|x86.ActiveCfg = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.DevEx|x86.Build.0 = Debug|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|Any CPU.Build.0 = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|x64.ActiveCfg = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|x64.Build.0 = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|x86.ActiveCfg = Release|Any CPU
{59AD477A-B23C-4E0B-AA26-A528B3BC5234}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B4A2DD82-CCC1-4D74-88FF-91BBEBB5A47F}
EndGlobalSection
Expand Down
8 changes: 6 additions & 2 deletions NineChronicles.Headless.Executable.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_NEW_PARENTHESES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BETWEEN_ATTRIBUTE_SECTIONS/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">300</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/PreferQualifiedReference/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AllowAlias/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/CanUseGlobalAlias/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/PreferQualifiedReference/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/SortUsingsWithSystemFirst/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AI/@EntryIndexedValue">AI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CRYSTAL/@EntryIndexedValue">CRYSTAL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GARAGE/@EntryIndexedValue">GARAGE</s:String>
Expand Down
9 changes: 6 additions & 3 deletions NineChronicles.Headless.Executable/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public class Configuration
public string[]? ConsensusSeedStrings { get; set; }
public ushort? ConsensusPort { get; set; }
public double? ConsensusTargetBlockIntervalMilliseconds { get; set; }
public int? ConsensusProposeSecondBase { get; set; }
public int? ConsensusProposeTimeoutBase { get; set; }
public int? ConsensusEnterPreCommitDelay { get; set; }

public int? MaxTransactionPerBlock { get; set; }

Expand Down Expand Up @@ -139,7 +140,8 @@ public void Overwrite(
string? consensusPrivateKeyString,
string[]? consensusSeedStrings,
double? consensusTargetBlockIntervalMilliseconds,
int? consensusProposeSecondBase,
int? consensusProposeTimeoutBase,
int? consensusEnterPreCommitDelay,
int? maxTransactionPerBlock,
bool? remoteKeyValueService
)
Expand Down Expand Up @@ -190,7 +192,8 @@ public void Overwrite(
ConsensusSeedStrings = consensusSeedStrings ?? ConsensusSeedStrings;
ConsensusPrivateKeyString = consensusPrivateKeyString ?? ConsensusPrivateKeyString;
ConsensusTargetBlockIntervalMilliseconds = consensusTargetBlockIntervalMilliseconds ?? ConsensusTargetBlockIntervalMilliseconds;
ConsensusProposeSecondBase = consensusProposeSecondBase ?? ConsensusProposeSecondBase;
ConsensusProposeTimeoutBase = consensusProposeTimeoutBase ?? ConsensusProposeTimeoutBase;
ConsensusEnterPreCommitDelay = consensusEnterPreCommitDelay ?? ConsensusEnterPreCommitDelay;
MaxTransactionPerBlock = maxTransactionPerBlock ?? MaxTransactionPerBlock;
RemoteKeyValueService = remoteKeyValueService ?? RemoteKeyValueService;
}
Expand Down
66 changes: 55 additions & 11 deletions NineChronicles.Headless.Executable/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ public async Task Run(
[Option("consensus-propose-second-base",
Description = "A propose second base for consensus context timeout. The unit is second.")]
int? consensusProposeSecondBase = null,
[Option("consensus-enter-precommit-delay",
Description = "A precommit delay manually set. The unit is millisecond.")]
int? consensusEnterPreCommitDelay = null,
[Option("maximum-transaction-per-block",
Description = "Maximum transactions allowed in a block. null by default.")]
int? maxTransactionPerBlock = null,
Expand Down Expand Up @@ -290,16 +293,55 @@ public async Task Run(
GetActionEvaluatorConfiguration(configuration.GetSection("Headless").GetSection("ActionEvaluator"));

headlessConfig.Overwrite(
appProtocolVersionToken, trustedAppProtocolVersionSigners, genesisBlockPath, host, port,
swarmPrivateKeyString, storeType, storePath, noReduceStore, noMiner, minerCount,
minerPrivateKeyString, minerBlockIntervalMilliseconds, planet, iceServerStrings, peerStrings, rpcServer, rpcListenHost,
rpcListenPort, rpcRemoteServer, rpcHttpServer, graphQLServer, graphQLHost, graphQLPort,
graphQLSecretTokenPath, noCors, nonblockRenderer, nonblockRendererQueue, strictRendering,
logActionRenders, confirmations,
txLifeTime, messageTimeout, tipTimeout, demandBuffer, skipPreload,
minimumBroadcastTarget, bucketSize, chainTipStaleBehaviorType, txQuotaPerSigner, maximumPollPeers,
consensusPort, consensusPrivateKeyString, consensusSeedStrings, consensusTargetBlockIntervalMilliseconds, consensusProposeSecondBase,
maxTransactionPerBlock, remoteKeyValueService
appProtocolVersionToken,
trustedAppProtocolVersionSigners,
genesisBlockPath,
host,
port,
swarmPrivateKeyString,
storeType,
storePath,
noReduceStore,
noMiner,
minerCount,
minerPrivateKeyString,
minerBlockIntervalMilliseconds,
planet,
iceServerStrings,
peerStrings,
rpcServer,
rpcListenHost,
rpcListenPort,
rpcRemoteServer,
rpcHttpServer,
graphQLServer,
graphQLHost,
graphQLPort,
graphQLSecretTokenPath,
noCors,
nonblockRenderer,
nonblockRendererQueue,
strictRendering,
logActionRenders,
confirmations,
txLifeTime,
messageTimeout,
tipTimeout,
demandBuffer,
skipPreload,
minimumBroadcastTarget,
bucketSize,
chainTipStaleBehaviorType,
txQuotaPerSigner,
maximumPollPeers,
consensusPort,
consensusPrivateKeyString,
consensusSeedStrings,
consensusTargetBlockIntervalMilliseconds,
consensusProposeSecondBase * 1_000,
consensusEnterPreCommitDelay,
maxTransactionPerBlock,
remoteKeyValueService
);

// Clean-up previous temporary log files.
Expand Down Expand Up @@ -331,6 +373,7 @@ public async Task Run(
try
{
IHostBuilder hostBuilder = Host.CreateDefaultBuilder();
hostBuilder.ConfigureAppConfiguration(builder => builder.AddConfiguration(configuration));

var standaloneContext = new StandaloneContext
{
Expand Down Expand Up @@ -366,7 +409,8 @@ public async Task Run(
consensusPrivateKeyString: headlessConfig.ConsensusPrivateKeyString,
consensusSeedStrings: headlessConfig.ConsensusSeedStrings,
consensusTargetBlockIntervalMilliseconds: headlessConfig.ConsensusTargetBlockIntervalMilliseconds,
consensusProposeSecondBase: headlessConfig.ConsensusProposeSecondBase,
consensusProposeTimeoutBase: headlessConfig.ConsensusProposeTimeoutBase,
consensusEnterPreCommitDelay: headlessConfig.ConsensusEnterPreCommitDelay,
maximumPollPeers: headlessConfig.MaximumPollPeers,
actionEvaluatorConfiguration: actionEvaluatorConfiguration
);
Expand Down
6 changes: 6 additions & 0 deletions NineChronicles.Headless.Executable/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
"Endpoint": "*:/graphql/stagetransaction",
"Period": "60s",
"Limit": 12
},
{
"Endpoint": "*:/graphql/transactionresults",
"Period": "60s",
"Limit": 60
}
],
"QuotaExceededResponse": {
Expand All @@ -117,6 +122,7 @@
"StatusCode": 429
},
"IpBanThresholdCount": 5,
"TransactionResultsBanThresholdCount": 100,
"IpBanMinute" : 60,
"IpBanResponse": {
"Content": "{ \"message\": \"Your Ip has been banned.\" }",
Expand Down
141 changes: 0 additions & 141 deletions NineChronicles.Headless.Executor/Client/GithubClient.cs

This file was deleted.

Loading

0 comments on commit 1d4b93a

Please sign in to comment.