Skip to content

Commit

Permalink
Merge pull request #3315 from AElfProject/v1.2.0-rc
Browse files Browse the repository at this point in the history
v1.2.0 release candidate
  • Loading branch information
eanzhao authored Jun 7, 2022
2 parents a1ca6ab + 53a3ecd commit e7376fc
Show file tree
Hide file tree
Showing 2,049 changed files with 133,227 additions and 127,889 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: csharp
sudo: required
mono: none
dotnet: 3.1.102
dotnet: 6.0.300
dist: xenial
os:
- linux
Expand Down
1,256 changes: 1,256 additions & 0 deletions AElf.All.sln

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions AElf.Contracts.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "contract", "contract", "{651F0F6E-86CF-42D2-9110-5F3EAE5704F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{26990847-E0A2-4FCC-8C71-267CA77557CD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{51CE1A9E-63A0-49C6-B820-C8519C94F389}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
EndGlobal
1,736 changes: 652 additions & 1,084 deletions AElf.sln

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions AElf.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JS/@EntryIndexedValue">JS</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=aelf/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="src\AElf.ContractDeployer\AElf.ContractDeployer.targets" />
<Import Project="AElf.ContractTools.targets" />
<Import Project="src\AElf.ContractDeployer\AElf.ContractDeployer.targets"/>
<Import Project="AElf.ContractTools.targets"/>
</Project>
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 3.1.102
- script: choco install protoc --version=3.11.4 -y
version: 6.0.x
- script: choco install protoc --version=3.19.4 -y
displayName: 'Install protobuf'
- script: choco install unzip
displayName: 'Install unzip'
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 3.1.102
version: 6.0.x
- script: bash scripts/install_protobuf.sh
- script: bash scripts/download_binary.sh
- script: bash build.sh -target=Test-with-Codecov-N --parts=3 --n=2
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 3.1.102
version: 6.0.x
- script: bash scripts/install_protobuf.sh
- script: bash scripts/download_binary.sh
- script: bash build.sh -target=Test-with-Codecov-N --parts=3 --n=3
Expand All @@ -99,4 +99,4 @@ jobs:
reporttypes: 'Cobertura'
assemblyfilters: '-xunit*'
- script: bash build.sh -target=Upload-Coverage-Azure
displayName: 'Upload data to Codecov'
displayName: 'Upload data to Codecov'
6 changes: 3 additions & 3 deletions bench/AElf.BenchBase/AElf.BenchBase.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pro.NBench.xUnit" Version="2.0.0" />
<PackageReference Include="Pro.NBench.xUnit" Version="2.0.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\test\AElf.TestBase\AElf.TestBase.csproj" />
<ProjectReference Include="..\..\test\AElf.TestBase\AElf.TestBase.csproj"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion bench/AElf.BenchBase/Assembly.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using Xunit;

[assembly: CollectionBehavior(DisableTestParallelization = true)]
[assembly: CollectionBehavior(DisableTestParallelization = true)]
27 changes: 12 additions & 15 deletions bench/AElf.BenchBase/BenchBaseAElfModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
using AElf.TestBase;
using Volo.Abp.Modularity;

namespace AElf.BenchBase
namespace AElf.BenchBase;

[DependsOn(typeof(TestBaseAElfModule))]
public class BenchBaseAElfModule : AElfModule
{
}

public class BenchBaseTest<TModule> : AElfIntegratedTest<TModule>
where TModule : IAbpModule
{
[DependsOn(typeof(TestBaseAElfModule))]
public class BenchBaseAElfModule : AElfModule
{

}

public class BenchBaseTest<TModule> : AElfIntegratedTest<TModule>
where TModule: IAbpModule
{
}
}

public class BenchBaseTest : AElfIntegratedTest<TestBaseAElfModule>
{

}
public class BenchBaseTest : AElfIntegratedTest<TestBaseAElfModule>
{
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<SkipAudit>true</SkipAudit>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
using System;
using Google.Protobuf.WellKnownTypes;

namespace AElf.Benchmark.PerformanceTestContract
namespace AElf.Benchmark.PerformanceTestContract;

public class PerformanceTestContract : PerformanceTestContractContainer.PerformanceTestContractBase
{
public class PerformanceTestContract : PerformanceTestContractContainer.PerformanceTestContractBase
public override UInt64Value Fibonacci(UInt64Value input)
{
public override UInt64Value Fibonacci(UInt64Value input)
{
var result = CalculateFibonacci(input.Value);
return new UInt64Value {Value = result};
}
var result = CalculateFibonacci(input.Value);
return new UInt64Value { Value = result };
}

private ulong CalculateFibonacci(ulong n)
{
if (n == 0 || n == 1)
return n;
return CalculateFibonacci(n - 1) + CalculateFibonacci(n - 2);
}
private ulong CalculateFibonacci(ulong n)
{
if (n == 0 || n == 1)
return n;
return CalculateFibonacci(n - 1) + CalculateFibonacci(n - 2);
}

public override Int32Value LoopExpNop(PerformanceTesteInput input)
public override Int32Value LoopExpNop(PerformanceTesteInput input)
{
for (uint i = 0; i < input.N; i++)
{
for (uint i = 0; i < input.N; i++)
{

}

return new Int32Value {Value = input.Seed};
}

public override DoubleValue LoopDivAdd(DivAddTestInput input)
{
var r = input.X;
for (uint i = 0; i < input.N; i++)
{
r /= input.Y;
r += input.K;
}
return new Int32Value { Value = input.Seed };
}

return new DoubleValue {Value = r};
public override DoubleValue LoopDivAdd(DivAddTestInput input)
{
var r = input.X;
for (uint i = 0; i < input.N; i++)
{
r /= input.Y;
r += input.K;
}

return new DoubleValue { Value = r };
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using AElf.Sdk.CSharp.State;

namespace AElf.Benchmark.PerformanceTestContract
namespace AElf.Benchmark.PerformanceTestContract;

public class PerformanceTestContractState : ContractState
{
public class PerformanceTestContractState: ContractState
{

}
}
16 changes: 8 additions & 8 deletions bench/AElf.Benchmark/AElf.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<!-- <NoWarn>0436</NoWarn>-->
<!-- <NoWarn>0436</NoWarn>-->
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.1"/>
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\test\AElf.OS.Core.Tests\AElf.OS.Core.Tests.csproj" />
<ProjectReference Include="..\..\src\AElf.Kernel.SmartContract.Parallel\AElf.Kernel.SmartContract.Parallel.csproj" />
<ProjectReference Include="..\AElf.Benchmark.PerformanceTestContract\AElf.Benchmark.PerformanceTestContract.csproj" />
<ProjectReference Include="..\..\test\AElf.OS.Core.Tests\AElf.OS.Core.Tests.csproj"/>
<ProjectReference Include="..\..\src\AElf.Kernel.SmartContract.Parallel\AElf.Kernel.SmartContract.Parallel.csproj"/>
<ProjectReference Include="..\AElf.Benchmark.PerformanceTestContract\AElf.Benchmark.PerformanceTestContract.csproj"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\contract\AElf.Contracts.Genesis\AElf.Contracts.Genesis.csproj" />
<ProjectReference Include="..\..\contract\AElf.Contracts.Genesis\AElf.Contracts.Genesis.csproj"/>
<ProjectReference Include="..\..\contract\AElf.Contracts.Consensus.AEDPoS\AElf.Contracts.Consensus.AEDPoS.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Contract</OutputItemType>
Expand Down
77 changes: 38 additions & 39 deletions bench/AElf.Benchmark/BenchmarkAElfModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,62 @@
using AElf.Kernel.Account.Infrastructure;
using AElf.Kernel.Consensus.Application;
using AElf.Kernel.SmartContract;
using AElf.Kernel.SmartContract.Parallel;
using AElf.Modularity;
using AElf.OS;
using AElf.Kernel.SmartContract.Parallel;
using AElf.OS.Network.Infrastructure;
using AElf.Runtime.CSharp;
using Microsoft.Extensions.DependencyInjection;
using Moq;
using Volo.Abp;
using Volo.Abp.Modularity;

namespace AElf.Benchmark
namespace AElf.Benchmark;

[DependsOn(
typeof(OSCoreWithChainTestAElfModule)
)]
public class BenchmarkAElfModule : AElfModule
{
[DependsOn(
typeof(OSCoreWithChainTestAElfModule)
)]
public class BenchmarkAElfModule : AElfModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}
}

[DependsOn(
typeof(CoreOSAElfModule),
typeof(KernelAElfModule),
typeof(CSharpRuntimeAElfModule),
typeof(TestBaseKernelAElfModule)
)]
public class MiningBenchmarkAElfModule : AElfModule
[DependsOn(
typeof(CoreOSAElfModule),
typeof(KernelAElfModule),
typeof(CSharpRuntimeAElfModule),
typeof(TestBaseKernelAElfModule)
)]
public class MiningBenchmarkAElfModule : AElfModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
context.Services.AddSingleton(o => Mock.Of<IAElfNetworkServer>());
context.Services.AddTransient<AccountService>();
context.Services.AddTransient(o => Mock.Of<IConsensusService>());
// Configure<TransactionOptions>(options => options.EnableTransactionExecutionValidation = false);
Configure<HostSmartContractBridgeContextOptions>(options =>
{
context.Services.AddSingleton(o => Mock.Of<IAElfNetworkServer>());
context.Services.AddTransient<AccountService>();
context.Services.AddTransient(o => Mock.Of<IConsensusService>());
// Configure<TransactionOptions>(options => options.EnableTransactionExecutionValidation = false);
Configure<HostSmartContractBridgeContextOptions>(options =>
{
options.ContextVariables[ContextVariableDictionary.NativeSymbolName] = "ELF";
});
}
options.ContextVariables[ContextVariableDictionary.NativeSymbolName] = "ELF";
});
}

public override void OnPreApplicationInitialization(ApplicationInitializationContext context)
{
var keyPairProvider = context.ServiceProvider.GetRequiredService<IAElfAsymmetricCipherKeyPairProvider>();
keyPairProvider.SetKeyPair(CryptoHelper.GenerateKeyPair());
}
public override void OnPreApplicationInitialization(ApplicationInitializationContext context)
{
var keyPairProvider = context.ServiceProvider.GetRequiredService<IAElfAsymmetricCipherKeyPairProvider>();
keyPairProvider.SetKeyPair(CryptoHelper.GenerateKeyPair());
}
}

[DependsOn(
typeof(OSCoreWithChainTestAElfModule),
typeof(ParallelExecutionModule)
)]
public class BenchmarkParallelAElfModule : AElfModule
[DependsOn(
typeof(OSCoreWithChainTestAElfModule),
typeof(ParallelExecutionModule)
)]
public class BenchmarkParallelAElfModule : AElfModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}
}
Loading

0 comments on commit e7376fc

Please sign in to comment.