Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8eb2df2
Update CLZ gas cost for devnet3 (#8953)
benaadams Jul 10, 2025
9bd7d2f
Update tx gas cap for devnet3 (#8954)
benaadams Jul 10, 2025
113f22f
Don't block background tasks when syncing (#8971)
benaadams Jul 10, 2025
af748bd
Rename blob metrics (#8972)
flcl42 Jul 11, 2025
2ae971c
Fix Taiko Engine Api (#8974)
asdacap Jul 11, 2025
f415499
Better null-ckecks in TryGetCanonicalTransaction (#8969)
LukaszRozmej Jul 11, 2025
31bbbee
Revise JSON-RPC docs generation (#8967)
rubo Jul 11, 2025
3efda4c
Fix/OOM when downloading from genesis. (#8975)
asdacap Jul 12, 2025
5ff5511
Cache PropertyInfo lookups for JsonRpc (#8976)
benaadams Jul 12, 2025
f9d7692
Auto-update fast sync settings (#8978)
core-repository-dispatch-app[bot] Jul 13, 2025
8ee7c3f
Update OP Superchain chains (#8979)
core-repository-dispatch-app[bot] Jul 13, 2025
72debe8
Remove use of Linq.Sum from hot paths (#8977)
benaadams Jul 13, 2025
979b265
Isolate Tracer in Proof Module and remove IVisitingWorldState (#8981)
asdacap Jul 14, 2025
ac37e35
More hot code in ConnectNodes (#8982)
benaadams Jul 14, 2025
2b0e838
Only access "warmup" hashtable once per warmup (#8983)
benaadams Jul 14, 2025
5993011
EIP-7594: Constant maxBlobsPerTx (#8940)
flcl42 Jul 14, 2025
f05894f
Fail fast on Db corruption (#8986)
benaadams Jul 14, 2025
9bb8edb
Configure EWC Zurich hard fork (#8985)
rubo Jul 15, 2025
c9fe29c
feat: Add RegexOptions.Compiled flag to NewPayloadJsonRpcValidator (#…
reallesee Jul 15, 2025
bea66a5
Improve locking when looking up RlpDecoders (#8987)
benaadams Jul 15, 2025
6ba2255
Fix naming of data cost in ExecutePrecompile (#8994)
marcindsobczak Jul 16, 2025
b9f48a5
Move precompiles (#8962)
deffrian Jul 16, 2025
4540a7f
Add EIP-7910: Add eth_config (#8956)
flcl42 Jul 16, 2025
9864df9
Replace `eth_pairings` with `mcl` (#8992)
rubo Jul 16, 2025
bba1cfe
Merge branch 'master' into ilevm/aot-precompiler
SiddharthV1 Jul 17, 2025
c736645
Unify BN254 naming (#9004)
rubo Jul 17, 2025
763442d
Refactor/Move init DB to DI (#8997)
asdacap Jul 18, 2025
650cb5a
Merge remote-tracking branch 'upstream/feature/ilevm/aot-precompiler'…
SiddharthV1 Jul 18, 2025
cd21f83
Merge branch 'master' into ilevm/aot-precompiler
SiddharthV1 Jul 18, 2025
fb343c0
Wait to read channel before reading
SiddharthV1 Jul 18, 2025
71ed14f
Fix BN254 point deserialization (#9009)
rubo Jul 18, 2025
6538915
Optimize ModExp (#9008)
benaadams Jul 18, 2025
0a5591d
Remove last orphan readonly tx processing scope. (#9005)
asdacap Jul 19, 2025
661f070
Fix workerloop
SiddharthV1 Jul 19, 2025
5413713
Replace read all with try read
SiddharthV1 Jul 19, 2025
48c3334
Update config for tests
SiddharthV1 Jul 19, 2025
8075f5f
Update winget command (#9011)
rubo Jul 20, 2025
d2230a0
Auto-update fast sync settings (#9013)
core-repository-dispatch-app[bot] Jul 20, 2025
f4c1c9f
Update OP Superchain chains (#9014)
core-repository-dispatch-app[bot] Jul 20, 2025
dc7276f
Tidy up ecdsa overloads (#9015)
benaadams Jul 20, 2025
4aae193
Tracing check to allow ilevm to be enabled for node and tests
SiddharthV1 Jul 20, 2025
288fcaa
Update verified
SiddharthV1 Jul 20, 2025
e5ef85b
..
SiddharthV1 Jul 20, 2025
6c70f90
Merge branch 'master' into ilevm/aot-precompiler
SiddharthV1 Jul 20, 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
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
<PackageVersion Include="Nethermind.Crypto.Bls" Version="1.0.5" />
<PackageVersion Include="Nethermind.Crypto.Pairings" Version="1.1.1" />
<PackageVersion Include="Nethermind.Crypto.SecP256k1" Version="1.4.1" />
<PackageVersion Include="Nethermind.Crypto.SecP256r1" Version="1.0.0-preview.6" />
<PackageVersion Include="Nethermind.DotNetty.Buffers" Version="1.0.1" />
Expand All @@ -57,6 +56,7 @@
<PackageVersion Include="Nethermind.GmpBindings" Version="1.0.2" />
<PackageVersion Include="Nethermind.Libp2p" Version="1.0.0-preview.45" />
<PackageVersion Include="Nethermind.Libp2p.Protocols.PubsubPeerDiscovery" Version="1.0.0-preview.45" />
<PackageVersion Include="Nethermind.MclBindings" Version="1.0.0" />
<PackageVersion Include="Nethermind.Numerics.Int256" Version="1.3.6" />
<PackageVersion Include="Nito.Collections.Deque" Version="1.2.1" />
<PackageVersion Include="NJsonSchema" Version="11.3.2" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The standalone release builds are available on [GitHub Releases](https://github.
On Windows, Nethermind can be installed via Windows Package Manager:

```powershell
winget install nethermind
winget install --id Nethermind.Nethermind
```

- **macOS**
Expand Down
6 changes: 3 additions & 3 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- <add key="nugettest.org" value="https://apiint.nugettest.org/v3/index.json" /> -->
<!--<add key="nugettest.org" value="https://apiint.nugettest.org/v3/index.json" />-->
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<!-- <packageSource key="nugettest.org">
<!--<packageSource key="nugettest.org">
<package pattern="" />
</packageSource> -->
</packageSource>-->
</packageSourceMapping>
</configuration>
1 change: 1 addition & 0 deletions src/Nethermind/Benchmarks.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Project Path="Nethermind.EthStats/Nethermind.EthStats.csproj" />
<Project Path="Nethermind.Evm.Test/Nethermind.Evm.Test.csproj" />
<Project Path="Nethermind.Evm/Nethermind.Evm.csproj" />
<Project Path="Nethermind.Evm.Precompiles/Nethermind.Evm.Precompiles.csproj" />
<Project Path="Nethermind.Facade/Nethermind.Facade.csproj" />
<Project Path="Nethermind.Grpc/Nethermind.Grpc.csproj" />
<Project Path="Nethermind.Init\Nethermind.Init.csproj" />
Expand Down
5 changes: 0 additions & 5 deletions src/Nethermind/Nethermind.Api/BasicApiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@ public static T Config<T>(this IBasicApi api) where T : IConfig
{
return api.ConfigProvider.GetConfig<T>();
}

public static T Db<T>(this IBasicApi api, string dbName) where T : class, IDb
{
return api.DbProvider!.GetDb<T>(dbName);
}
}
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/IApiWithStores.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Nethermind.Api
{
public interface IApiWithStores : IBasicApi
{
IBlobTxStorage? BlobTxStorage { get; set; }
IBlobTxStorage BlobTxStorage { get; }
IBlockTree? BlockTree { get; set; }
IBloomStorage? BloomStorage { get; set; }
IChainLevelInfoRepository? ChainLevelInfoRepository { get; set; }
Expand Down
3 changes: 1 addition & 2 deletions src/Nethermind/Nethermind.Api/IBasicApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public interface IBasicApi
[SkipServiceCollection]
IConfigProvider ConfigProvider { get; }
ICryptoRandom CryptoRandom { get; }
IDbProvider? DbProvider { get; set; }
IDbFactory? DbFactory { get; set; }
IDbProvider DbProvider { get; }
IEthereumEcdsa EthereumEcdsa { get; }
[SkipServiceCollection]
IJsonSerializer EthereumJsonSerializer { get; }
Expand Down
6 changes: 2 additions & 4 deletions src/Nethermind/Nethermind.Api/NethermindApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.IO.Abstractions;
using Autofac;
using Nethermind.Abi;
using Nethermind.Api.Extensions;
using Nethermind.Blockchain;
using Nethermind.Blockchain.Blocks;
Expand Down Expand Up @@ -71,7 +70,7 @@ public IBlockchainBridge CreateBlockchainBridge()
return Context.Resolve<IBlockchainBridgeFactory>().CreateBlockchainBridge();
}

public IBlobTxStorage? BlobTxStorage { get; set; }
public IBlobTxStorage BlobTxStorage => Context.Resolve<IBlobTxStorage>();
public CompositeBlockPreprocessorStep BlockPreprocessor { get; } = new();
public IBlockProcessingQueue? BlockProcessingQueue { get; set; }
public IBlockProducer? BlockProducer { get; set; }
Expand All @@ -82,8 +81,7 @@ public IBlockchainBridge CreateBlockchainBridge()
public IChainLevelInfoRepository? ChainLevelInfoRepository { get; set; }
public IConfigProvider ConfigProvider => _dependencies.ConfigProvider;
public ICryptoRandom CryptoRandom => Context.Resolve<ICryptoRandom>();
public IDbProvider? DbProvider { get; set; }
public IDbFactory? DbFactory { get; set; }
public IDbProvider DbProvider => Context.Resolve<IDbProvider>();
public ISigner? EngineSigner { get; set; }
public ISignerStore? EngineSignerStore { get; set; }
public IEnode? Enode { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.AuRa.Test/AuRaPluginTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void Init_when_not_AuRa_doesnt_trow()
Substitute.For<IProcessExitSource>(),
testNethermindContainer);
AuRaNethermindApi api = new AuRaNethermindApi(apiDependencies);
api.DbProvider = TestMemDbProvider.Init();
Action init = () => auRaPlugin.Init(api);
init.Should().NotThrow();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public async Task Can_process_fast_sync()
new FixedForkActivationChainHeadSpecProvider(specProvider, fixedBlock: 10_000_000),
blockTree,
readOnlyState,
new CodeInfoRepository())
new EthereumCodeInfoRepository())
{
HasSynced = true
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading.Tasks;
using Autofac;
using FluentAssertions;
using Nethermind.Api;
using Nethermind.Blockchain.FullPruning;
using Nethermind.Config;
using Nethermind.Core;
Expand Down Expand Up @@ -75,16 +76,14 @@ protected override async Task<TestBlockchain> Build(Action<ContainerBuilder>? co
return chain;
}

protected override ContainerBuilder ConfigureContainer(ContainerBuilder builder, IConfigProvider configProvider)
{
IDbProvider dbProvider = new DbProvider();
RocksDbFactory rocksDbFactory = new(new DbConfig(), LimboLogs.Instance, TempDirectory.Path);
StandardDbInitializer standardDbInitializer = new(dbProvider, rocksDbFactory, new FileSystem());
standardDbInitializer.InitStandardDbs(true);

return base.ConfigureContainer(builder, configProvider)
.AddSingleton<IDbProvider>(dbProvider);
}
protected override ContainerBuilder ConfigureContainer(ContainerBuilder builder, IConfigProvider configProvider) =>
// Reenable rocksdb
base.ConfigureContainer(builder, configProvider)
.AddSingleton<IDbFactory, RocksDbFactory>()
.Intercept<IInitConfig>((initConfig) =>
{
initConfig.BaseDbPath = TempDirectory.Path;
});

public override void Dispose()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,16 @@
// SPDX-License-Identifier: LGPL-3.0-only

using System.Threading;
using Autofac;
using FluentAssertions;
using Nethermind.Blockchain.BeaconBlockRoot;
using Nethermind.Blockchain.Blocks;
using Nethermind.Blockchain.Receipts;
using Nethermind.Config;
using Nethermind.Api;
using Nethermind.Consensus;
using Nethermind.Consensus.ExecutionRequests;
using Nethermind.Consensus.Processing;
using Nethermind.Consensus.Producers;
using Nethermind.Consensus.Rewards;
using Nethermind.Consensus.Transactions;
using Nethermind.Consensus.Validators;
using Nethermind.Consensus.Withdrawals;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Core.Test;
using Nethermind.Core.Test.Builders;
using Nethermind.Db;
using Nethermind.Evm;
using Nethermind.Evm.Config;
using Nethermind.Evm.TransactionProcessing;
using Nethermind.Logging;
using Nethermind.Specs;
using Nethermind.Evm.State;
using Nethermind.State;
using Nethermind.Core.Test.Modules;
using NUnit.Framework;

namespace Nethermind.Blockchain.Test.Producers;
Expand All @@ -36,70 +21,18 @@ public class DevBlockProducerTests
[Test, MaxTime(Timeout.MaxTestTime)]
public void Test()
{
ISpecProvider specProvider = MainnetSpecProvider.Instance;
DbProvider dbProvider = new();
dbProvider.RegisterDb(DbNames.BlockInfos, new MemDb());
dbProvider.RegisterDb(DbNames.Blocks, new MemDb());
dbProvider.RegisterDb(DbNames.Headers, new MemDb());
dbProvider.RegisterDb(DbNames.State, new MemDb());
dbProvider.RegisterDb(DbNames.Code, new MemDb());
dbProvider.RegisterDb(DbNames.Metadata, new MemDb());
using IContainer container = new ContainerBuilder()
.AddModule(new TestNethermindModule())
.AddSingleton<IBlockValidator>(Always.Valid)
.AddSingleton<IBlockProducerTxSourceFactory, EmptyTxSourceFactory>()
.AddScoped<IBlockProducerFactory, TestBlockProcessingModule.AutoBlockProducerFactory<DevBlockProducer>>()
.Build();

BlockTree blockTree = Build.A.BlockTree()
.WithoutSettingHead
.TestObject;
IBlockTree blockTree = container.Resolve<IBlockTree>();
IManualBlockProductionTrigger trigger = container.Resolve<IManualBlockProductionTrigger>();

IWorldStateManager worldStateManager = TestWorldStateFactory.CreateForTest(dbProvider, LimboLogs.Instance);
IWorldState stateProvider = worldStateManager.GlobalWorldState;
IStateReader stateReader = worldStateManager.GlobalStateReader;
BlockhashProvider blockhashProvider = new(blockTree, specProvider, stateProvider, LimboLogs.Instance);
CodeInfoRepository codeInfoRepository = new();
VirtualMachine virtualMachine = new(
blockhashProvider,
specProvider,
LimboLogs.Instance);
TransactionProcessor txProcessor = new(
specProvider,
stateProvider,
virtualMachine,
codeInfoRepository,
LimboLogs.Instance);
BlockProcessor blockProcessor = new BlockProcessor(
specProvider,
Always.Valid,
NoBlockRewards.Instance,
new BlockProcessor.BlockValidationTransactionsExecutor(new ExecuteTransactionProcessorAdapter(txProcessor), stateProvider),
stateProvider,
NullReceiptStorage.Instance,
new BeaconBlockRootHandler(txProcessor, stateProvider),
new BlockhashStore(specProvider, stateProvider),
LimboLogs.Instance,
new WithdrawalProcessor(stateProvider, LimboLogs.Instance),
new ExecutionRequestsProcessor(txProcessor));
BlockchainProcessor blockchainProcessor = new(
blockTree,
blockProcessor,
NullRecoveryStep.Instance,
stateReader,
LimboLogs.Instance,
BlockchainProcessor.Options.Default);
BuildBlocksWhenRequested trigger = new();
ManualTimestamper timestamper = new ManualTimestamper();
DevBlockProducer devBlockProducer = new(
EmptyTxSource.Instance,
blockchainProcessor,
stateProvider,
blockTree,
timestamper,
specProvider,
new BlocksConfig(),
LimboLogs.Instance);

StandardBlockProducerRunner blockProducerRunner = new StandardBlockProducerRunner(trigger, blockTree, devBlockProducer);

blockchainProcessor.Start();
blockProducerRunner.Start();
ProducedBlockSuggester _ = new ProducedBlockSuggester(blockTree, blockProducerRunner);
container.Resolve<IMainProcessingContext>().BlockchainProcessor.Start();
container.Resolve<IBlockProducerRunner>().Start();

AutoResetEvent autoResetEvent = new(false);

Expand All @@ -112,4 +45,12 @@ public void Test()
autoResetEvent.WaitOne(1000).Should().BeTrue("1");
blockTree.Head!.Number.Should().Be(1);
}

private class EmptyTxSourceFactory : IBlockProducerTxSourceFactory
{
public ITxSource Create()
{
return EmptyTxSource.Instance;
}
}
}
3 changes: 2 additions & 1 deletion src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Nethermind.Core.Specs;
using Nethermind.Core.Test;
using Nethermind.Core.Test.Builders;
using Nethermind.Core.Test.Db;
using Nethermind.Crypto;
using Nethermind.Db;
using Nethermind.Evm;
Expand Down Expand Up @@ -73,7 +74,7 @@ public void Setup()
.WithSpecProvider(specProvider)
.TestObject;

CodeInfoRepository codeInfoRepository = new();
EthereumCodeInfoRepository codeInfoRepository = new();
TxPool.TxPool txPool = new(
ecdsa,
new BlobTxStorage(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Nethermind.Core.Crypto;
using System;
using System.Linq;
using Nethermind.Blockchain;
using Nethermind.Blockchain.Tracing;
using Nethermind.Core.Test;
using Nethermind.Int256;
Expand All @@ -40,7 +41,7 @@ public void Setup()
_specProvider = new TestSpecProvider(Prague.Instance);
IWorldStateManager worldStateManager = TestWorldStateFactory.CreateForTest();
_stateProvider = worldStateManager.GlobalWorldState;
CodeInfoRepository codeInfoRepository = new();
EthereumCodeInfoRepository codeInfoRepository = new();
VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, LimboLogs.Instance);
_transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance);
_ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using NUnit.Framework;
using Nethermind.Config;
using System.Collections.Generic;
using Nethermind.Blockchain;
using Nethermind.Blockchain.Tracing;
using Nethermind.Core.Test;
using Nethermind.State;
Expand Down Expand Up @@ -60,7 +61,7 @@ public void Setup()
_stateProvider.Commit(_specProvider.GenesisSpec);
_stateProvider.CommitTree(0);

CodeInfoRepository codeInfoRepository = new();
EthereumCodeInfoRepository codeInfoRepository = new();
VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, LimboLogs.Instance);
_transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance);
_ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId);
Expand Down
56 changes: 56 additions & 0 deletions src/Nethermind/Nethermind.Blockchain/CachedCodeInfoRepository.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Evm;
using Nethermind.Evm.CodeAnalysis;
using Nethermind.Evm.Precompiles;
using Nethermind.State;

namespace Nethermind.Blockchain;

public class CachedCodeInfoRepository(
FrozenDictionary<AddressAsKey, PrecompileInfo> precompiles,
ConcurrentDictionary<PreBlockCaches.PrecompileCacheKey, (byte[], bool)>? precompileCache) : CodeInfoRepository(
precompileCache is null
? precompiles
: precompiles.ToFrozenDictionary(kvp => kvp.Key, kvp => CreateCachedPrecompile(kvp, precompileCache)))
{
private static PrecompileInfo CreateCachedPrecompile(
in KeyValuePair<AddressAsKey, PrecompileInfo> originalPrecompile,
ConcurrentDictionary<PreBlockCaches.PrecompileCacheKey, (byte[], bool)> cache) =>
new PrecompileInfo(new CachedPrecompile(originalPrecompile.Key.Value, originalPrecompile.Value.Precompile!, cache));

private class CachedPrecompile(
Address address,
IPrecompile precompile,
ConcurrentDictionary<PreBlockCaches.PrecompileCacheKey, (byte[], bool)> cache) : IPrecompile
{
public static Address Address => Address.Zero;

public static string Name => "";

public long BaseGasCost(IReleaseSpec releaseSpec) => precompile.BaseGasCost(releaseSpec);

public long DataGasCost(ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec) => precompile.DataGasCost(inputData, releaseSpec);

public (byte[], bool) Run(ReadOnlyMemory<byte> inputData, IReleaseSpec releaseSpec)
{
PreBlockCaches.PrecompileCacheKey key = new(address, inputData);
if (!cache.TryGetValue(key, out (byte[], bool) result))
{
result = precompile.Run(inputData, releaseSpec);
// we need to rebuild the key with data copy as the data can be changed by VM processing
key = new PreBlockCaches.PrecompileCacheKey(address, inputData.ToArray());
cache.TryAdd(key, result);
}

return result;
}
}
}
Loading