Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VOLUME /nethermind/keystore
VOLUME /nethermind/logs
VOLUME /nethermind/nethermind_db

EXPOSE 8545 8551 30303
EXPOSE 8545 8551 8552 30303
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The image exposes port 8552, but the SSZ-REST middleware is wired to serve /engine/* on the existing authenticated Engine API port (same listener as JSON-RPC) and there is no separate SSZ-REST server bound to 8552 in this PR. Either wire up the separate port described in the PR (and config) or avoid exposing an unused port in the Dockerfile.

Copilot uses AI. Check for mistakes.

COPY --from=build /publish .

Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Merge.Plugin/IMergeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ The number of requests to the garbage collector (GC) to release the process memo

[ConfigItem(Description = "Delay, in milliseconds, between `newPayload` and GC trigger. If not set, defaults to 1/8th of `Blocks.SecondsPerSlot`.", DefaultValue = null, HiddenFromDocs = true)]
int? PostBlockGcDelayMs { get; set; }

}
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Merge.Plugin/MergeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ public class MergeConfig : IMergeConfig

public bool SimulateBlockProduction { get; set; } = false;
public int? PostBlockGcDelayMs { get; set; } = null;

}
}
26 changes: 26 additions & 0 deletions src/Nethermind/Nethermind.Merge.Plugin/MergePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Nethermind.Consensus.Rewards;
using Nethermind.Consensus.Validators;
using Nethermind.Core;
using Nethermind.Core.Authentication;
using Nethermind.Core.Crypto;
using Nethermind.Core.Exceptions;
using Nethermind.Db;
Expand All @@ -33,6 +34,7 @@
using Nethermind.Merge.Plugin.GC;
using Nethermind.Merge.Plugin.Handlers;
using Nethermind.Merge.Plugin.InvalidChainTracker;
using Nethermind.Merge.Plugin.SszRest;
using Nethermind.Merge.Plugin.Synchronization;
using Nethermind.Network.Contract.P2P;
using Nethermind.Serialization.Json;
Expand Down Expand Up @@ -225,11 +227,17 @@ public Task InitNetworkProtocol()
if (_logger.IsDebug) _logger.Debug("Delayed adding post-merge eth/* capabilities until terminal block reached");
_poSSwitcher.TerminalBlockReached += (_, _) => AddPostMergeNetworkProtocols();
}

}

return Task.CompletedTask;
}

public Task InitRpcModules()
{
return Task.CompletedTask;
}

private void AddPostMergeNetworkProtocols()
{
if (_logger.IsInfo) _logger.Info("Adding eth/69 capability");
Expand Down Expand Up @@ -345,6 +353,24 @@ protected override void Load(ContainerBuilder builder)
ctx.Resolve<ILogManager>());
})
.AddSingleton<IHttpClient, DefaultHttpClient>()

// EIP-8161 SSZ-REST Engine API transport (served on engine port alongside JSON-RPC)
.AddSingleton<SszRestHandler>(ctx =>
{
ILogManager logManager = ctx.Resolve<ILogManager>();

return new SszRestHandler(
ctx.Resolve<IAsyncHandler<ExecutionPayload, PayloadStatusV1>>(),
ctx.Resolve<IForkchoiceUpdatedHandler>(),
ctx.Resolve<IAsyncHandler<byte[], ExecutionPayload?>>(),
ctx.Resolve<IAsyncHandler<byte[], GetPayloadV2Result?>>(),
ctx.Resolve<IAsyncHandler<byte[], GetPayloadV3Result?>>(),
ctx.Resolve<IAsyncHandler<byte[], GetPayloadV4Result?>>(),
ctx.Resolve<IAsyncHandler<byte[], GetPayloadV5Result?>>(),
ctx.Resolve<IHandler<IEnumerable<string>, IEnumerable<string>>>(),
ctx.Resolve<IAsyncHandler<byte[][], IEnumerable<BlobAndProofV1?>>>(),
logManager);
})
Comment on lines +357 to +373
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

SszRestHandler is registered unconditionally in the Merge plugin container. Because Startup enables SSZ-REST routing whenever SszRestHandler is present, this effectively enables the SSZ-REST Engine API whenever the Merge plugin is loaded. The PR description mentions an opt-in config (Merge.SszRestEnabled / Merge.SszRestPort), but there is no gating here. Consider registering SszRestHandler only when the config enables it (and/or wiring it behind a feature flag) so the endpoint isn’t exposed by default.

Copilot uses AI. Check for mistakes.
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

<ItemGroup>
<ProjectReference Include="..\Nethermind.Api\Nethermind.Api.csproj" />
<ProjectReference Include="..\Nethermind.Merkleization\Nethermind.Merkleization.csproj" />
<ProjectReference Include="..\Nethermind.Serialization.SszGenerator\Nethermind.Serialization.SszGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\Nethermind.Serialization.Ssz\Nethermind.Serialization.Ssz.csproj" />
</ItemGroup>

</Project>
Loading