Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
9070ca2
add to release spec
Marchhill Aug 11, 2025
ea3f4d2
add hash to header
Marchhill Aug 11, 2025
5fae29d
add to block body
Marchhill Aug 11, 2025
273905e
BAL validation
Marchhill Aug 11, 2025
0246d85
add to constuctor
Marchhill Aug 11, 2025
db756e6
set BAL at end of processing
Marchhill Aug 12, 2025
8c6f4e2
constants, ssz containers
Marchhill Aug 12, 2025
dbed6d2
add block access tracer
Marchhill Aug 15, 2025
7d7cb29
construct BAL in tracer
Marchhill Aug 15, 2025
ec347c1
call byte encode, move BAL to core
Marchhill Aug 15, 2025
675485c
block access tracer improvements & tests
Marchhill Aug 18, 2025
65bcb30
add to execution payload
Marchhill Aug 18, 2025
4cd315b
update structures
Marchhill Aug 19, 2025
6f9aabf
only record last change of each tx
Marchhill Aug 19, 2025
d884b36
fix test
Marchhill Aug 19, 2025
0eb0736
change storage tracing
Marchhill Aug 19, 2025
603d56a
RLP encode bal
Marchhill Aug 19, 2025
1726b9b
prewarm addresses
Marchhill Aug 19, 2025
8ac6add
use bal as state provider
Marchhill Aug 19, 2025
190f2e4
reset changes using BAL
Marchhill Aug 21, 2025
f09890c
only trace when EIP enabled
Marchhill Aug 21, 2025
f93a43c
handle withdrawals
Marchhill Aug 21, 2025
2bf2cef
handle system contracts
Marchhill Aug 21, 2025
ce00892
fix compile
Marchhill Aug 21, 2025
9d1d9ff
add block processing test
Marchhill Aug 22, 2025
2f6829d
move bal decoding to suggested block validation
Marchhill Aug 22, 2025
23dc197
decoding debug logs
Marchhill Aug 22, 2025
496b686
empty rlp decode for bal
Marchhill Aug 22, 2025
15bbab1
move RLP decoding
Marchhill Aug 22, 2025
7c31e87
don't encode/decode for testing
Marchhill Aug 22, 2025
9015f70
init beacon block roots address
Marchhill Aug 22, 2025
8ac8939
setup execution requests contracts
Marchhill Aug 22, 2025
4a507b6
start implementing rlp
Marchhill Aug 26, 2025
87dc02c
account changes rlp+
Marchhill Aug 26, 2025
a9f0e93
bal encoding / decoding
Marchhill Aug 27, 2025
d12d0b5
change storagekey to bytes, use rlp in test
Marchhill Aug 27, 2025
3223680
always start new sequence rlp
Marchhill Aug 27, 2025
7009dee
fix bal encoding length
Marchhill Aug 27, 2025
f30d1b5
fix all rlp lengths
Marchhill Aug 27, 2025
c49c33c
fix storagechange and slotchanges encodings
Marchhill Aug 29, 2025
19bafac
use encodearray
Marchhill Aug 29, 2025
143ff10
encoding tests and more fixes
Marchhill Aug 29, 2025
795c35d
storage read encoding, complete bal encoding
Marchhill Aug 29, 2025
8ac9f46
tidy
Marchhill Aug 29, 2025
5f96184
more tidying
Marchhill Aug 29, 2025
3cd7a1a
use specific types
Marchhill Aug 29, 2025
9a7429b
check length is 32 bytes
Marchhill Aug 29, 2025
4b1aec5
check against maximums
Marchhill Aug 29, 2025
723eaca
fix decoding & test
Marchhill Sep 1, 2025
511bd95
equatable in tests, tidy up structs
Marchhill Sep 1, 2025
26be914
formatting
Marchhill Sep 1, 2025
0ad29d0
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill Sep 1, 2025
7d40f7e
refactor test to use testblockchain
Marchhill Sep 1, 2025
b4237c1
tidy tests
Marchhill Sep 1, 2025
e9bc323
fix test
Marchhill Sep 1, 2025
158359f
improve test
Marchhill Sep 2, 2025
0343916
add withdrawal to the test
Marchhill Sep 2, 2025
45923a0
eip 7002 & 7251
Marchhill Sep 2, 2025
e00506c
system contracts, storage changes
Marchhill Sep 3, 2025
7495932
work out hashes
Marchhill Sep 4, 2025
11547d4
simplify storage changes
Marchhill Sep 4, 2025
194fdb5
tidy
Marchhill Sep 4, 2025
df41d5d
simplify more
Marchhill Sep 4, 2025
64d1262
tidy storage reads
Marchhill Sep 4, 2025
fc16d59
tidy 4788
Marchhill Sep 4, 2025
ebb187a
use sorted lists and sets for BAL
Marchhill Sep 4, 2025
cafee52
separate test constants
Marchhill Sep 5, 2025
965f7be
add code change to test
Marchhill Sep 5, 2025
8c2503c
don't record zero nonce change
Marchhill Sep 5, 2025
bb4d82f
refactor from tracer to inside bal
Marchhill Sep 5, 2025
c2bf7a2
add traced and wrapped worldstate
Marchhill Sep 8, 2025
46c55bc
track state changes
Marchhill Sep 8, 2025
6407a68
reset BAL on new scope
Marchhill Sep 8, 2025
5ec4ff5
worldstate improvements
Marchhill Sep 9, 2025
b457091
fix test
Marchhill Sep 9, 2025
f253413
fix encoding test
Marchhill Sep 9, 2025
371478b
optimise incrementnonce
Marchhill Sep 9, 2025
f917e8c
refactor and remove tracer code
Marchhill Sep 9, 2025
cd60b07
optimise adding to and subtracting from balance
Marchhill Sep 10, 2025
9af3112
ignore old code
Marchhill Sep 10, 2025
fb14ec5
check BAL ordering
Marchhill Sep 10, 2025
6eb7232
tidy
Marchhill Sep 10, 2025
f0e7d59
make bal a journal
Marchhill Sep 11, 2025
595b62c
add reverting transaction test
Marchhill Sep 11, 2025
7295799
only construct BAL when enabled
Marchhill Sep 11, 2025
2c5a9e9
add IIndexedChange
Marchhill Sep 11, 2025
e7e5ed2
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill Sep 15, 2025
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
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
14 changes: 9 additions & 5 deletions src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?

bool isEngineTest = test.Blocks is null && test.EngineNewPayloads is not null;

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
List<(ForkActivation Activation, IReleaseSpec Spec)> transitions = [((ForkActivation)0, test.Network)];
// 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

if (test.NetworkAfterTransition is not null)
{
Expand All @@ -98,7 +98,7 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?

ISpecProvider specProvider = new CustomSpecProvider(test.ChainId, test.ChainId, transitions.ToArray());

Assert.That(isEngineTest || test.ChainId == GnosisSpecProvider.Instance.ChainId || specProvider.GenesisSpec == Frontier.Instance, "Expected genesis spec to be Frontier for blockchain tests");
// Assert.That(isEngineTest || test.ChainId == GnosisSpecProvider.Instance.ChainId || specProvider.GenesisSpec == Frontier.Instance, "Expected genesis spec to be Frontier for blockchain tests");

if (test.Network is Cancun || test.NetworkAfterTransition is Cancun)
{
Expand Down Expand Up @@ -168,6 +168,7 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?
test.GenesisRlp ??= Rlp.Encode(new Block(JsonToEthereumTest.Convert(test.GenesisBlockHeader)));

Block genesisBlock = Rlp.Decode<Block>(test.GenesisRlp.Bytes);
// Console.WriteLine(genesisBlock.ToString(Block.Format.Full));
Assert.That(genesisBlock.Header.Hash, Is.EqualTo(new Hash256(test.GenesisBlockHeader.Hash)));

ManualResetEvent genesisProcessed = new(false);
Expand Down Expand Up @@ -352,6 +353,9 @@ private async static Task RunNewPayloads(TestEngineNewPayloadsJson[]? newPayload
{
RlpStream rlpContext = Bytes.FromHexString(testBlockJson.Rlp!).AsRlpStream();
Block suggestedBlock = Rlp.Decode<Block>(rlpContext);
// Console.WriteLine("suggested block:");
// Console.WriteLine(suggestedBlock.BlockAccessList);
// Hash256 tmp = new(ValueKeccak.Compute(Rlp.Encode(suggestedBlock.BlockAccessList!.Value).Bytes).Bytes);

if (testBlockJson.BlockHeader is not null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Ethereum.Test.Base/FileTestsSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public IEnumerable<EthereumTest> LoadTests(TestType testType)
return [];
}

Console.WriteLine("loaded " + _fileName);
string json = File.ReadAllText(_fileName, Encoding.Default);

return testType switch
Expand Down
7 changes: 4 additions & 3 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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 Down Expand Up @@ -113,7 +113,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 @@ -412,8 +412,9 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
{
testsInFile = _serializer.Deserialize<Dictionary<string, BlockchainTestJson>>(json);
}
catch (Exception)
catch (Exception e)
{
Console.WriteLine(e);
Dictionary<string, HalfBlockchainTestJson> half =
_serializer.Deserialize<Dictionary<string, HalfBlockchainTestJson>>(json);
testsInFile = [];
Expand Down
Loading
Loading