Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
337 commits
Select commit Hold shift + click to select a range
c3d5970
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill Sep 15, 2025
aceb9e0
check for null traced access worldstate
Marchhill Sep 15, 2025
5b016d0
fix hash calc
Marchhill Sep 16, 2025
95a5da7
disable in chainspec params test
Marchhill Sep 16, 2025
f05fcd7
bal snapshot fix
Marchhill Sep 16, 2025
31fdc5d
fix hash match check
Marchhill Sep 16, 2025
f3df8ba
remove comments
Marchhill Sep 16, 2025
4bd3960
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill Sep 16, 2025
ad7d5c8
null hash for empty access lsit
Marchhill Sep 16, 2025
e2643aa
amsterdam fork
Marchhill Sep 17, 2025
cf9629e
add bal to block & header decoder, store encoded bal in block, update…
Marchhill Sep 18, 2025
894f5c8
string encoding
Marchhill Sep 18, 2025
bdd2448
fix decoding
Marchhill Sep 23, 2025
ef6f37b
improve encoding test
Marchhill Sep 23, 2025
dc8122c
fix encoding, add tests
Marchhill Sep 24, 2025
50ab9c1
refactor bal encoding test
Marchhill Sep 25, 2025
d067106
code changes test
Marchhill Sep 25, 2025
e3d9fb5
don't use hash of storage index
Marchhill Sep 25, 2025
5394826
don't add redundant reads
Marchhill Sep 25, 2025
92c7d5a
add new fields to blockchain tests
Marchhill Sep 26, 2025
eacf617
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill Sep 26, 2025
1d6e8da
tidy code
Marchhill Sep 26, 2025
2d3a412
add blockchain engine test support
Marchhill Sep 30, 2025
2665f0e
tidy test base
Marchhill Sep 30, 2025
19694c2
fix engine test loading, different versions
Marchhill Sep 30, 2025
d6fc96d
only set hash if bals enabled
Marchhill Sep 30, 2025
93e823f
fix loading older engine tests
Marchhill Sep 30, 2025
ce700c2
fix BAL decoding in execution payload
Marchhill Oct 1, 2025
94cda6a
formatting
Marchhill Oct 1, 2025
57437f6
fix normal blockchain tests
Marchhill Oct 1, 2025
b3725c3
set to empty block access list hash if not enabled
Marchhill Oct 1, 2025
31b2424
move to newpayloadv5
Marchhill Oct 2, 2025
878b787
trace get account balance
Marchhill Oct 2, 2025
89bf5f9
codehash
Marchhill Oct 2, 2025
c046b92
create account & selfdestruct edge cases
Marchhill Oct 3, 2025
f936546
try only setting null hash when enabled
Marchhill Oct 6, 2025
be3fd21
undo
Marchhill Oct 6, 2025
455efa7
try only setting null hash when enabled
Marchhill Oct 6, 2025
c77d2ee
undo
Marchhill Oct 6, 2025
29537bb
set genesis bal hash in chainspec loader
Marchhill Oct 6, 2025
f0863b4
always set bal hash
Marchhill Oct 6, 2025
6ed885f
add to chainspecbasedprovider
Marchhill Oct 6, 2025
cdcf39b
set to empty hash if genesis
Marchhill Oct 6, 2025
ccfac26
don't record balance change for unchanged balance change in account
Marchhill Oct 8, 2025
6cd23a5
check enabled for traced access world state
Marchhill Oct 8, 2025
16638b0
precompile handling
Marchhill Oct 9, 2025
0d1d43a
don't add empty bal hash to genesis when disabled
Marchhill Oct 9, 2025
9c38e80
add 7702 authority on failed delegation
Marchhill Oct 9, 2025
a714e19
engine rpc amsterdam
Marchhill Oct 10, 2025
ba184ff
comment logs
Marchhill Oct 10, 2025
f07ad62
fix 7702 failed delgation edge case
Marchhill Oct 10, 2025
e15eb98
fix blockchain test runner
Marchhill Oct 10, 2025
64ca3ee
allow null BAL in execution payload
Marchhill Oct 13, 2025
3bd0119
amsterdam chainspec
Marchhill Oct 13, 2025
9bd657c
Merge remote-tracking branch 'upstream/master' into bal-devnet-0
Marchhill Oct 13, 2025
7a3c5e5
encode BAL in payload if not already encoded
Marchhill Oct 13, 2025
bea57ae
package lock
Marchhill Oct 13, 2025
5a56c5f
disable warning temporarily
Marchhill Oct 13, 2025
54a00d5
fix block building
Marchhill Oct 13, 2025
32b91d9
add encoding and decoding logs tmp
Marchhill Oct 14, 2025
0c23e49
improve logs for degbugging
Marchhill Oct 14, 2025
b9fba1f
fix bal index for building & decoding index 0
Marchhill Oct 14, 2025
8087b86
reset block access index
Marchhill Oct 14, 2025
cfad062
try to fix invalid hash, add logs
Marchhill Oct 14, 2025
601db9e
remove log
Marchhill Oct 14, 2025
c774422
log encoding balance changes
Marchhill Oct 14, 2025
2668013
try fix ushort decoding, save encoded bal
Marchhill Oct 14, 2025
30b6f29
try fix account changes in wrong order error
Marchhill Oct 14, 2025
96bdd95
coinbase zero transfer edge case
Marchhill Oct 16, 2025
e461a6c
code change max increase
Marchhill Oct 16, 2025
7352691
Merge remote-tracking branch 'upstream/master' into bal-devnet-0
Marchhill Oct 16, 2025
cc7e07c
enforce rlp buffer size limits
Marchhill Oct 16, 2025
36937cd
fix test runners
Marchhill Oct 16, 2025
78d054e
fix restore
Marchhill Oct 17, 2025
074a9e7
fix reverting storage change
Marchhill Oct 17, 2025
81f3d0f
add account read for extcodecopy
Marchhill Oct 17, 2025
bc43434
don't add for extcodecopy when oog
Marchhill Oct 17, 2025
872ff02
fix engine test runner
Marchhill Oct 20, 2025
c3b9447
refactor test runner
Marchhill Oct 20, 2025
f9ff97a
don't record storage change if resets to same value
Marchhill Oct 20, 2025
88ae970
remove storage changes if empty
Marchhill Oct 20, 2025
4023bc2
fix storage changes
Marchhill Oct 21, 2025
77c7130
only add read if write not present
Marchhill Oct 21, 2025
a6081ae
fix error message
Marchhill Oct 21, 2025
41e689d
add changes when resetting to og value
Marchhill Oct 21, 2025
bd76f9d
change comparison, add logging
Marchhill Oct 21, 2025
eb23d61
more logging
Marchhill Oct 21, 2025
e314c75
even more logging
Marchhill Oct 21, 2025
8f5604e
use sequenceequal
Marchhill Oct 21, 2025
689f10c
check for previous code deployed being the same
Marchhill Oct 21, 2025
5536c3d
record more account accesses
Marchhill Oct 22, 2025
8d63f4d
extcodesize
Marchhill Oct 22, 2025
e7b662d
fix tracing
Marchhill Oct 22, 2025
80cadec
remove console logs
Marchhill Oct 23, 2025
23171a3
remove coinbase edge case
Marchhill Oct 31, 2025
d8ac0ea
Merge remote-tracking branch 'upstream/master' into bal-devnet-0-test
Marchhill Nov 6, 2025
fe46806
bpo forks
Marchhill Nov 7, 2025
246ff27
base fee update fractions
Marchhill Nov 7, 2025
359df9c
add bpos to spec name parser
Marchhill Nov 7, 2025
4cb4f45
Merge remote-tracking branch 'upstream' into bal-devnet-0-test
Marchhill Nov 7, 2025
e09553b
change blockchain tests
Marchhill Nov 10, 2025
8f7c3b1
fix setnonce tracing
Marchhill Nov 10, 2025
e4718eb
add storage slot to changes in edge case
Marchhill Nov 10, 2025
e3d4308
generatedblockaccesslist for debugging
Marchhill Nov 11, 2025
b0dd675
add testing log for decoding
Marchhill Nov 11, 2025
1f064b7
try adding sequence length in block encoding
Marchhill Nov 11, 2025
9da9946
try block decoding fix
Marchhill Nov 11, 2025
0730d44
try fix bal json serialisation
Marchhill Nov 11, 2025
d4555b6
refactor
Marchhill Nov 12, 2025
5a4fd75
debug assert fail for unreachable codde
Marchhill Nov 12, 2025
3441a90
remove code change diff check
Marchhill Nov 12, 2025
df5a82d
string encoding use json
Marchhill Nov 12, 2025
692e22b
fix: check count empty when checking if storage changed
Marchhill Nov 12, 2025
afbfee9
Merge remote-tracking branch 'upstream/master' into bal-devnet-0-test-2
Marchhill Nov 24, 2025
47cb345
fix merge
Marchhill Nov 24, 2025
8cf31e6
fix json serialisation
Marchhill Nov 24, 2025
391c817
fix suggested & generated
Marchhill Nov 24, 2025
d38c6ba
fix check code change
Marchhill Nov 24, 2025
6fffe33
blockchain test blob schedule load
Marchhill Nov 24, 2025
d74a4b8
nonce change on account creation
Marchhill Nov 24, 2025
84c1157
debugging logs for blob schedule
Marchhill Nov 25, 2025
befc83a
fix compile
Marchhill Nov 25, 2025
5d98db8
more logs
Marchhill Nov 25, 2025
ebb5b77
try basing amsterdam on osaka
Marchhill Nov 25, 2025
1c76673
undo change
Marchhill Nov 25, 2025
ee35d5f
print HIVE vars
Marchhill Nov 25, 2025
0a066b4
new blobschedule log
Marchhill Nov 25, 2025
7f6ab10
override to 6/9
Marchhill Nov 25, 2025
3fb5f65
check of code has changed during tx
Marchhill Nov 25, 2025
c8ed3d2
include system address balance change
Marchhill Nov 25, 2025
c2b7c0a
fix adding back storage read, handling of system account
Marchhill Nov 25, 2025
e90fce7
undo bpo override
Marchhill Nov 26, 2025
b357c93
move delegation check later call
Marchhill Nov 26, 2025
2063877
remove extra logs
Marchhill Nov 26, 2025
911c4a6
Merge branch 'master' of github.com:NethermindEth/nethermind into bal…
Marchhill Nov 26, 2025
70d2afb
set balance to 0 on selfdestruct
Marchhill Nov 26, 2025
43d2e73
copy generatedbal to suggested block
Marchhill Dec 1, 2025
4c78c3b
Fix cross-block state leak of `_parityTouchBugAccount.ShouldDelete` f…
qu0b Dec 1, 2025
aeb8a73
codecopy fix
Marchhill Dec 4, 2025
01c5761
Merge branch 'bal-devnet-0' of github.com:NethermindEth/nethermind in…
Marchhill Dec 4, 2025
030a214
move generatedBAL to top level
Marchhill Dec 8, 2025
b963b7a
getter for generatedBAL
Marchhill Dec 8, 2025
cb15cef
change storage keys and values to UInt256
Marchhill Dec 16, 2025
5c57c15
fix conversion to uint256
Marchhill Dec 16, 2025
cae8a54
delay charge create gas call
Marchhill Dec 17, 2025
b4ff262
add slot changes if not present on restore
Marchhill Dec 17, 2025
5c0cf14
tidy
Marchhill Dec 17, 2025
86b869c
OOG if not enough gas for self-destruct (#10064)
fselmo Jan 5, 2026
6d4715c
Merge branch 'bal-devnet-1' of github.com:NethermindEth/nethermind in…
Marchhill Jan 5, 2026
58f9442
remove bal from block body
Marchhill Jan 5, 2026
f084da7
bal store
Marchhill Jan 5, 2026
e8bf5fd
add engine api endpoints
Marchhill Jan 5, 2026
c3ec66d
add new handlers
Marchhill Jan 5, 2026
c154bf3
fix DI
Marchhill Jan 6, 2026
46bfcfe
add debug endpoitn
Marchhill Jan 6, 2026
c12c252
make shareable
Marchhill Jan 6, 2026
1f826bc
change attributes
Marchhill Jan 6, 2026
cb83d90
getbal test
Marchhill Jan 6, 2026
6963fed
fix encoding
Marchhill Jan 6, 2026
94519bb
insert in bal store on suggest
Marchhill Jan 6, 2026
342a3f5
move to executionpayloadv4
Marchhill Jan 14, 2026
8447cb3
getpayloadv6
Marchhill Jan 14, 2026
4acd687
osaka engine api version
Marchhill Jan 14, 2026
3c64f20
getpayloadv6 DI
Marchhill Jan 15, 2026
9874c30
use executionpayloadv4 in blockchain tests
Marchhill Jan 20, 2026
dca3296
fix removing storage read on revert, copy across BAL from suggested f…
Marchhill Jan 21, 2026
e479770
Bal devnet 2 fixes (#10293)
benaadams Jan 21, 2026
37e891c
Bal devnet 2 merge (#10297)
benaadams Jan 21, 2026
5326cc5
goto outofgas selfdestruct
Marchhill Jan 22, 2026
f639b70
fix call delegation access
Marchhill Jan 22, 2026
2766fb8
fix call gas charging
Marchhill Jan 22, 2026
eaf3efb
move new account charge in call
Marchhill Jan 23, 2026
7a78b71
add bal hash to rpc
Marchhill Jan 23, 2026
abf1b07
rename to parallelworldstate
Marchhill Jan 26, 2026
38c28af
Merge remote-tracking branch 'upstream/master' into bal-devnet-2
Marchhill Jan 26, 2026
3f9f1f6
fix merge conflict testsourceloader
Marchhill Jan 26, 2026
810e247
fix packages lock
Marchhill Jan 26, 2026
165aa66
add trie back to packages lock
Marchhill Jan 26, 2026
175959f
fix gnosis config
Marchhill Jan 26, 2026
17aef0b
fix testsouceloader
Marchhill Jan 26, 2026
3db161c
bal builder refactor
Marchhill Jan 30, 2026
20473ca
remove block size validation check
Marchhill Jan 30, 2026
1f4aa82
use sortedlist for storage changes
Marchhill Jan 30, 2026
4c28ad6
formatting
Marchhill Jan 30, 2026
ef7df4a
move tests
Marchhill Jan 30, 2026
8ec3a96
fix slot changes encoder
Marchhill Jan 30, 2026
e2e0526
fix encoding test
Marchhill Jan 30, 2026
5062607
code tests
Marchhill Jan 30, 2026
ec57526
improve tests
Marchhill Jan 31, 2026
22ee2d9
change bal to class, fix epv4, test fixes
Marchhill Feb 2, 2026
689db35
tidy tests
Marchhill Feb 2, 2026
b11746a
block building test, build.a.bal
Marchhill Feb 2, 2026
d4ed88a
use fcu in block building test, update year
Marchhill Feb 2, 2026
6a2fada
rpc changes
Marchhill Feb 2, 2026
b2dc766
fix engine rpc method, eth error codes
Marchhill Feb 3, 2026
24ebfd6
enginerpc and eth tests
Marchhill Feb 3, 2026
bbfd4b9
add tx to block building test
Marchhill Feb 3, 2026
01d6a04
should_process test and e2e new payload test
Marchhill Feb 3, 2026
1865a99
finish newpayload test
Marchhill Feb 3, 2026
890c65c
copy over validation & test changes
Marchhill Feb 5, 2026
aab6cee
fix block bal validation
Marchhill Feb 5, 2026
1874fc9
early bal invalidation
Marchhill Feb 6, 2026
d14d056
early read validation
Marchhill Feb 6, 2026
8e76723
ext opcode tests
Marchhill Feb 7, 2026
289e834
add evm tests
Marchhill Feb 9, 2026
251b435
precompile test
Marchhill Feb 9, 2026
5269549
call test
Marchhill Feb 9, 2026
6eea214
other call tests
Marchhill Feb 9, 2026
42ac77e
delegated account test
Marchhill Feb 9, 2026
a914b0c
initial oog tests
Marchhill Feb 9, 2026
7640f92
complete pre-state access oog tests
Marchhill Feb 9, 2026
92ae805
complete post-state access oog tests
Marchhill Feb 9, 2026
d8550f3
stack underflow tests
Marchhill Feb 9, 2026
9502f9b
revert_with_return_to_original
Marchhill Feb 9, 2026
e319c26
more evm tests
Marchhill Feb 9, 2026
43303bd
incorrect order decoding tests
Marchhill Feb 9, 2026
882de9b
optimise remove allocations
Marchhill Feb 9, 2026
ec86fdf
unreachable exceptions
Marchhill Feb 9, 2026
aefffe9
clear BAL, code change reduce allocation
Marchhill Feb 9, 2026
f67b74b
filter post execution reads in storage read gas check
Marchhill Feb 9, 2026
96ad72d
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Feb 9, 2026
f72fd5d
tidy
Marchhill Feb 10, 2026
8d7a0c8
fix aura tests
Marchhill Feb 10, 2026
0471b85
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Feb 10, 2026
bfa5cd0
fix tests
Marchhill Feb 10, 2026
ecdbd1c
tidy
Marchhill Feb 10, 2026
e42e6d5
check balbuilder not null when tx processing
Marchhill Feb 10, 2026
6d495da
Update src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Marchhill Feb 10, 2026
3fabee2
Update src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Marchhill Feb 10, 2026
de48b8c
Update src/Nethermind/Ethereum.Test.Base/FileTestsSource.cs
Marchhill Feb 10, 2026
df2e1dd
Fix tests - remove console output and move converters back
flcl42 Feb 24, 2026
60d6f2a
Merge remote-tracking branch 'origin/master' into bal-devnet-2-bals-only
flcl42 Feb 24, 2026
ff97728
Consider another override; scan more; account for Skipped in block bu…
flcl42 Feb 26, 2026
cbf9912
Use records; clean up
flcl42 Feb 26, 2026
58ab5a7
Less heap alloc; check rlp
flcl42 Mar 1, 2026
274638f
Merge remote-tracking branch 'origin/master' into bal-devnet-2-bals-only
flcl42 Mar 1, 2026
d46e218
review comments
Marchhill Mar 2, 2026
9c3e5d0
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Mar 2, 2026
c2c7ce5
fix rlp
Marchhill Mar 2, 2026
fa539a7
fix aura test, blockchain test blob schedule loader
Marchhill Mar 2, 2026
767f78a
tidy
Marchhill Mar 2, 2026
3ac9c84
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Mar 9, 2026
0fe07a6
fix some commetns
Marchhill Mar 9, 2026
b859b07
inherit invalidblockexception
Marchhill Mar 9, 2026
8357110
move addaccountread to extension, tidy delegation handling
Marchhill Mar 9, 2026
3a7b32b
encapsulate setting bal
Marchhill Mar 9, 2026
57c7244
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Mar 9, 2026
a21b883
get tests passing
Marchhill Mar 9, 2026
dd11695
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill Mar 9, 2026
aa45ba0
refactor BlockProcessor
LukaszRozmej Mar 9, 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
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"auxdata",
"backpressure",
"badreq",
"bals",
"barebone",
"baseblock",
"basefee",
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?
List<(ForkActivation Activation, IReleaseSpec Spec)> transitions =
isEngineTest ?
[((ForkActivation)0, test.Network)] :
[((ForkActivation)0, test.GenesisSpec), ((ForkActivation)1, test.Network)]; // TODO: this thing took a lot of time to find after it was removed!, genesis block is always initialized with Frontier
[((ForkActivation)0, test.GenesisSpec), ((ForkActivation)1, test.Network)]; // genesis block is always initialized with Frontier

if (test.NetworkAfterTransition is not null)
{
Expand Down Expand Up @@ -312,7 +312,7 @@ private static BlockHeader SuggestBlocks(BlockchainTest test, bool failOnInvalid

private async static Task RunNewPayloads(TestEngineNewPayloadsJson[]? newPayloads, IEngineRpcModule engineRpcModule)
{
(ExecutionPayloadV3, string[]?, string[]?, int, int)[] payloads = [.. JsonToEthereumTest.Convert(newPayloads)];
(ExecutionPayloadV4, string[]?, string[]?, int, int)[] payloads = [.. JsonToEthereumTest.Convert(newPayloads)];

// blockchain test engine
foreach ((ExecutionPayload executionPayload, string[]? blobVersionedHashes, string[]? validationError, int newPayloadVersion, int fcuVersion) in payloads)
Expand Down
15 changes: 15 additions & 0 deletions src/Nethermind/Ethereum.Test.Base/BlockchainTestJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class BlockchainTestJson
public IReleaseSpec? EthereumNetworkAfterTransition { get; set; }
public ForkActivation? TransitionForkActivation { get; set; }
public string? LastBlockHash { get; set; }
public ConfigJson? Config { get; set; }
public string? GenesisRlp { get; set; }

public TestBlockJson[]? Blocks { get; set; }
Expand All @@ -34,4 +35,18 @@ public class BlockchainTestJson
public string? SealEngine { get; set; }
public string? LoadFailure { get; set; }
}

public class ConfigJson
{
public string? Network { get; set; }
public string? Chainid { get; set; }
public Dictionary<string, BlobScheduleEntryJson>? BlobSchedule;
}

public class BlobScheduleEntryJson
{
public string? Target;
public string? Max;
public string? BaseFeeUpdateFraction;
}
}
29 changes: 23 additions & 6 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Nethermind.Serialization.Json;
using Nethermind.Serialization.Rlp;
using Nethermind.Specs;
using Nethermind.Specs.Test;

namespace Ethereum.Test.Base
{
Expand Down Expand Up @@ -74,7 +75,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
StateRoot = new Hash256(headerJson.StateRoot),
TxRoot = new Hash256(headerJson.TransactionsTrie),
WithdrawalsRoot = headerJson.WithdrawalsRoot is null ? null : new Hash256(headerJson.WithdrawalsRoot),
// BlockAccessListHash = headerJson.BlockAccessListHash is null ? null : new Hash256(headerJson.BlockAccessListHash),
BlockAccessListHash = headerJson.BlockAccessListHash is null ? null : new Hash256(headerJson.BlockAccessListHash),
};

if (headerJson.BaseFeePerGas is not null)
Expand All @@ -85,7 +86,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
return header;
}

public static IEnumerable<(ExecutionPayloadV3, string[]?, string[]?, int, int)> Convert(TestEngineNewPayloadsJson[]? executionPayloadsJson)
public static IEnumerable<(ExecutionPayloadV4, string[]?, string[]?, int, int)> Convert(TestEngineNewPayloadsJson[]? executionPayloadsJson)
{
if (executionPayloadsJson is null)
{
Expand All @@ -98,7 +99,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
string[]? blobVersionedHashes = engineNewPayload.Params.Length > 1 ? engineNewPayload.Params[1].Deserialize<string[]?>(EthereumJsonSerializer.JsonOptions) : null;
string? parentBeaconBlockRoot = engineNewPayload.Params.Length > 2 ? engineNewPayload.Params[2].Deserialize<string?>(EthereumJsonSerializer.JsonOptions) : null;
string[]? validationError = engineNewPayload.Params.Length > 3 ? engineNewPayload.Params[3].Deserialize<string[]?>(EthereumJsonSerializer.JsonOptions) : null;
yield return (new ExecutionPayloadV3()
yield return (new ExecutionPayloadV4()
{
BaseFeePerGas = (ulong)Bytes.FromHexString(executionPayload.BaseFeePerGas).ToUnsignedBigInteger(),
BlockHash = new(executionPayload.BlockHash),
Expand All @@ -113,7 +114,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
ReceiptsRoot = new(executionPayload.ReceiptsRoot),
StateRoot = new(executionPayload.StateRoot),
Timestamp = (ulong)Bytes.FromHexString(executionPayload.Timestamp).ToUnsignedBigInteger(),
// BlockAccessList = executionPayload.BlockAccessList is null ? null : Bytes.FromHexString(executionPayload.BlockAccessList),
BlockAccessList = executionPayload.BlockAccessList is null ? null : Bytes.FromHexString(executionPayload.BlockAccessList),
BlobGasUsed = executionPayload.BlobGasUsed is null ? null : (ulong)Bytes.FromHexString(executionPayload.BlobGasUsed).ToUnsignedBigInteger(),
ExcessBlobGas = executionPayload.ExcessBlobGas is null ? null : (ulong)Bytes.FromHexString(executionPayload.ExcessBlobGas).ToUnsignedBigInteger(),
ParentBeaconBlockRoot = parentBeaconBlockRoot is null ? null : new(parentBeaconBlockRoot),
Expand Down Expand Up @@ -432,11 +433,11 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
string[] transitionInfo = testSpec.Network.Split("At");
string[] networks = transitionInfo[0].Split("To");

testSpec.EthereumNetwork = SpecNameParser.Parse(networks[0]);
testSpec.EthereumNetwork = LoadSpec(networks[0], testSpec.Config?.BlobSchedule);
if (transitionInfo.Length > 1)
{
testSpec.TransitionForkActivation = TransitionForkActivation(transitionInfo[1]);
testSpec.EthereumNetworkAfterTransition = SpecNameParser.Parse(networks[1]);
testSpec.EthereumNetworkAfterTransition = LoadSpec(networks[1], testSpec.Config?.BlobSchedule);
}

(string name, string category) = GetNameAndCategory(testName);
Expand All @@ -446,6 +447,22 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
return testsByName;
}

private static IReleaseSpec LoadSpec(string name, Dictionary<string, BlobScheduleEntryJson>? blobSchedule)
{
IReleaseSpec spec = SpecNameParser.Parse(name);
if (blobSchedule is null || !blobSchedule.TryGetValue(name, out BlobScheduleEntryJson? blobCount))
{
return spec;
}

return new OverridableReleaseSpec(spec)
{
MaxBlobCount = System.Convert.ToUInt64(blobCount.Max, 16),
TargetBlobCount = System.Convert.ToUInt64(blobCount.Target, 16),
BlobBaseFeeUpdateFraction = System.Convert.ToUInt64(blobCount.BaseFeeUpdateFraction, 16)
};
}

private static (string name, string category) GetNameAndCategory(string key)
{
key = key.Replace('\\', '/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Nethermind.Evm;
using Nethermind.Evm.CodeAnalysis;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.State;
using Nethermind.Specs.Forks;
using Nethermind.State;
using NSubstitute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
using NUnit.Framework;
using System.Collections.Generic;
using FluentAssertions;
using Nethermind.Core.BlockAccessLists;
using Nethermind.Serialization.Rlp;
using Nethermind.Core.Test;

namespace Nethermind.Blockchain.Test.Validators;
Expand Down Expand Up @@ -252,15 +254,17 @@ private static IEnumerable<TestCaseData> BadSuggestedBlocks()
.TestObject,
parent,
Substitute.For<ISpecProvider>(),
"InvalidUnclesHash");
"InvalidUnclesHash")
{ TestName = "InvalidUnclesHash" };

yield return new TestCaseData(
Build.A.Block
.WithHeader(Build.A.BlockHeader.WithParent(parent).WithTransactionsRoot(Keccak.Zero).TestObject)
.TestObject,
parent,
Substitute.For<ISpecProvider>(),
"InvalidTxRoot");
"InvalidTxRoot")
{ TestName = "InvalidTxRoot" };

yield return new TestCaseData(
Build.A.Block.WithBlobGasUsed(131072)
Expand All @@ -275,13 +279,50 @@ private static IEnumerable<TestCaseData> BadSuggestedBlocks()
.TestObject,
parent,
new CustomSpecProvider(((ForkActivation)0, Cancun.Instance)),
"InsufficientMaxFeePerBlobGas");
"InsufficientMaxFeePerBlobGas")
{ TestName = "InsufficientMaxFeePerBlobGas" };

yield return new TestCaseData(
Build.A.Block.WithParent(parent).WithEncodedSize(Eip7934Constants.DefaultMaxRlpBlockSize + 1).TestObject,
parent,
new CustomSpecProvider(((ForkActivation)0, Osaka.Instance)),
"ExceededBlockSizeLimit");
"ExceededBlockSizeLimit")
{ TestName = "ExceededBlockSizeLimit" };

yield return new TestCaseData(
Build.A.Block
.WithParent(parent)
.WithBlobGasUsed(0)
.WithWithdrawals([])
.WithBlockAccessList(new())
.WithEncodedBlockAccessList(Rlp.Encode(new BlockAccessList()).Bytes).TestObject,
parent,
new CustomSpecProvider(((ForkActivation)0, Amsterdam.Instance)),
"InvalidBlockLevelAccessListHash")
{ TestName = "InvalidBlockLevelAccessListHash" };

yield return new TestCaseData(
Build.A.Block
.WithParent(parent)
.WithBlobGasUsed(0)
.WithWithdrawals([])
.WithBlockAccessList(new())
.WithEncodedBlockAccessList([0xfa]).TestObject,
parent,
new CustomSpecProvider(((ForkActivation)0, Amsterdam.Instance)),
"InvalidBlockLevelAccessList")
{ TestName = "InvalidBlockLevelAccessList" };

yield return new TestCaseData(
Build.A.Block
.WithParent(parent)
.WithBlobGasUsed(0)
.WithWithdrawals([])
.WithBlockAccessList(new()).TestObject,
parent,
new CustomSpecProvider(((ForkActivation)0, Osaka.Instance)),
"BlockLevelAccessListNotEnabled")
{ TestName = "BlockLevelAccessListNotEnabled" };
}

[TestCaseSource(nameof(BadSuggestedBlocks))]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Autofac.Features.AttributeFilters;
using Nethermind.Core;
using Nethermind.Core.BlockAccessLists;
using Nethermind.Core.Crypto;
using Nethermind.Db;
using Nethermind.Serialization.Rlp;
using Nethermind.Serialization.Rlp.Eip7928;
using System;

namespace Nethermind.Blockchain.Headers;

public class BlockAccessListStore(
[KeyFilter(DbNames.BlockAccessLists)] IDb balDb,
BlockAccessListDecoder? decoder = null)
: IBlockAccessListStore
{
private readonly BlockAccessListDecoder _balDecoder = decoder ?? new();

public void Insert(Hash256 blockHash, BlockAccessList bal)
{
using NettyRlpStream rlpStream = BlockAccessListDecoder.Instance.EncodeToNewNettyStream(bal);
balDb.Set(blockHash, rlpStream.AsSpan());
}

public void Insert(Hash256 blockHash, byte[] encodedBal)
=> balDb.Set(blockHash, encodedBal);

public byte[]? GetRlp(Hash256 blockHash)
=> balDb.Get(blockHash);

public BlockAccessList? Get(Hash256 blockHash)
{
ReadOnlySpan<byte> rlp = balDb.GetSpan(blockHash);
return rlp.IsEmpty ? null : _balDecoder.Decode(rlp);
}

public void Delete(Hash256 blockHash)
=> balDb.Delete(blockHash);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using Nethermind.Core;
using Nethermind.Core.BlockAccessLists;
using Nethermind.Core.Crypto;

namespace Nethermind.Blockchain.Headers;

public interface IBlockAccessListStore
{
void InsertFromBlock(Block block)
{
if (block.EncodedBlockAccessList is not null)
{
Insert(block.Hash, block.EncodedBlockAccessList);
}
else if (block.BlockAccessList is not null)
{
Insert(block.Hash, block.BlockAccessList);
}
}

void Insert(Hash256 blockHash, byte[] bal);
void Insert(Hash256 blockHash, BlockAccessList bal);
byte[]? GetRlp(Hash256 blockHash);
BlockAccessList? Get(Hash256 blockHash);
void Delete(Hash256 blockHash);
}
6 changes: 6 additions & 0 deletions src/Nethermind/Nethermind.Blockchain/BlockTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public partial class BlockTree : IBlockTree
private readonly IDb _blockInfoDb;
private readonly IDb _metadataDb;
private readonly IBadBlockStore _badBlockStore;
private readonly IBlockAccessListStore _balStore;

private readonly LruCache<ValueHash256, Block> _invalidBlocks =
new(128, 128, "invalid blocks");
Expand Down Expand Up @@ -113,6 +114,7 @@ public BlockTree(
[KeyFilter(DbNames.BlockInfos)] IDb? blockInfoDb,
[KeyFilter(DbNames.Metadata)] IDb? metadataDb,
IBadBlockStore? badBlockStore,
IBlockAccessListStore? balStore,
IChainLevelInfoRepository? chainLevelInfoRepository,
ISpecProvider? specProvider,
IBloomStorage? bloomStorage,
Expand All @@ -126,6 +128,7 @@ public BlockTree(
_blockInfoDb = blockInfoDb ?? throw new ArgumentNullException(nameof(blockInfoDb));
_metadataDb = metadataDb ?? throw new ArgumentNullException(nameof(metadataDb));
_badBlockStore = badBlockStore ?? throw new ArgumentNullException(nameof(badBlockStore));
_balStore = balStore ?? throw new ArgumentNullException(nameof(balStore));
SpecProvider = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
_bloomStorage = bloomStorage ?? throw new ArgumentNullException(nameof(bloomStorage));
_syncConfig = syncConfig ?? throw new ArgumentNullException(nameof(syncConfig));
Expand Down Expand Up @@ -416,6 +419,7 @@ public AddBlockResult Insert(Block block, BlockTreeInsertBlockOptions insertBloc

_blockStore.Insert(block, writeFlags: blockWriteFlags);
_headerStore.InsertBlockNumber(block.Hash, block.Number);
_balStore.InsertFromBlock(block);

bool saveHeader = (insertBlockOptions & BlockTreeInsertBlockOptions.SaveHeader) != 0;
if (saveHeader)
Expand Down Expand Up @@ -483,6 +487,7 @@ protected virtual AddBlockResult Suggest(Block? block, BlockHeader header, Block
}

_blockStore.Insert(block);
_balStore.InsertFromBlock(block);
}

if (!isKnown)
Expand Down Expand Up @@ -1679,6 +1684,7 @@ public int DeleteChainSlice(in long startNumber, long? endNumber = null, bool fo
_blockInfoDb.Delete(blockHash);
_blockStore.Delete(i, blockHash);
_headerStore.Delete(blockHash);
_balStore.Delete(blockHash);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Nethermind.Evm;
using Nethermind.Evm.CodeAnalysis;
using Nethermind.Evm.Precompiles;
using Nethermind.Evm.State;
using Nethermind.State;

namespace Nethermind.Blockchain;
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Nethermind.Consensus/EngineApiVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ public static class EngineApiVersions
public const int Shanghai = 2;
public const int Cancun = 3;
public const int Prague = 4;
public const int Osaka = 5;
public const int Amsterdam = 6;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class BlockProductionTransactionsExecutor(
ILogManager logManager)
: IBlockProductionTransactionsExecutor
{
private readonly IBlockAccessListBuilder? _balBuilder = stateProvider as IBlockAccessListBuilder;
private readonly ILogger _logger = logManager.GetClassLogger();

protected EventHandler<TxProcessedEventArgs>? _transactionProcessed;
Expand Down Expand Up @@ -77,6 +78,7 @@ public virtual TxReceipt[] ProcessTransactions(Block block, ProcessingOptions pr
}
}
}
_balBuilder?.GeneratedBlockAccessList.IncrementBlockAccessIndex();

block.Header.TxRoot = TxTrie.CalculateRoot(includedTx.AsSpan());
if (blockToProduce is not null)
Expand All @@ -102,6 +104,7 @@ private TxAction ProcessTransaction(
}
else
{
_balBuilder?.GeneratedBlockAccessList.IncrementBlockAccessIndex();
TransactionResult result = transactionProcessor.ProcessTransaction(currentTx, receiptsTracer, processingOptions, stateProvider);

if (result)
Expand All @@ -111,6 +114,7 @@ private TxAction ProcessTransaction(
}
else
{
_balBuilder?.GeneratedBlockAccessList.RollbackCurrentIndex();
args.Set(TxAction.Skip, result.ErrorDescription!);
}
}
Expand Down
Loading
Loading