Skip to content

Commit

Permalink
Merge branch 'pectra_devnet_4' into flat_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjnrohit committed Oct 15, 2024
2 parents 5bd0edf + 7c411aa commit 137f260
Show file tree
Hide file tree
Showing 323 changed files with 12,473 additions and 1,932 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build tools

on:
merge_group:
types: [checks_requested]
pull_request:
branches: [master]
push:
branches: [master]

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config: [release]
project:
- DocGen/DocGen.sln
- HiveCompare/HiveCompare.sln
- HiveConsensusWorkflowGenerator/HiveConsensusWorkflowGenerator.csproj
- Nethermind.Tools.Kute/Nethermind.Tools.Kute.csproj
- SendBlobs/SendBlobs.sln
- TxParser/TxParser.csproj
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: Build ${{ matrix.project }}
working-directory: tools
run: dotnet build ./${{ matrix.project }} -c ${{ matrix.config }}
1 change: 1 addition & 0 deletions .github/workflows/nethermind-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- Nethermind.Overseer.Test
- Nethermind.Runner.Test
- Nethermind.Serialization.Ssz.Test
- Nethermind.Shutter.Test
- Nethermind.Sockets.Test
- Nethermind.Specs.Test
- Nethermind.State.Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-supported-chains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.21.0'
go-version: 'stable'
check-latest: true
cache: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ jobs:
global-json-file: n/global.json
- name: Build DocGen
working-directory: n
run: dotnet build tools/docgen/DocGen.csproj -c release -o docgen
run: dotnet build tools/DocGen/DocGen.csproj -c release -o DocGen
- name: Generate docs
run: n/docgen/DocGen $GITHUB_WORKSPACE/d --config --jsonrpc --metrics
run: n/DocGen/DocGen $GITHUB_WORKSPACE/d --config --jsonrpc --metrics
- name: Tag a new version
if: github.event_name == 'release' && !github.event.release.prerelease
working-directory: d
run: |
npm i
npm run docusaurus docs:version v${{ github.event.release.tag_name }}
npm run docusaurus docs:version ${{ github.event.release.tag_name }}
- name: Create a pull request
working-directory: d
env:
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Chains/chiado.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",
"eip1559Transition": "0x0",
"beaconChainGenesisTimestamp": "0x6343ee4c",
"eip3651TransitionTimestamp": "0x646e0e4c",
"eip3855TransitionTimestamp": "0x646e0e4c",
"eip3860TransitionTimestamp": "0x646e0e4c",
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Chains/foundation.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"eip3198Transition": "0xC5D488",
"eip3529Transition": "0xC5D488",
"eip3541Transition": "0xC5D488",
"beaconChainGenesisTimestamp": "0x5fc63057",
"eip3651TransitionTimestamp": "0x64373057",
"eip3855TransitionTimestamp": "0x64373057",
"eip3860TransitionTimestamp": "0x64373057",
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Chains/gnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"eip3529Transition": 19040000,
"eip3541Transition": 19040000,
"eip1559Transition": 19040000,
"beaconChainGenesisTimestamp": "0x61b10dbc",
"eip3651TransitionTimestamp": "0x64c8edbc",
"eip3855TransitionTimestamp": "0x64c8edbc",
"eip3860TransitionTimestamp": "0x64c8edbc",
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Chains/holesky.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"eip3198Transition": "0x0",
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",
"beaconChainGenesisTimestamp": "0x65156994",
"eip3651TransitionTimestamp": "0x6516eac0",
"eip3855TransitionTimestamp": "0x6516eac0",
"eip3860TransitionTimestamp": "0x6516eac0",
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Chains/sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"eip3541Transition": "0x0",
"terminalTotalDifficulty": "3C6568F12E8000",
"mergeForkIdTransition": "0x1A7ACB",
"beaconChainGenesisTimestamp": "0x62b07d60",
"eip4895TransitionTimestamp": "0x63FD7D60",
"eip3855TransitionTimestamp": "0x63FD7D60",
"eip3651TransitionTimestamp": "0x63FD7D60",
Expand Down
7 changes: 4 additions & 3 deletions src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<PackageVersion Include="FastEnum" Version="1.8.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions.Json" Version="6.1.0" />
<PackageVersion Include="Google.Protobuf" Version="3.27.2" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.27.2" />
<PackageVersion Include="Google.Protobuf" Version="3.28.0" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.28.0" />
<PackageVersion Include="Grpc" Version="2.46.6" />
<PackageVersion Include="Grpc.Tools" Version="2.65.0" />
<PackageVersion Include="HexMate" Version="0.0.3" />
Expand All @@ -44,13 +44,14 @@
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageVersion Include="Nethermind.Crypto.Bls" Version="1.0.2" />
<PackageVersion Include="Nethermind.Crypto.Bls" Version="1.0.3" />
<PackageVersion Include="Nethermind.Crypto.Pairings" Version="1.1.1" />
<PackageVersion Include="Nethermind.Crypto.SecP256k1" Version="1.2.2" />
<PackageVersion Include="Nethermind.DotNetty.Buffers" Version="1.0.1" />
<PackageVersion Include="Nethermind.DotNetty.Handlers" Version="1.0.1" />
<PackageVersion Include="Nethermind.DotNetty.Transport" Version="1.0.1" />
<PackageVersion Include="Nethermind.Gmp" Version="1.0.1" />
<PackageVersion Include="Nethermind.Libp2p" Version="1.0.0-preview.33" />
<PackageVersion Include="Nethermind.Numerics.Int256" Version="1.2.0" />
<PackageVersion Include="Nito.Collections.Deque" Version="1.2.1" />
<PackageVersion Include="NLog" Version="5.3.2" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Threading.Tasks;
using Nethermind.Consensus;
using Nethermind.Consensus.Transactions;

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/Extensions/IPluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Nethermind.Api.Extensions;
[ConfigCategory(DisabledForCli = false, HiddenFromDocs = true)]
public interface IPluginConfig : IConfig
{
[ConfigItem(Description = "Order of plugin initialization", DefaultValue = "[Clique, Aura, Ethash, Optimism, AuRaMerge, Merge, MEV, HealthChecks, Hive]")]
[ConfigItem(Description = "Order of plugin initialization", DefaultValue = "[Clique, Aura, Ethash, Optimism, Shutter, AuRaMerge, Merge, MEV, HealthChecks, Hive]")]
string[] PluginOrder { get; set; }
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/Extensions/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Nethermind.Api.Extensions;

public class PluginConfig : IPluginConfig
{
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "Optimism", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "Optimism", "Shutter", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
}
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Api/IApiWithBlockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public interface IApiWithBlockchain : IApiWithStores, IBlockchainBridgeFactory
IGasLimitCalculator? GasLimitCalculator { get; set; }

IBlockProducerEnvFactory? BlockProducerEnvFactory { get; set; }
IBlockImprovementContextFactory? BlockImprovementContextFactory { get; set; }

IGasPriceOracle? GasPriceOracle { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Api/IApiWithStores.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Nethermind.Consensus;
using Nethermind.Crypto;
using Nethermind.Db.Blooms;
using Nethermind.Facade.Find;
using Nethermind.State.Repositories;
using Nethermind.TxPool;
using Nethermind.Wallet;
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Nethermind.Api/NethermindApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
using Nethermind.Sockets;
using Nethermind.Trie;
using Nethermind.Consensus.Processing.CensorshipDetector;
using Nethermind.Facade.Find;

namespace Nethermind.Api
{
Expand Down Expand Up @@ -214,6 +215,7 @@ public ISealEngine SealEngine
public IGasLimitCalculator? GasLimitCalculator { get; set; }

public IBlockProducerEnvFactory? BlockProducerEnvFactory { get; set; }
public IBlockImprovementContextFactory? BlockImprovementContextFactory { get; set; }
public IGasPriceOracle? GasPriceOracle { get; set; }

public IEthSyncingInfo? EthSyncingInfo { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Api/PluginPriorities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ namespace Nethermind.Api;
public class PluginPriorities
{
public const int Merge = 1000;
public const int Shutter = 2000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Nethermind.Logging;
using Nethermind.Db.Blooms;
using Nethermind.Facade.Filters;
using Nethermind.Facade.Find;
using NSubstitute;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public bool Equals(LogEntry logEntry, LogEntry searchedEntryTemplate)
Hash256[] matchEntryTopics = searchedEntryTemplate?.Topics ?? Array.Empty<Hash256>();
return ReferenceEquals(logEntry, searchedEntryTemplate) || (
logEntry is not null
&& logEntry.LoggersAddress == searchedEntryTemplate?.LoggersAddress
&& logEntry.Address == searchedEntryTemplate?.Address
&& logEntry.Topics.Length >= matchEntryTopics.Length
&& logEntry.Topics.Take(matchEntryTopics.Length).SequenceEqual(matchEntryTopics)
);
}

public int GetHashCode(LogEntry obj)
{
return obj.Topics.Aggregate(obj.LoggersAddress.GetHashCode(), (i, keccak) => i ^ keccak.GetHashCode());
return obj.Topics.Aggregate(obj.Address.GetHashCode(), (i, keccak) => i ^ keccak.GetHashCode());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CopyTreeVisitor(
public void VisitTree(in TContext nodeContext, Hash256 rootHash, TrieVisitContext trieVisitContext)
{
_stopwatch.Start();
if (_logger.IsWarn) _logger.Warn($"Full Pruning Started on root hash {rootHash}: do not close the node until finished or progress will be lost.");
if (_logger.IsInfo) _logger.Info($"Full Pruning Started on root hash {rootHash}: do not close the node until finished or progress will be lost.");
}

[DoesNotReturn]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD

public long? DaoBlockNumber => _specProvider.DaoBlockNumber;

public ulong? BeaconChainGenesisTimestamp => _specProvider.BeaconChainGenesisTimestamp;

public ulong NetworkId => _specProvider.NetworkId;

public ulong ChainId => _specProvider.ChainId;
Expand Down
12 changes: 4 additions & 8 deletions src/Nethermind/Nethermind.Cli/NodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ public async Task<JsValue> PostJint(string method, params object[] parameters)
}
else
{
Stopwatch stopwatch = new();
stopwatch.Start();
long startTime = Stopwatch.GetTimestamp();
object? result = await _currentClient.Post<object>(method, parameters);
stopwatch.Stop();
decimal totalMicroseconds = stopwatch.ElapsedTicks * (1_000_000m / Stopwatch.Frequency);
decimal totalMicroseconds = (decimal)Stopwatch.GetElapsedTime(startTime).TotalMicroseconds;
Colorful.Console.WriteLine($"Request complete in {totalMicroseconds}μs");

if (result is bool boolResult)
Expand Down Expand Up @@ -121,11 +119,9 @@ public async Task<JsValue> PostJint(string method, params object[] parameters)
}
else
{
Stopwatch stopwatch = new();
stopwatch.Start();
long starting = Stopwatch.GetTimestamp();
result = await _currentClient.Post<T>(method, parameters);
stopwatch.Stop();
decimal totalMicroseconds = stopwatch.ElapsedTicks * (1_000_000m / Stopwatch.Frequency);
decimal totalMicroseconds = (decimal)Stopwatch.GetElapsedTime(starting).TotalMicroseconds;
Colorful.Console.WriteLine($"Request complete in {totalMicroseconds}μs");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ private void WaitForNumber(PrivateKey nodeKey, long number)
{
if (_logger.IsInfo) _logger.Info($"WAITING ON {nodeKey.Address} FOR BLOCK {number}");
SpinWait spinWait = new();
Stopwatch stopwatch = new();
stopwatch.Start();
while (stopwatch.ElapsedMilliseconds < _timeout)
long startTime = Stopwatch.GetTimestamp();
while (Stopwatch.GetElapsedTime(startTime).TotalMilliseconds < _timeout)
{
spinWait.SpinOnce();
if (_blockTrees[nodeKey].Head.Number >= number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ private Snapshot GenerateSnapshot(Hash256 hash, long number, Address candidate)
tally[candidate].Votes = 2;
tally[_signer2] = new Tally(false);
tally[_signer2].Votes = 1;
Snapshot snapshot = new(number, hash, signers, tally);
snapshot.Votes = votes;
Snapshot snapshot = new(number, hash, signers, tally) { Votes = votes };
return snapshot;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Config/IBlocksConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public interface IBlocksConfig : IConfig
[ConfigItem(Description = "Whether to pre-warm the state when processing blocks. This can lead to an up to 2x speed-up in the main loop block processing.", DefaultValue = "True")]
bool PreWarmStateOnBlockProcessing { get; set; }

[ConfigItem(Description = "Block Production timeout, in milliseconds.", DefaultValue = "4000")]
[ConfigItem(Description = "The block production timeout, in milliseconds.", DefaultValue = "4000")]
int BlockProductionTimeoutMs { get; set; }

[ConfigItem(Description = "Genesis block load timeout, in milliseconds.", DefaultValue = "40000")]
[ConfigItem(Description = "The genesis block load timeout, in milliseconds.", DefaultValue = "40000")]
int GenesisTimeoutMs { get; set; }

byte[] GetExtraDataBytes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface IAuraConfig : IConfig

[ConfigItem(Description = "The address of the transaction priority contract to use when selecting transactions from the transaction pool.",
DefaultValue = "null")]

string TxPriorityContractAddress { get; set; }

[ConfigItem(Description = "The path to the transaction priority rules file to use when selecting transactions from the transaction pool.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public void ProduceOnTopOf(Hash256 hash)
_signalsQueue.Add(_blockTree.FindBlock(hash, BlockTreeLookupOptions.None));
}

public IReadOnlyDictionary<Address, bool> GetProposals() => _blockProducer.Proposals.ToDictionary();

private void TimerOnElapsed(object sender, ElapsedEventArgs e)
{
try
Expand Down
Loading

0 comments on commit 137f260

Please sign in to comment.