Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
2d86ee6
Add initial refactored stateless executor
rubo Feb 24, 2026
fcfd95c
Fix a typo
rubo Feb 24, 2026
e760d5d
Make paths absolute
rubo Feb 24, 2026
5a07052
Add `modexp` precompile
rubo Feb 24, 2026
d6c4906
Add `BLS12_PAIRING_CHECK` precompile
rubo Feb 24, 2026
ba1dd7d
Add `BLS12_G2ADD` precompile
rubo Feb 24, 2026
b7d02cb
Add `BLS12_G2MSM` precompile
rubo Feb 24, 2026
cd466f7
Revise `Makefile`
rubo Feb 24, 2026
143938d
Merge branch 'master' into feature/stateless-zisk
rubo Feb 25, 2026
541baab
Add `BLS12_MAP_FP_TO_G1` precompile
rubo Feb 25, 2026
e2160c1
Add `BLS12_MAP_FP2_TO_G2` precompile
rubo Feb 25, 2026
9753bad
Add `BLS12_G1ADD` precompile
rubo Feb 25, 2026
c34ad37
Add `BLS12_G1MSM` precompile
rubo Feb 25, 2026
d970109
Implement preliminary input serialization
rubo Feb 27, 2026
e835363
Merge branch 'master' into feature/stateless-zisk
rubo Feb 27, 2026
c101661
Revise input formatting
rubo Feb 27, 2026
1ecab29
Refactor and add SecP256k1 functions
rubo Feb 27, 2026
cbaa939
Shut the cspell up
rubo Feb 27, 2026
bef6f51
Change chain id to `uint` and add tx sig recovery (disabled)
rubo Feb 27, 2026
e0dc870
Reformat
rubo Feb 28, 2026
9265125
Refactor and optimize Zisk I/O
rubo Feb 28, 2026
663c8fe
Minor refactor
rubo Feb 28, 2026
2643987
Replace throwing errors with fail-fasts.
rubo Feb 28, 2026
dde4bbb
Simplify the entrypoint
rubo Feb 28, 2026
e1afdea
Switch to little-endian
rubo Feb 28, 2026
a56075f
Refactor Zisk I/O
rubo Feb 28, 2026
ce38d9c
Optimize RLP handling
rubo Feb 28, 2026
e7e7874
Add `KZG_POINT_EVALUATION` precompile function
rubo Feb 28, 2026
f51fe71
Add `P256VERIFY` precompile function
rubo Feb 28, 2026
e06917b
Add Keccak-256 function
rubo Feb 28, 2026
aadec1f
Add SHA-256 function
rubo Feb 28, 2026
2670814
Revise execution result handling
rubo Feb 28, 2026
7a3f4ec
Fix `secp256k1_ecdsa_address_recover_c` signature
rubo Feb 28, 2026
72cc51c
Add `BLAKE2F` precompile function
rubo Feb 28, 2026
04f051d
Revise serialization length handling
rubo Mar 1, 2026
4b9fe52
Micro-optimize Zisk I/O
rubo Mar 1, 2026
caa49ee
Merge branch 'master' into feature/stateless-zisk
rubo Mar 1, 2026
501c9a6
Replace `zkVM` with `zkEVM`
rubo Mar 1, 2026
7dff8ea
Fix `Witness` API usage
rubo Mar 1, 2026
db5e9a1
Fix tester
rubo Mar 1, 2026
cda0ba4
Micro-optimize Zisk I/O
rubo Mar 1, 2026
464b222
Make `StatelessExecutor` static
rubo Mar 1, 2026
00df3f3
Merge branch 'master' into feature/stateless-zisk
rubo Mar 2, 2026
650edc5
Improve tester
rubo Mar 3, 2026
fc35feb
Fix RLP API
rubo Mar 3, 2026
7835da8
Add testing workflow
rubo Mar 3, 2026
0395776
Remove redundant namespace
rubo Mar 3, 2026
04a2412
Dispose decoded headers
rubo Mar 3, 2026
5b77145
Tighten serialization validation
rubo Mar 3, 2026
c234805
Remove redundant stuff
rubo Mar 3, 2026
af0d749
Dispose witness
rubo Mar 3, 2026
9f06eaa
Merge branch 'master' into feature/stateless-zisk
rubo Mar 3, 2026
1235eef
Hardcode `nethermindeth/bflat-riscv64` image
rubo Mar 5, 2026
be19b0c
Use a NuGet package for Zisk bindings
rubo Mar 5, 2026
8e06802
Remove keys from serialization
rubo Mar 5, 2026
2c99f6d
Fix Zisk testing
rubo Mar 5, 2026
e162eb3
Merge branch 'master' into feature/stateless-zisk
rubo Mar 5, 2026
04f0aa4
Remove `StatelessExecution` project
rubo Mar 5, 2026
939ad50
Harden Zisk Dockerfile
rubo Mar 5, 2026
e0c6249
Switch to the latest `nethermindeth/bflat-riscv64`
rubo Mar 6, 2026
d50c8a3
Implement address recovery
rubo Mar 6, 2026
8361a48
Fix formatting
rubo Mar 6, 2026
b6b234f
Add block validation
rubo Mar 6, 2026
3f0cc6b
Merge branch 'master' into feature/stateless-zisk
rubo Mar 7, 2026
16e6ea2
Cancel in-progress test
rubo Mar 7, 2026
316dd42
Remove tx address null check
rubo Mar 7, 2026
f05898a
Refactor test workflow
rubo Mar 7, 2026
6ea8960
Add dependencies to solution
rubo Mar 7, 2026
53cd7e9
Reorder usings
rubo Mar 7, 2026
832e48b
Merge branch 'master' into feature/stateless-zisk
rubo Mar 7, 2026
bf5af0b
Update Nethermind.ZiskBindings package
rubo Mar 8, 2026
d2e2bd2
Remove `Dockerfile.bflat`
rubo Mar 8, 2026
5caee24
Use modern libziskos and implement canonical way to reference precomp…
maximmenshikov Mar 9, 2026
e73fc3b
Update `Nethermind.ZiskBindings` package
rubo Mar 9, 2026
acd2220
Implement `ECREC` precompile and refactor address recovery
rubo Mar 9, 2026
1fcd952
Implement `BN254` precompiles
rubo Mar 9, 2026
2d3ec98
Merge branch 'master' into feature/stateless-zisk
rubo Mar 9, 2026
31f0a0f
Refactor `EthereumEcdsa` for zkEVM
rubo Mar 9, 2026
320297d
Remove links to `Nethermind.Facade`
rubo Mar 10, 2026
a44a374
Improve conditional compilation handling
rubo Mar 10, 2026
0feb4ab
Restore file name
rubo Mar 10, 2026
2eab942
Merge branch 'master' into feature/stateless-zisk
rubo Mar 13, 2026
ad98c10
Implement `BLS12_G1ADD` precompile
rubo Mar 13, 2026
8946c71
Switch to Zisk v0.16.0
rubo Mar 13, 2026
37d7a94
Implement `BLS12_G1MSM` precompile
rubo Mar 13, 2026
6a4a2c2
Unify function name
rubo Mar 13, 2026
a8c4fbb
Shut cspell up 🤮
rubo Mar 13, 2026
a9cf0a6
Merge branch 'master' into feature/stateless-zisk
rubo Mar 14, 2026
10d8b05
Use `ulong` for chain id
rubo Mar 14, 2026
5e99852
Refactor precompiles
rubo Mar 14, 2026
2cab0ae
Merge branch 'master' into feature/stateless-zisk
rubo Mar 16, 2026
9de75da
Revert `TransactionProcessor`
rubo Mar 16, 2026
bda1ba6
Implement `BLS12_G2ADD` precompile
rubo Mar 16, 2026
2b6cc7f
Implement `BLS12_G2MSM` precompile
rubo Mar 16, 2026
a3c538b
Implement `BLS12_MAP_FP_TO_G1` precompile
rubo Mar 17, 2026
6992f0f
Implement `BLS12_MAP_FP2_TO_G2` precompile
rubo Mar 17, 2026
0461c5c
Update README
rubo Mar 17, 2026
c927e91
Merge branch 'master' into feature/stateless-zisk
rubo Mar 17, 2026
060ae92
Implement `BLS12_PAIRING_CHECK` precompile
rubo Mar 18, 2026
a9bc3b1
Refactor EIP-2537 precompiles
rubo Mar 18, 2026
f30aed1
Merge branch 'master' into feature/stateless-zisk
rubo Mar 18, 2026
6d95550
Update Nethermind.ZiskBindings package
rubo Mar 18, 2026
0fc1fe3
Merge `Tester` project into `ZiskGuest`
rubo Mar 19, 2026
4eee306
Move the project to be alongside the main codebase
rubo Mar 19, 2026
2203263
Merge branch 'master' into feature/stateless-zisk
rubo Mar 19, 2026
f7d15b0
Restore `ECRecoverPrecompile` file name
rubo Mar 19, 2026
58ddd96
Implement `MODEXP` precompile
rubo Mar 19, 2026
2b76fb5
Merge branch 'master' into feature/stateless-zisk
rubo Mar 20, 2026
006cb3a
Implement `KZG_POINT_EVALUATION` precompile
rubo Mar 20, 2026
a502c86
Bring back `KzgPolynomialCommitments.BlsModulus`
rubo Mar 20, 2026
c9a49b9
Implement `P256VERIFY` precompile
rubo Mar 20, 2026
4ecf70c
Implement `SHA256` precompile
rubo Mar 20, 2026
f620159
Implement `BLAKE2F` precompile
rubo Mar 20, 2026
78ff54a
Fix memory alignment issues
rubo Mar 21, 2026
644b455
Refactor and unify precompiles
rubo Mar 21, 2026
e006a19
Switch to Zisk v0.16.1
rubo Mar 22, 2026
eea5d28
Merge branch 'master' into feature/stateless-zisk
rubo Mar 22, 2026
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
111 changes: 0 additions & 111 deletions .github/workflows/build-stateless-exec.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/build-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- Kute/Kute.slnx
# - SchemaGenerator/SchemaGenerator.slnx
- SendBlobs/SendBlobs.slnx
- StatelessExecution/StatelessExecution.slnx
- TxParser/TxParser.slnx
steps:
- name: Check out repository
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/stateless-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Stateless execution tests

on:
merge_group:
types: [checks_requested]
pull_request:
branches: [master]
push:
branches: [master]
workflow_dispatch:
inputs:
upload:
description: Upload binaries
type: boolean
required: false
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
EXPECTED_BLOCK_HASH: "0x2528a96c6c16ff80a8c92b84d7202f8250d74c0dd9e520a536179467f7e284b8"

jobs:
test-zisk:
name: Run on Zisk
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up .NET
uses: actions/setup-dotnet@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare input
working-directory: src/Nethermind/Nethermind.Stateless.ZiskGuest
run: dotnet run -c release -- bin/input.bin

- name: Build Nethermind
working-directory: src/Nethermind/Nethermind.Stateless.ZiskGuest
run: make build-zisk

- name: Test Nethermind
working-directory: src/Nethermind/Nethermind.Stateless.ZiskGuest
run: |
block_hash=$(docker run --rm \
--mount type=bind,source=./bin,target=/n \
nethermindeth/zisk@sha256:1b38e92264c30a4109fdb47f3b175324544085e36b9dde0abf7570c2b1e3312b \
ziskemu -e /n/nethermind -i /n/input.bin \
| tail -n 1
)
if [[ "$block_hash" != "$EXPECTED_BLOCK_HASH" ]]; then
echo "::error::Unexpected block hash: $block_hash"
exit 1
fi

- name: Upload guest binary
if: github.event.inputs.upload
uses: actions/upload-artifact@v4
with:
name: nethermind-zisk
path: src/Nethermind/Nethermind.Stateless.ZiskGuest/bin/nethermind
if-no-files-found: error

test-qemu:
name: Run on QEMU
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up .NET
uses: actions/setup-dotnet@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build Nethermind
working-directory: src/Nethermind/Nethermind.Stateless.ZiskGuest
run: make build-qemu

- name: Test Nethermind
working-directory: src/Nethermind/Nethermind.Stateless.ZiskGuest
run: |
docker build -f Dockerfile.qemu -t zkevm .
block_hash=$(docker run --rm zkevm)
if [[ "$block_hash" != "$EXPECTED_BLOCK_HASH" ]]; then
echo "::error::Unexpected block hash: $block_hash"
exit 1
fi

- name: Upload guest binary
if: github.event.inputs.upload
uses: actions/upload-artifact@v4
with:
name: nethermind-zkevm
path: src/Nethermind/Nethermind.Stateless.ZiskGuest/bin/nethermind
if-no-files-found: error
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<PackageVersion Include="Nethermind.MclBindings" Version="1.0.5" />
<PackageVersion Include="Nethermind.Numerics.Int256" Version="1.5.0" />
<PackageVersion Include="Nethermind.TurboPForBindings" Version="1.0.0" />
<PackageVersion Include="Nethermind.ZiskBindings" Version="1.0.0-preview.21" />
<PackageVersion Include="Nito.Collections.Deque" Version="1.2.1" />
<PackageVersion Include="NJsonSchema" Version="11.3.2" />
<PackageVersion Include="NLog" Version="5.5.1" />
Expand Down Expand Up @@ -93,4 +94,4 @@
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="ZstdSharp.Port" Version="0.8.7" />
</ItemGroup>
</Project>
</Project>
8 changes: 4 additions & 4 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="bdn-nightly" value="https://www.myget.org/F/benchmarkdotnet/api/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/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">
Expand All @@ -22,8 +22,8 @@
<package pattern="Microsoft.Diagnostics.Runtime" />
<package pattern="Microsoft.Diagnostics.Runtime.*" />
</packageSource>
<!--<packageSource key="nugettest.org">
<package pattern="" />
</packageSource>-->
<packageSource key="nugettest.org">
<package pattern="Nethermind.ZiskBindings" />
</packageSource>
</packageSourceMapping>
</configuration>
14 changes: 14 additions & 0 deletions src/Nethermind/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

<Import Project="../../Directory.Build.targets" />

<ItemGroup Condition="$(EnableZkEvm) == 'true'">
<Compile Remove="**/std/**/*.cs" />
<None Include="**/std/**/*.cs" />
<Compile Remove="**/*.std.cs" />
<None Include="**/*.std.cs" />
</ItemGroup>

<ItemGroup Condition="$(EnableZkEvm) != 'true'">
<Compile Remove="**/zkevm/**/*.cs" />
<None Include="**/zkevm/**/*.cs" />
<Compile Remove="**/*.zkevm.cs" />
<None Include="**/*.zkevm.cs" />
</ItemGroup>

<!-- Share native runtimes dir across projects during with a shared location and junctions/symlinks.
Enable with `-p:SaveDiskSpace=true` or an environment variable. -->
<PropertyGroup Condition="'$(SaveDiskSpace)' == 'true'">
Expand Down
41 changes: 41 additions & 0 deletions src/Nethermind/Nethermind.Crypto/EthereumEcdsa.zkevm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Core;
using Nethermind.Core.Crypto;

namespace Nethermind.Crypto;

public sealed class EthereumEcdsa(ulong chainId) : IEthereumEcdsa
{
public ulong ChainId => chainId;

public Address? RecoverAddress(Signature signature, in ValueHash256 message)
{
Span<byte> output = stackalloc byte[32];
byte success = ZiskBindings.Crypto.secp256k1_ecdsa_address_recover_c(
signature.Bytes, signature.RecoveryId, message.Bytes, output);

return success == 0 ? new(output[12..]) : null;
}

public CompressedPublicKey? RecoverCompressedPublicKey(Signature signature, in ValueHash256 message) =>
throw new NotSupportedException();

public PublicKey? RecoverPublicKey(Signature signature, in ValueHash256 message) => throw new NotSupportedException();

public Signature Sign(PrivateKey privateKey, in ValueHash256 message) => throw new NotSupportedException();

public static bool RecoverAddressRaw(
ReadOnlySpan<byte> signature,
byte recoveryId,
ReadOnlySpan<byte> message,
Span<byte> output)
{
byte success = ZiskBindings.Crypto.secp256k1_ecdsa_address_recover_c(
signature, recoveryId, message, output);

return success == 0;
}
}
Loading
Loading