Skip to content

Commit 3c3ff03

Browse files
committed
Merge branch 'fix/uint160-class' of https://github.com/cschuchardt88/neo into fix/uint160-class
2 parents 950555b + 4be0af1 commit 3c3ff03

File tree

24 files changed

+75
-66
lines changed

24 files changed

+75
-66
lines changed

src/Neo.CLI/CLI/MainService.Blockchain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void OnShowBlockCommand(string indexOrHash)
8282
ConsoleHelper.Info("", " PrevHash: ", $"{block.PrevHash}");
8383
ConsoleHelper.Info("", " NextConsensus: ", $"{block.NextConsensus}");
8484
ConsoleHelper.Info("", " PrimaryIndex: ", $"{block.PrimaryIndex}");
85-
ConsoleHelper.Info("", " PrimaryPubKey: ", $"{NativeContract.NEO.GetCommittee(NeoSystem.GetSnapshot())[block.PrimaryIndex]}");
85+
ConsoleHelper.Info("", " PrimaryPubKey: ", $"{NativeContract.NEO.GetCommittee(NeoSystem.GetSnapshotCache())[block.PrimaryIndex]}");
8686
ConsoleHelper.Info("", " Version: ", $"{block.Version}");
8787
ConsoleHelper.Info("", " Size: ", $"{block.Size} Byte(s)");
8888
ConsoleHelper.Info();

src/Neo.CLI/config.fs.mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"MillisecondsPerBlock": 15000,
3434
"MaxTransactionsPerBlock": 512,
3535
"MemoryPoolMaxTransactions": 50000,
36-
"MaxTraceableBlocks": 2102400,
36+
"MaxTraceableBlocks": 17280,
3737
"InitialGasDistribution": 5200000000000000,
3838
"ValidatorsCount": 7,
3939
"Hardforks": {

src/Neo.CLI/config.fs.testnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"MillisecondsPerBlock": 15000,
3434
"MaxTransactionsPerBlock": 512,
3535
"MemoryPoolMaxTransactions": 50000,
36-
"MaxTraceableBlocks": 2102400,
36+
"MaxTraceableBlocks": 17280,
3737
"InitialGasDistribution": 5200000000000000,
3838
"ValidatorsCount": 7,
3939
"StandbyCommittee": [

src/Neo.Extensions/Neo.Extensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Akka" Version="1.5.20" />
12+
<PackageReference Include="Akka" Version="1.5.26" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/Neo/Neo.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Akka" Version="1.5.20" />
12+
<PackageReference Include="Akka" Version="1.5.26" />
1313
<PackageReference Include="BouncyCastle.NetCore" Version="2.2.1" />
1414
<PackageReference Include="K4os.Compression.LZ4" Version="1.3.8" />
1515
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
1616
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
17-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
17+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
1818
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
1919
</ItemGroup>
2020

src/Plugins/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,20 @@ public ExtensiblePayload MakePrepareResponse()
166166
});
167167
}
168168

169+
// Related to issue https://github.com/neo-project/neo/issues/3431
170+
// Ref. https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.randomnumbergenerator?view=net-8.0
171+
//
172+
//The System.Random class relies on a seed value that can be predictable,
173+
//especially if the seed is based on the system clock or other low-entropy sources.
174+
//RandomNumberGenerator, however, uses sources of entropy provided by the operating
175+
//system, which are designed to be unpredictable.
169176
private static ulong GetNonce()
170177
{
171-
Random _random = new();
172178
Span<byte> buffer = stackalloc byte[8];
173-
_random.NextBytes(buffer);
179+
using (var rng = System.Security.Cryptography.RandomNumberGenerator.Create())
180+
{
181+
rng.GetBytes(buffer);
182+
}
174183
return BinaryPrimitives.ReadUInt64LittleEndian(buffer);
175184
}
176185
}

src/Plugins/OracleService/OracleService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public JObject SubmitOracleResponse(JArray _params)
234234

235235
finishedCache.ContainsKey(requestId).False_Or(RpcError.OracleRequestFinished);
236236

237-
using (var snapshot = _system.GetSnapshot())
237+
using (var snapshot = _system.GetSnapshotCache())
238238
{
239239
uint height = NativeContract.Ledger.CurrentIndex(snapshot) + 1;
240240
var oracles = NativeContract.RoleManagement.GetDesignatedByRole(snapshot, Role.Oracle, height);
@@ -326,7 +326,7 @@ private async void ProcessRequestsAsync()
326326
{
327327
while (!cancelSource.IsCancellationRequested)
328328
{
329-
using (var snapshot = _system.GetSnapshot())
329+
using (var snapshot = _system.GetSnapshotCache())
330330
{
331331
SyncPendingQueue(snapshot);
332332
foreach (var (id, request) in NativeContract.Oracle.GetRequests(snapshot))

src/Plugins/RocksDBStore/RocksDBStore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="rocksdb" Version="8.11.3.46984" />
11+
<PackageReference Include="rocksdb" Version="9.4.0.50294" />
1212
</ItemGroup>
1313

1414
</Project>

src/Plugins/RpcServer/RpcServer.Wallet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected virtual JToken GetWalletUnclaimedGas(JArray _params)
9797
CheckWallet();
9898
// Datoshi is the smallest unit of GAS, 1 GAS = 10^8 Datoshi
9999
BigInteger datoshi = BigInteger.Zero;
100-
using (var snapshot = system.GetSnapshot())
100+
using (var snapshot = system.GetSnapshotCache())
101101
{
102102
uint height = NativeContract.Ledger.CurrentIndex(snapshot) + 1;
103103
foreach (UInt160 account in wallet.GetAccounts().Select(p => p.ScriptHash))

src/Plugins/SQLiteWallet/SQLiteWallet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.5" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
1313
</ItemGroup>
1414

1515
</Project>

0 commit comments

Comments
 (0)