Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the release PR for aelf project version 1.12.0 #3630

Merged
merged 100 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
955096c
Add whitelist solution
chopin-fan Sep 3, 2024
47595fc
Resolve issue of compilation and running, and add unit-test
chopin-fan Sep 3, 2024
53f389c
Revert appsettings.json
chopin-fan Sep 4, 2024
a57f39e
feat(zkp): Add methods required for supporting zkp verification over …
gldeng Sep 4, 2024
b66e60c
Change version to 8.0.402 in sonarqube.yaml
chopin-fan Sep 29, 2024
6469d74
Change version of sdk
chopin-fan Sep 29, 2024
00d0b6e
Change version of sdk
chopin-fan Sep 29, 2024
77e2d11
Add sources
chopin-fan Sep 29, 2024
7c9c674
Merge branch 'dev' into feature/whitelist-to-sdk
chopin-fan Sep 29, 2024
8838901
Merge branch 'dev' into feature/whitelist-to-sdk
chopin-fan Oct 3, 2024
0c5cf13
Change versions and add whitelist
chopin-fan Oct 8, 2024
8262cd9
Merge remote-tracking branch 'origin/feature/whitelist-to-sdk' into f…
chopin-fan Oct 8, 2024
4e5b3aa
Remove poseidon and groth16 in IWhitelistProvider.cs
chopin-fan Oct 8, 2024
aa43d7b
Add config for auto-publishing
chopin-fan Nov 7, 2024
534f24b
Now some of inline txs will have their own tx id via layered method n…
eanzhao Nov 9, 2024
46e54c5
Improve layered method name.
eanzhao Nov 9, 2024
be03fce
Put inline txs to block body.
eanzhao Nov 9, 2024
8291fb1
Fix block sync issue.
eanzhao Nov 11, 2024
1ac0435
1. Remove useless comments
chopin-fan Nov 12, 2024
0b3ab87
Cancel inline event log
chopin-fan Nov 12, 2024
8626f56
extend seed expiration time
JimAelf Nov 12, 2024
54fb07d
extend SEED expiration time
JimAelf Nov 13, 2024
1e7c987
transaction result status optimization, clear return the expired desc…
JimAelf Nov 13, 2024
8ec60e3
Fixed GetTransactionResultAsync: compare BestChainHeight with RefBloc…
eanzhao Nov 14, 2024
daaec05
optimize the result of transaction result
JimAelf Nov 14, 2024
1ad4d46
support zk
chopin-fan Nov 14, 2024
8c4234a
Resolve unit test issue
chopin-fan Nov 15, 2024
e1ccdb9
Resolve Verification Failure Issue
chopin-fan Nov 15, 2024
9df0b20
Resolve the difficulty of creating inline transactions by eventlog du…
chopin-fan Nov 15, 2024
5dd5ac8
Rename method name
chopin-fan Nov 15, 2024
6d433e5
Add unit-test for zk supporting
chopin-fan Nov 18, 2024
c876944
Clean up unused code and optimize the code
chopin-fan Nov 18, 2024
60b637d
Update the sdk version
chopin-fan Nov 18, 2024
d416275
Temporarily remove the unit test; it will be added back later
chopin-fan Nov 19, 2024
8299f35
Temporarily remove the unit test; it will be added back later
chopin-fan Nov 19, 2024
3067232
Modify config in azure-pipelines.yml
chopin-fan Nov 19, 2024
69ec7e8
Modify config in azure-pipelines.yml
chopin-fan Nov 19, 2024
c045573
set a the Error message to the output to infer that the transaction w…
JimAelf Nov 19, 2024
18763ee
Modify config in azure-pipelines.yml
chopin-fan Nov 19, 2024
52efae9
set a the Error message to the output to infer that the transaction w…
JimAelf Nov 19, 2024
de45a0f
set a the Error message to the output to infer that the transaction w…
JimAelf Nov 19, 2024
60cb378
If transaction satus is "NOT_EXIST", and the lag of the refblock is b…
JimAelf Nov 19, 2024
1b7c212
handle the Sonar build problem
JimAelf Nov 19, 2024
c53dbf7
handle the Sonar build problem
JimAelf Nov 19, 2024
af79e90
Fix tx expired error message.
eanzhao Nov 20, 2024
1404c3e
Add new event: SeedExpirationTimeUpdated
eanzhao Nov 20, 2024
d1a71ef
CallCount revert to 15000
chopin-fan Nov 23, 2024
6ea81f8
Merge pull request #3621 from AElfProject/feature/transaction-result-…
JimAelf Nov 25, 2024
e617a69
The Status is obsolete. Use StatusV2 instead
JimAelf Nov 25, 2024
d1658fd
The Status is obsolete. Use StatusV2 instead
JimAelf Nov 25, 2024
0f4b2c4
The Status is obsolete in this version. Use StatusV2 instead
JimAelf Nov 25, 2024
f16179d
Merge branch 'dev' into feature/inline-tx-id
chopin-fan Nov 25, 2024
b3a138c
Add unit-test for cross-aa
chopin-fan Nov 26, 2024
b498ff5
Add unit test
chopin-fan Nov 26, 2024
c84faaa
Remove unused unit test
chopin-fan Nov 26, 2024
cec89b7
unit test done
JimAelf Nov 26, 2024
2e1522e
unit test done
JimAelf Nov 26, 2024
85e9efd
Merge pull request #3620 from AElfProject/feature/inline-tx-id
JimAelf Nov 26, 2024
67ea4aa
Tune Get_TransactionResultV2_Expired_Testf and fixed tx.statusv2 issues.
eanzhao Nov 27, 2024
39398fa
Will return new status if pending txs already expired.
eanzhao Nov 27, 2024
d594e53
Merge branch 'dev' into feature/whitelist-to-sdk
chopin-fan Nov 27, 2024
f21fc2d
Merge pull request #3625 from AElfProject/feature/transaction-result-…
JimAelf Dec 3, 2024
9d567e4
Merge pull request #3624 from AElfProject/feature/extend-seed-expirat…
JimAelf Dec 3, 2024
4926267
Merge pull request #3626 from AElfProject/dev
JimAelf Dec 4, 2024
c4a291c
TransactionResult optimization, add a new method GetTransactionResult…
JimAelf Dec 4, 2024
dc42b74
Merge pull request #3627 from AElfProject/feature/transaction-result-…
JimAelf Dec 4, 2024
a74faf0
Remove inline transaction modification because of the early publishme…
JimAelf Dec 5, 2024
2a62de2
update StatusV2 to StatusWithBVP
JimAelf Dec 7, 2024
187d3ed
Merge pull request #3628 from AElfProject/feature/transaction-result-…
JimAelf Dec 7, 2024
d38683f
Remove publish config in main and side project
chopin-fan Dec 12, 2024
187a4c5
Merge branch 'dev' into feature/whitelist-to-sdk
chopin-fan Dec 12, 2024
29143a2
token contract add inline transaction modification
JimAelf Dec 14, 2024
94abd2a
Merge branch 'dev' into feature/whitelist-to-sdk
chopin-fan Dec 14, 2024
71c5095
Merge pull request #3614 from AElfProject/feature/whitelist-to-sdk
JimAelf Dec 14, 2024
6008ea5
Revert code
chopin-fan Dec 17, 2024
77ed70a
try to skip issue that node can not produce
chopin-fan Dec 18, 2024
3340791
Remove TriggerConsensusEventAsync
chopin-fan Dec 18, 2024
a584079
Add TriggerConsensusEventAsync for image
chopin-fan Dec 18, 2024
6bf28b9
remove TriggerConsensusEventAsync
chopin-fan Dec 18, 2024
745b326
add TriggerConsensusEventAsync
chopin-fan Dec 18, 2024
3222d1c
Add log
chopin-fan Dec 18, 2024
c522ab9
Add log
chopin-fan Dec 19, 2024
692c6b2
1. Remove log and resolve issue
chopin-fan Dec 19, 2024
b8fb0d8
Remove unused code
chopin-fan Dec 20, 2024
586a98a
Remove cross-aa code
chopin-fan Dec 23, 2024
ff58f36
Adjust the implementation of zk function
chopin-fan Dec 24, 2024
4d02f27
Adjust implementation of ZK function
chopin-fan Dec 25, 2024
230fceb
Adjust impletation of zk function
chopin-fan Dec 26, 2024
c124761
Adjust to static method
chopin-fan Dec 27, 2024
a2ef9a6
Add WhitelistCryptographyHelpers whitelist method
chopin-fan Dec 27, 2024
c752104
Adjust zk code
chopin-fan Dec 29, 2024
3383c90
remove priveteAssets
chopin-fan Dec 30, 2024
ee4801f
adjust version of Nethereum.Web3
chopin-fan Dec 30, 2024
a2e3579
remove unused code
chopin-fan Dec 30, 2024
7b1eb9b
Add unit test
chopin-fan Jan 1, 2025
b4804c6
Merge branch 'master' into release/1.12.2
chopin-fan Jan 1, 2025
99e57c9
Change method name to TransactionResultWithBVP
chopin-fan Jan 2, 2025
453d96b
Merge remote-tracking branch 'origin/release/1.12.2' into release/1.12.2
chopin-fan Jan 2, 2025
03ede96
Remove inline_transaction.proto
chopin-fan Jan 3, 2025
3688493
Remove poseidong
chopin-fan Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ private void WhitelistAElfTypes(Whitelist whitelist)
// Selectively allowed types and members
.Namespace("AElf.Cryptography.SecretSharing", Permission.Denied, type => type
.Type(typeof(SecretSharingHelper), Permission.Denied, member => member
.Member(nameof(SecretSharingHelper.DecodeSecret), Permission.Allowed)));
.Member(nameof(SecretSharingHelper.DecodeSecret), Permission.Allowed)
.Member(nameof(SecretSharingHelper.Ed25519Verify), Permission.Allowed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new helper,not SecretSharingHelper

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new helper,not SecretSharingHelper
new helpers has been added

.Member(nameof(SecretSharingHelper.Keccak256), Permission.Allowed)
.Member(nameof(SecretSharingHelper.Bn254G1Mul), Permission.Allowed)
.Member(nameof(SecretSharingHelper.Bn254Pairing), Permission.Allowed)

));
}
}
9 changes: 9 additions & 0 deletions src/AElf.Cryptography/AElf.Cryptography.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
<PackageReference Include="Secp256k1.Net" Version="1.2.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="Secp256k1.Native" Version="0.1.24-alpha" />
<PackageReference Include="Bn254.Net" Version="0.1.0" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Rebex.Elliptic.Ed25519" Version="1.2.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Nethereum.Web3" Version="4.21.4">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AElf.Types\AElf.Types.csproj" />
Expand Down
48 changes: 48 additions & 0 deletions src/AElf.Cryptography/SecretSharing/SecretSharingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Bn254.Net;
using Nethereum.Util;

namespace AElf.Cryptography.SecretSharing
{
Expand All @@ -11,6 +13,52 @@
/// </summary>
public static class SecretSharingHelper
{
public static bool Ed25519Verify(byte[] signature, byte[] message, byte[] publicKey)
{
try
{
var instance = new Rebex.Security.Cryptography.Ed25519();
instance.FromPublicKey(publicKey);
return instance.VerifyMessage(message, signature);
}
catch (Exception e)

Check warning on line 24 in src/AElf.Cryptography/SecretSharing/SecretSharingHelper.cs

View workflow job for this annotation

GitHub Actions / static-code-analysis

The variable 'e' is declared but never used
{
return false;
}
}

public static byte[] Keccak256(byte[] message)
{
return Sha3Keccack.Current.CalculateHash(message);
}

public static (byte[] x, byte[] y) Bn254G1Mul(byte[] x1, byte[] y1, byte[] s)
{
var (xUInt256, yUInt256) = Bn254.Net.Bn254.Mul(UInt256.FromBigEndianBytes(x1), UInt256.FromBigEndianBytes(y1),
UInt256.FromBigEndianBytes(s));
return (xUInt256.ToBigEndianBytes(), yUInt256.ToBigEndianBytes());
}

public static (byte[] x3, byte[] y3) Bn254G1Mul(byte[] x1, byte[] y1, byte[] x2, byte[] y2)
{
var (x3UInt256, y3UInt256) = Bn254.Net.Bn254.Add(UInt256.FromBigEndianBytes(x1), UInt256.FromBigEndianBytes(y1),
UInt256.FromBigEndianBytes(x2), UInt256.FromBigEndianBytes(y2));
return (x3UInt256.ToBigEndianBytes(), y3UInt256.ToBigEndianBytes());
}

public static bool Bn254Pairing((byte[], byte[], byte[], byte[], byte[], byte[])[] input)
{
var elements = new (UInt256, UInt256, UInt256, UInt256, UInt256, UInt256)[input.Length];
for (var i = 0; i < input.Length; i++)
{
var (x1, y1, x2, y2, x3, y3) = input[i];
elements[i] = (UInt256.FromBigEndianBytes(x1), UInt256.FromBigEndianBytes(y1),
UInt256.FromBigEndianBytes(x2), UInt256.FromBigEndianBytes(y2),
UInt256.FromBigEndianBytes(x3), UInt256.FromBigEndianBytes(y3));
}

return Bn254.Net.Bn254.Pairing(elements);
}
public static List<byte[]> EncodeSecret(byte[] secretMessage, int threshold, int totalParts)
{
// Polynomial construction.
Expand Down
6 changes: 3 additions & 3 deletions src/AElf.Runtime.CSharp/AElf.Runtime.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="Bn254.Net" Version="0.1.0" />
<PackageReference Include="Rebex.Elliptic.Ed25519" Version="1.2.1"/>
<PackageReference Include="Nethereum.Web3" Version="4.21.4"/>
<!-- <PackageReference Include="Bn254.Net" Version="0.1.0" />-->
<!-- <PackageReference Include="Rebex.Elliptic.Ed25519" Version="1.2.1"/>-->
<!-- <PackageReference Include="Nethereum.Web3" Version="4.21.4"/>-->
</ItemGroup>

<ItemGroup>
Expand Down
54 changes: 27 additions & 27 deletions src/AElf.Sdk.CSharp/CSharpSmartContractContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ namespace AElf.Sdk.CSharp;
/// base class for smart contracts (Context property). It provides access to properties and methods useful for
/// implementing the logic in smart contracts.
/// </summary>
public class CSharpSmartContractContext : ISmartContractBridgeContext, IBuiltIns
public class CSharpSmartContractContext : ISmartContractBridgeContext
{
private IBuiltIns BuiltInsImplementation { get; }
// private IBuiltIns BuiltInsImplementation { get; }

public CSharpSmartContractContext(ISmartContractBridgeContext smartContractBridgeContextImplementation)
{
SmartContractBridgeContextImplementation = smartContractBridgeContextImplementation;
BuiltInsImplementation = new InternalBuiltIns();
// BuiltInsImplementation = new InternalBuiltIns();
}

public ISmartContractBridgeContext SmartContractBridgeContextImplementation { get; }
Expand Down Expand Up @@ -402,28 +402,28 @@ public bool ECVrfVerify(byte[] pubKey, byte[] alpha, byte[] pi, out byte[] beta)
return SmartContractBridgeContextImplementation.ECVrfVerify(pubKey, alpha, pi, out beta);
}

public bool Ed25519Verify(byte[] signature, byte[] message, byte[] publicKey)
{
return BuiltInsImplementation.Ed25519Verify(signature, message, publicKey);
}

public byte[] Keccak256(byte[] message)
{
return BuiltInsImplementation.Keccak256(message);
}

public (byte[] x, byte[] y) Bn254G1Mul(byte[] x1, byte[] y1, byte[] s)
{
return BuiltInsImplementation.Bn254G1Mul(x1, y1, s);
}

public (byte[] x3, byte[] y3) Bn254G1Add(byte[] x1, byte[] y1, byte[] x2, byte[] y2)
{
return BuiltInsImplementation.Bn254G1Add(x1, y1, x2, y2);
}

public bool Bn254Pairing((byte[], byte[], byte[], byte[], byte[], byte[])[] input)
{
return BuiltInsImplementation.Bn254Pairing(input);
}
// public bool Ed25519Verify(byte[] signature, byte[] message, byte[] publicKey)
// {
// return BuiltInsImplementation.Ed25519Verify(signature, message, publicKey);
// }
//
// public byte[] Keccak256(byte[] message)
// {
// return BuiltInsImplementation.Keccak256(message);
// }
//
// public (byte[] x, byte[] y) Bn254G1Mul(byte[] x1, byte[] y1, byte[] s)
// {
// return BuiltInsImplementation.Bn254G1Mul(x1, y1, s);
// }
//
// public (byte[] x3, byte[] y3) Bn254G1Add(byte[] x1, byte[] y1, byte[] x2, byte[] y2)
// {
// return BuiltInsImplementation.Bn254G1Add(x1, y1, x2, y2);
// }
//
// public bool Bn254Pairing((byte[], byte[], byte[], byte[], byte[], byte[])[] input)
// {
// return BuiltInsImplementation.Bn254Pairing(input);
// }
}
Loading