Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Pectra eip7702 consolidations #7449

Closed
wants to merge 431 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
431 commits
Select commit Hold shift + click to select a range
8c87e72
more tests
ak88 Apr 22, 2024
9177787
add Withdrawal request class
rjnrohit Apr 22, 2024
248bc8b
changed class name
rjnrohit Apr 22, 2024
c65e140
Class structure
MarekM25 Apr 22, 2024
a845e22
namespace cleanup
MarekM25 Apr 22, 2024
2b7b740
withdrawalrequests
MarekM25 Apr 22, 2024
0baf775
working on processor
MarekM25 Apr 22, 2024
bf19a09
processor ready
MarekM25 Apr 22, 2024
019261a
add jsonIgnore
MarekM25 Apr 22, 2024
099ac06
add processor to main pipeline
MarekM25 Apr 22, 2024
9df02dd
format files
rjnrohit Apr 22, 2024
67256a7
add ulong tests
MarekM25 Apr 22, 2024
e2b9a20
add tests
MarekM25 Apr 22, 2024
cc9b125
fix endianness
MarekM25 Apr 22, 2024
e31d7e1
eip tests
ak88 Apr 22, 2024
dc80542
add decode for consensus requests
rjnrohit Apr 22, 2024
f9cfdca
fixed failing
rjnrohit Apr 22, 2024
b3e7236
fix contentLength: ConsensusRequest
rjnrohit Apr 22, 2024
37c3121
Resolved conflicts
MarekM25 Apr 22, 2024
8f25b4d
working on 7002 syscall
MarekM25 Apr 22, 2024
6c1b526
more tests
ak88 Apr 23, 2024
c30e5ea
Requests root
MarekM25 Apr 23, 2024
a88a9a1
test for account access gas
ak88 Apr 23, 2024
b830c3c
fixed engine test and genesis loading
MarekM25 Apr 23, 2024
fac85b7
working on engine tests
MarekM25 Apr 23, 2024
f20dd96
Test authorized is unset if invalid sig
ak88 Apr 23, 2024
9813ba5
proper behavior for extra bytes
ak88 Apr 23, 2024
945fd55
6700 extra gas if authcall has value
ak88 Apr 23, 2024
8e45f17
Merge branch 'master' into feature/eip-3074
ak88 Apr 24, 2024
d67038c
separate method for AUTH
ak88 Apr 24, 2024
1381e54
simplify GetCallExecutionType
LukaszRozmej Apr 24, 2024
e41e2b2
Remove phantom fork timestamps
LukaszRozmej Apr 24, 2024
65f3d52
refactors
LukaszRozmej Apr 24, 2024
8820487
accountToDebit
LukaszRozmej Apr 24, 2024
eb0cfc4
whitespace
LukaszRozmej Apr 24, 2024
9321d26
refactorings
LukaszRozmej Apr 24, 2024
03617db
fixed engine test for v4
MarekM25 Apr 24, 2024
23b9f0d
fix whitespaces
MarekM25 Apr 24, 2024
c1eacc3
remnants of validator exits
MarekM25 Apr 24, 2024
9cacc5a
deposit contract address
MarekM25 Apr 24, 2024
12f7ae1
format files
rjnrohit Apr 24, 2024
e85c294
cosmetic
MarekM25 Apr 24, 2024
89f766a
small refactor
ak88 Apr 25, 2024
833f98a
Merge branch 'feature/eip-3074' of https://github.com/NethermindEth/n…
ak88 Apr 25, 2024
509e47b
more tests
ak88 Apr 25, 2024
3cdc1fb
more engine tests
MarekM25 Apr 25, 2024
7ceea26
Merge branch 'ft/eip-7002' of https://github.com/nethermindeth/nether…
MarekM25 Apr 25, 2024
ef78003
add support for skipTypedWrapping
rjnrohit Apr 25, 2024
ec9105f
format files
rjnrohit Apr 25, 2024
9196724
update decode functions
rjnrohit Apr 25, 2024
9c52c7c
format files
rjnrohit Apr 25, 2024
bca1d16
fix errors
rjnrohit Apr 25, 2024
463477b
check authorized for code
ak88 Apr 28, 2024
fbe3566
fixed engine test
MarekM25 Apr 29, 2024
ea0fd1d
Merge branch 'ft/eip-7002' of https://github.com/nethermindeth/nether…
MarekM25 Apr 29, 2024
75fe6c4
fix chainspec tests
MarekM25 Apr 29, 2024
5d54446
fix AuRa tests
MarekM25 Apr 29, 2024
ced4519
fix whitespaces
MarekM25 Apr 29, 2024
271b35b
cosmetic
MarekM25 Apr 29, 2024
e45f684
cosmetic cleanups
MarekM25 Apr 29, 2024
da837a0
limit maxSearch
MarekM25 Apr 29, 2024
2932882
cosmetic cleanups
MarekM25 Apr 29, 2024
2b8734c
fix whitespaces
MarekM25 Apr 29, 2024
187f713
cleanup chainspecLoader
MarekM25 Apr 29, 2024
955fbca
address PR comments
rjnrohit Apr 29, 2024
f65c81f
nitpick
rjnrohit Apr 29, 2024
8fd67b7
add decoder argumnet
rjnrohit Apr 29, 2024
3c0a383
make mainnet as a default deposit contract address
MarekM25 Apr 29, 2024
4f9c4dc
Merge branch 'ft/eip-7002' of https://github.com/nethermindeth/nether…
MarekM25 Apr 29, 2024
cce4c0f
add req array
rjnrohit Apr 30, 2024
aa7733d
format files
rjnrohit Apr 30, 2024
304f497
remove req arr
rjnrohit Apr 30, 2024
3e619d5
add req array
rjnrohit Apr 30, 2024
911a920
Merge branch 'master' into ft/eip-7002
rjnrohit Apr 30, 2024
0c18a46
validateHashes
MarekM25 Apr 30, 2024
08bcb9e
whitespaces?
MarekM25 Apr 30, 2024
3b9465e
AUTHCALL gas cost tests
ak88 Apr 30, 2024
06b3f0a
OOG when gaslimit is higher than available
ak88 May 1, 2024
5fc13d7
small fix
ak88 May 1, 2024
1767023
fix
ak88 May 1, 2024
fd9b8e7
test fxes
ak88 May 1, 2024
b167087
Update src/Nethermind/Nethermind.Consensus/Validators/BlockValidator.cs
MarekM25 May 1, 2024
921f069
Update src/Nethermind/Nethermind.Consensus/Requests/ConsensusRequests…
MarekM25 May 1, 2024
dab892c
Update src/Nethermind/Nethermind.Consensus.Clique/CliqueBlockProducer.cs
MarekM25 May 1, 2024
999c5ed
Update src/Nethermind/Nethermind.Consensus/Validators/BlockValidator.cs
MarekM25 May 1, 2024
81cfb80
Review fixes
MarekM25 May 1, 2024
04083ff
fix incorrect target
ak88 May 1, 2024
08d7015
Merge branch 'master' into ft/eip-7002
rjnrohit May 1, 2024
707364f
small naming refactor and test fix
ak88 May 1, 2024
1e4cc94
EXTCODESIZE check in AUTH instead
ak88 May 1, 2024
84d1f13
AUTH code check set failure
ak88 May 1, 2024
2a17a69
better parameter order
LukaszRozmej May 2, 2024
37b489b
fix grammatic
LukaszRozmej May 2, 2024
278f873
Optimize creating `ConsensusRequest`
LukaszRozmej May 2, 2024
1fb5166
refactor BlockValidator a bit
LukaszRozmej May 2, 2024
1a5cce2
refactor tests
LukaszRozmej May 2, 2024
5a9de6c
aura refactor
LukaszRozmej May 2, 2024
05db624
revert incorrect changes
LukaszRozmej May 2, 2024
92f4a21
test no authorized in subcall
ak88 May 2, 2024
79c9b99
Refactor Engine API with even more strict ExecutionPayload versioning…
LukaszRozmej May 2, 2024
fbd20a1
add request serializer
rjnrohit May 3, 2024
4ae9094
delete deposit.json
rjnrohit May 3, 2024
993b9ec
Add Prague tests
LukaszRozmej May 3, 2024
1651033
Make PragueTests explicit for now
LukaszRozmej May 3, 2024
8a86b87
Merge branch 'master' into feature/eip-7002_system_tx
rjnrohit May 3, 2024
648bc1c
Merge branch 'master' into ft/eip-7002
rjnrohit May 3, 2024
0ed3097
adjust engine field name
MarekM25 May 5, 2024
e679bec
resolved conflicts
MarekM25 May 5, 2024
bc42bf6
Merge branch 'master' into feature/eip-7002_system_tx
rjnrohit May 6, 2024
c1c4ab4
Merge branch 'feature/eip-7002_system_tx' into ft/eip-7002
rjnrohit May 6, 2024
70f0234
format files
rjnrohit May 6, 2024
97ca405
fix build error
rjnrohit May 6, 2024
0b77845
fix arg error
rjnrohit May 6, 2024
b3e0504
again fix arg error
rjnrohit May 6, 2024
6cc6774
address some lukasz comments
rjnrohit May 6, 2024
2528188
format whitespace
ak88 May 6, 2024
2b83051
remove test
ak88 May 6, 2024
92ea4f6
Merge branch 'master' into feature/eip-3074
ak88 May 6, 2024
669853c
invalid op test fix
ak88 May 6, 2024
1ed395b
address lukasz comments
rjnrohit May 7, 2024
e1fa002
Merge branch 'master' into ft/eip-7002
rjnrohit May 7, 2024
a4f601b
Merge branch 'master' into ft/eip-7002
rjnrohit May 7, 2024
70e926e
update test hashes
rjnrohit May 7, 2024
cc7bab1
update hash in merge test
rjnrohit May 7, 2024
01e02a2
update state root
rjnrohit May 7, 2024
fc273d6
fix DepositsProcessor
MarekM25 May 8, 2024
94ea7a3
from review comments
ak88 May 8, 2024
0952e33
resolved conflicts
MarekM25 May 8, 2024
eeae2f3
test fixes
MarekM25 May 8, 2024
6d4a20c
fixes
MarekM25 May 8, 2024
9042e63
Fix InvalidBlockInterceptor
MarekM25 May 8, 2024
edf6989
fixed conflicts
MarekM25 May 8, 2024
a3f8a10
cleanup
MarekM25 May 8, 2024
95bea29
fix file encoding
MarekM25 May 8, 2024
85cc58b
fix hashes
MarekM25 May 8, 2024
7ea2ed2
fix tests
MarekM25 May 8, 2024
fdd02ae
resolved conflicts
MarekM25 May 8, 2024
da6c886
cosmetic
MarekM25 May 13, 2024
2597b67
fix validatorPubKey ->validatorPublicKey
MarekM25 May 14, 2024
59a05ee
fix pubkey
MarekM25 May 14, 2024
60cc1b7
fix DepositProcessorTests
MarekM25 May 15, 2024
283f63b
fix AUTH call gas costs
MarekM25 May 16, 2024
67ab80f
RLP encoding
ak88 Jun 5, 2024
2843085
start test
ak88 Jun 5, 2024
bc8c3e9
refactor
ak88 Jun 7, 2024
3ed58a3
Pectra: fix merge conflicts (#7170)
rjnrohit Jun 12, 2024
147d69d
Merge branch 'master' into pectra
rjnrohit Jun 12, 2024
79ffe9d
remove duplicate import
rjnrohit Jun 12, 2024
1bb851d
Merge branch 'master' into pectra
rjnrohit Jun 16, 2024
e1d3265
Rename: `ValidatorPublicKey` -> `ValidatorPubKey` (#7172)
rjnrohit Jun 16, 2024
5262378
Remove support of eip3074 from pectra (#7189)
rjnrohit Jun 17, 2024
33652fc
insert code in EOA
ak88 Jun 17, 2024
303a0f6
removed wrong test
ak88 Jun 20, 2024
de4d4d7
cleanup
ak88 Jun 20, 2024
4c591cc
more tests added
ak88 Jun 20, 2024
40903d1
Merge branch 'master' into feature/eip-7702
ak88 Jun 20, 2024
f3c8a7d
more tests
ak88 Jun 20, 2024
c18c3d5
refactor with CodeInfoRepo
ak88 Jun 20, 2024
8a9cd0d
format whitespace
ak88 Jun 20, 2024
bb6f5cf
small refactor
ak88 Jun 23, 2024
bccfd21
refactor and unittest
ak88 Jun 24, 2024
a50c96c
Recover authority together with sender
ak88 Jun 24, 2024
6e91510
added 7702 to metrics
ak88 Jun 24, 2024
23a2936
dont recover if already recovered
ak88 Jun 24, 2024
d1ef9dd
Small changes
ak88 Jun 24, 2024
c1fd043
format whitespace
ak88 Jun 24, 2024
dd08281
fix recover
ak88 Jun 24, 2024
0dcfb3d
Merge branch 'master' into feature/eip-7702
ak88 Jun 24, 2024
0a8346b
removed test
ak88 Jun 24, 2024
e25a17c
Merge branch 'feature/eip-7702' of https://github.com/NethermindEth/n…
ak88 Jun 24, 2024
a869907
update rlp decoding
Jun 25, 2024
e2fb74d
authorizationtuple being nullable
Jun 25, 2024
c062402
unittest fix
ak88 Jun 25, 2024
d40c3c0
Merge branch 'master' into feature/eip-7702
ak88 Jun 25, 2024
949f5a8
Rlp decoder changes
ak88 Jun 25, 2024
12297d4
refactor
ak88 Jun 26, 2024
21c06a7
txpool test fix
ak88 Jun 26, 2024
1926da9
missing
ak88 Jun 26, 2024
18a8951
Rlp unitest
ak88 Jun 26, 2024
7702fa4
some basic refactorings
LukaszRozmej Jun 27, 2024
ef3370d
simplified refactor and RLP fix
ak88 Jun 27, 2024
05ea012
format whitespace
ak88 Jun 27, 2024
06e48c9
cleanup
ak88 Jun 27, 2024
bbd956a
cleanup and review comments
ak88 Jun 27, 2024
0b182c8
fix for old tx tests
ak88 Jun 27, 2024
ca22d59
removed unused field
ak88 Jun 28, 2024
6218545
CodeInfoRepository passing refactor
LukaszRozmej Jun 28, 2024
35276b6
simplify code
LukaszRozmej Jun 28, 2024
ff5a88d
refactor and recover authority in tx pool
ak88 Jun 28, 2024
7efa123
unit test fix
ak88 Jun 29, 2024
3daf9fb
bad sig will skip and not throw
ak88 Jul 3, 2024
eb84a1d
eip 7702 timestamp
ak88 Jul 24, 2024
182b67b
set the actual value of IsEip7702Enabled
smartprogrammer93 Jul 24, 2024
3ff6605
add test tp chainspec tests to make sure it is loaded
smartprogrammer93 Jul 24, 2024
050fe47
Validate nonce then increment after 7702
ak88 Jul 27, 2024
78a82b5
decode rlp auth list fix
ak88 Jul 31, 2024
9b189d4
Resolved all conflicts
MarekM25 Sep 12, 2024
ff9e4cd
fix whitespaces
MarekM25 Sep 12, 2024
8557a10
fix benchmarks.sln build
MarekM25 Sep 12, 2024
03e4997
fix tests
MarekM25 Sep 12, 2024
be5acf1
fix tests
MarekM25 Sep 12, 2024
b7546f3
fix tests
MarekM25 Sep 13, 2024
45e44cf
Prague: Add support for getPayloadBodiesBy Hash + Range (#7133)
rjnrohit Jun 25, 2024
f4db109
Resolved payload bodies
MarekM25 Sep 13, 2024
5f2434c
Removed log message
MarekM25 Sep 13, 2024
d7d0c04
Cleanup the branch
MarekM25 Sep 13, 2024
51c1701
Cleanup
MarekM25 Sep 13, 2024
aa0196b
Resolved conflicts
MarekM25 Sep 16, 2024
3e156c9
spec changes start
ak88 Aug 16, 2024
ceeee20
revert nonce increments
ak88 Aug 16, 2024
d4e3298
intrinsic gas
ak88 Aug 16, 2024
58da91d
cherry-picking
MarekM25 Sep 16, 2024
129f134
build fix
ak88 Aug 19, 2024
0237c49
fx unittest
ak88 Aug 20, 2024
2e8eddb
spec changes
ak88 Aug 22, 2024
da3e3bd
unit tests
ak88 Aug 22, 2024
7f7e2ee
Merge branch 'pectra' into feature/eip-7702
ak88 Aug 22, 2024
8badf7d
Build fix
ak88 Aug 22, 2024
3be0b1c
change nonce to ulong
ak88 Aug 22, 2024
ac4fd87
refactor ChargeAccountAccessGas
ak88 Aug 24, 2024
bdf56f9
gas fixes and bug
ak88 Aug 26, 2024
61d59f7
merge fix
ak88 Aug 27, 2024
b5cea7a
build fix
ak88 Aug 28, 2024
403207a
refactor txprocessor to using accessed addresses
ak88 Aug 29, 2024
bdc4dc0
fix
ak88 Sep 1, 2024
93159d2
encoder fix
ak88 Sep 2, 2024
bbc81a4
test strg
ak88 Sep 2, 2024
cb6ac2d
fix extcodehash
ak88 Sep 2, 2024
5301b89
7702 refunds
ak88 Sep 3, 2024
29257b2
Use uint256 for sig values
ak88 Sep 4, 2024
aef10ce
state test fix for auth list
ak88 Sep 4, 2024
9b9eb2e
validate auth sig in txvalidator
ak88 Sep 4, 2024
1053f7a
Revert "Use uint256 for sig values"
ak88 Sep 4, 2024
51856ad
unittest fixes
ak88 Sep 4, 2024
8335b61
unique check auth sig validity
ak88 Sep 4, 2024
d5b8037
test cleanup
ak88 Sep 4, 2024
e996c17
unittest fix
ak88 Sep 4, 2024
2ce9f73
do not allow empty auth list
ak88 Sep 5, 2024
2da8111
tx pool check if sender is delegation
ak88 Sep 5, 2024
22152a8
unittest for TxPool
ak88 Sep 6, 2024
904bdb6
modified hive.json for debugging
MarekM25 Sep 9, 2024
b6f2563
hive test cfg
ak88 Sep 9, 2024
6a77929
cleanup
ak88 Sep 9, 2024
2f1e85c
Auth list in RPC
ak88 Sep 9, 2024
d59d3fa
fix, disallow create tx in SetCode tx type
smartprogrammer93 Sep 10, 2024
189e566
fix chainid
ak88 Sep 12, 2024
0f388d1
revert temp path too long fix
ak88 Sep 12, 2024
046fb36
Resolved conflicts
MarekM25 Sep 17, 2024
a0dbd21
Solving errors
MarekM25 Sep 17, 2024
7ec64d2
Builds error solved
MarekM25 Sep 17, 2024
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
76 changes: 32 additions & 44 deletions src/Nethermind/Chains/hive.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"eip155Transition": "0x0",
"maxCodeSizeTransition": "0x0",
"maxCodeSize": 24576,
"maximumExtraDataSize": 102400,
"maximumExtraDataSize": "0x400",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
Expand All @@ -51,57 +51,45 @@
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",
"eip3198Transition": "0x0",
"MergeForkIdTransition": "0x64",
"networkID": "0x7",
"chainID": "0x7"
"eip3651TransitionTimestamp": "0x0",
"eip3855TransitionTimestamp": "0x0",
"eip3860TransitionTimestamp": "0x0",
"eip4895TransitionTimestamp": "0x0",
"eip4844TransitionTimestamp": "0x0",
"eip4788TransitionTimestamp": "0x0",
"eip1153TransitionTimestamp": "0x0",
"eip5656TransitionTimestamp": "0x0",
"eip6780TransitionTimestamp": "0x0",
"eip7702TransitionTimestamp": "0x0",
"chainID": "0x1"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000000"
"nonce": "0x0000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x30000",
"difficulty": "0x00",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x1234",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000658bdf435d810c91414ec09147daa6db624063790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x2fefd8"
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x00",
"gasLimit": "0x016345785d8a0000",
"baseFeePerGas": "0x07"
},
"accounts": {
"0xcf49fda3be353c69b41ed96333cd24302da4556f": {
"balance": "0x123450000000000000000"
},
"0x0161e041aad467a890839d5b08b138c1e6373072": {
"balance": "0x123450000000000000000"
},
"0x87da6a8c6e9eff15d703fc2773e32f6af8dbe301": {
"balance": "0x123450000000000000000"
},
"0xb97de4b8c857e4f6bc354f226dc3249aaee49209": {
"balance": "0x123450000000000000000"
},
"0xc5065c9eeebe6df2c2284d046bfc906501846c51": {
"balance": "0x123450000000000000000"
},
"0x0000000000000000000000000000000000000314": {
"balance": "0x0",
"code": "0x60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a223e05d1461006a578063abd1a0cf1461008d578063abfced1d146100d4578063e05c914a14610110578063e6768b451461014c575b610000565b346100005761007761019d565b6040518082815260200191505060405180910390f35b34610000576100be600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101a3565b6040518082815260200191505060405180910390f35b346100005761010e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506101ed565b005b346100005761014a600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610236565b005b346100005761017960048080359060200190919080359060200190919080359060200190919050506103c4565b60405180848152602001838152602001828152602001935050505060405180910390f35b60005481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050565b7f6031a8d62d7c95988fa262657cd92107d90ed96e08d8f867d32f26edfe85502260405180905060405180910390a17f47e2689743f14e97f7dcfa5eec10ba1dff02f83b3d1d4b9c07b206cbbda66450826040518082815260200191505060405180910390a1817fa48a6b249a5084126c3da369fbc9b16827ead8cb5cdc094b717d3f1dcd995e2960405180905060405180910390a27f7890603b316f3509577afd111710f9ebeefa15e12f72347d9dffd0d65ae3bade81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18073ffffffffffffffffffffffffffffffffffffffff167f7efef9ea3f60ddc038e50cccec621f86a0195894dc0520482abf8b5c6b659e4160405180905060405180910390a28181604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a05b5050565b6000600060008585859250925092505b935093509390505600a165627a7a72305820aaf842d0d0c35c45622c5263cbb54813d2974d3999c8c38551d7c613ea2bc1170029",
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x1234",
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9": "0x01"
}
},
"0x0000000000000000000000000000000000000315": {
"balance": "0x9999999999999999999999999999999",
"code": "0x60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063ef2769ca1461003e575b610000565b3461000057610078600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061007a565b005b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051809050600060405180830381858888f1935050505015610106578173ffffffffffffffffffffffffffffffffffffffff167f30a3c50752f2552dcc2b93f5b96866280816a986c0c0408cb6778b9fa198288f826040518082815260200191505060405180910390a25b5b50505600a165627a7a72305820637991fabcc8abad4294bf2bb615db78fbec4edff1635a2647d3894e2daf6a610029"
},
"0x0000000000000000000000000000000000000316": {
"balance": "0x0",
"code": "0x444355"
},
"0x0000000000000000000000000000000000000317": {
"balance": "0x0",
"code": "0x600160003555"
"0x000f3df6d732807ef1319fb7b8bb8522d0beac02": {
"nonce": "0x01",
"balance": "0x00",
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500",
"storage": {}
},
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"nonce": "0x00",
"balance": "0x1d6329f1c35ca4bfabb9f5610000000000",
"code": "0x",
"storage": {}
},
"0x0000000000000000000000000000000000000001": {
"builtin": {
Expand Down Expand Up @@ -206,4 +194,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Ethereum.Test.Base;
using NUnit.Framework;

namespace Ethereum.Blockchain.Pyspec.Test;

[TestFixture]
[Parallelizable(ParallelScope.All)]
[Explicit("These tests are not ready yet")]
public class PragueBlockChainTests : BlockchainTestBase
{
[TestCaseSource(nameof(LoadTests))]
public async Task Test(BlockchainTest test) => await RunTest(test);

private static IEnumerable<BlockchainTest> LoadTests()
{
TestsSourceLoader loader = new(new LoadPyspecTestsStrategy(), $"fixtures/blockchain_tests/prague");
return loader.LoadTests().OfType<BlockchainTest>();
}
}
22 changes: 22 additions & 0 deletions src/Nethermind/Ethereum.Blockchain.Pyspec.Test/PragueStateTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Linq;
using Ethereum.Test.Base;
using FluentAssertions;
using NUnit.Framework;

namespace Ethereum.Blockchain.Pyspec.Test;

[TestFixture]
[Parallelizable(ParallelScope.All)]
[Explicit("These tests are not ready yet")]
public class PragueStateTests : GeneralStateTestBase
{
[TestCaseSource(nameof(LoadTests))]
public void Test(GeneralStateTest test) => RunTest(test).Pass.Should().BeTrue();

private static IEnumerable<GeneralStateTest> LoadTests()
{
TestsSourceLoader loader = new(new LoadPyspecTestsStrategy(), $"fixtures/state_tests/prague");
return loader.LoadTests().Cast<GeneralStateTest>();
}
}
25 changes: 25 additions & 0 deletions src/Nethermind/Ethereum.Blockchain.Pyspec.Test/PragueTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Ethereum.Test.Base;
using NUnit.Framework;

namespace Ethereum.Blockchain.Pyspec.Test;

[TestFixture]
[Parallelizable(ParallelScope.All)]
[Explicit("These tests are not ready yet")]
public class PragueTests : BlockchainTestBase
{
[TestCaseSource(nameof(LoadTests))]
public async Task Test(BlockchainTest test) => await RunTest(test);

private static IEnumerable<BlockchainTest> LoadTests()
{
TestsSourceLoader loader = new(new LoadPyspecTestsStrategy(), $"fixtures/blockchain_tests/prague");
return loader.LoadTests().OfType<BlockchainTest>();
}
}
26 changes: 26 additions & 0 deletions src/Nethermind/Ethereum.Blockchain.Test/EIP6110Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System.Collections.Generic;
using Ethereum.Test.Base;
using NUnit.Framework;

namespace Ethereum.Blockchain.Test
{
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class Eip6110Tests : GeneralStateTestBase
{
[TestCaseSource(nameof(LoadTests))]
public void Test(GeneralStateTest test)
{
Assert.True(RunTest(test).Pass);
}

public static IEnumerable<GeneralStateTest> LoadTests()
{
var loader = new TestsSourceLoader(new LoadGeneralStateTestsStrategy(), "stEIP6110");
return (IEnumerable<GeneralStateTest>)loader.LoadTests();
}
}
}
20 changes: 20 additions & 0 deletions src/Nethermind/Ethereum.Test.Base/AuthorizationListJson.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ethereum.Test.Base;
public class AuthorizationListJson
{
public string ChainId { get; set; }
public string Address { get; set; }
public string Nonce { get; set; }
public string V { get; set; }
public string R { get; set; }
public string S { get; set; }
public string Signer { get; set; }
}
3 changes: 2 additions & 1 deletion src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?
new BlockProcessor.BlockValidationTransactionsExecutor(transactionProcessor, stateProvider),
stateProvider,
receiptStorage,
new BlockhashStore(specProvider, stateProvider),
transactionProcessor,
new BeaconBlockRootHandler(transactionProcessor),
new BlockhashStore(specProvider, stateProvider),
_logManager);

IBlockchainProcessor blockchainProcessor = new BlockchainProcessor(
Expand Down
2 changes: 2 additions & 0 deletions src/Nethermind/Ethereum.Test.Base/GeneralStateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class GeneralStateTest : IEthereumTest
public UInt256? ParentBlobGasUsed { get; set; }
public UInt256? ParentExcessBlobGas { get; set; }

public Hash256? RequestsRoot { get; set; }

public override string ToString()
{
return $"{Path.GetFileName(Category)}.{Name}_{ForkName}";
Expand Down
12 changes: 9 additions & 3 deletions src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
TrieStore trieStore = new(stateDb, _logManager);
WorldState stateProvider = new(trieStore, codeDb, _logManager);
IBlockhashProvider blockhashProvider = new TestBlockhashProvider();
CodeInfoRepository codeInfoRepository = new();
CodeInfoRepository codeInfoRepository = new(1);
IVirtualMachine virtualMachine = new VirtualMachine(
blockhashProvider,
specProvider,
Expand Down Expand Up @@ -109,6 +109,7 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
header.ParentBeaconBlockRoot = test.CurrentBeaconRoot;
header.ExcessBlobGas = test.CurrentExcessBlobGas ?? (test.Fork is Cancun ? 0ul : null);
header.BlobGasUsed = BlobGasCalculator.CalculateBlobGas(test.Transaction);
header.RequestsRoot = test.RequestsRoot;

Stopwatch stopwatch = Stopwatch.StartNew();
IReleaseSpec? spec = specProvider.GetSpec((ForkActivation)test.CurrentNumber);
Expand Down Expand Up @@ -136,12 +137,17 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)

Block block = Build.A.Block.WithTransactions(test.Transaction).WithHeader(header).TestObject;

bool isValid = _txValidator.IsWellFormed(test.Transaction, spec) && IsValidBlock(block, specProvider);
string error;
bool isValid = _txValidator.IsWellFormed(test.Transaction, spec, out error) && IsValidBlock(block, specProvider);
ak88 marked this conversation as resolved.
Show resolved Hide resolved

if (isValid)
{
transactionProcessor.Execute(test.Transaction, new BlockExecutionContext(header), txTracer);
}
else
{
_logger.Info($"Skipping invalid tx with error: {error}");
}

stopwatch.Stop();

Expand Down Expand Up @@ -178,7 +184,7 @@ private static void InitializeTestState(GeneralStateTest test, WorldState stateP
}

stateProvider.CreateAccount(accountState.Key, accountState.Value.Balance);
stateProvider.InsertCode(accountState.Key, accountState.Value.Code, specProvider.GenesisSpec);
stateProvider.InsertCode(accountState.Key, accountState.Value.Code, specProvider.GenesisSpec, false);
stateProvider.SetNonce(accountState.Key, accountState.Value.Nonce);
}

Expand Down
39 changes: 39 additions & 0 deletions src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static Transaction Convert(PostStateJson postStateJson, TransactionJson t
{
Transaction transaction = new();

transaction.Type = string.IsNullOrEmpty(transactionJson.Type) ? TxType.Legacy : (TxType)ParseFromHex(transactionJson.Type);
transaction.Value = transactionJson.Value[postStateJson.Indexes.Value];
transaction.GasLimit = transactionJson.GasLimit[postStateJson.Indexes.Gas];
transaction.GasPrice = transactionJson.GasPrice ?? transactionJson.MaxPriorityFeePerGas ?? 0;
Expand Down Expand Up @@ -157,7 +158,42 @@ public static Transaction Convert(PostStateJson postStateJson, TransactionJson t
if (transaction.BlobVersionedHashes?.Length > 0)
transaction.Type = TxType.Blob;

if (transactionJson.AuthorizationList is not null)
{
transaction.AuthorizationList =
transactionJson.AuthorizationList
.Select(i => new AuthorizationTuple(
ParseFromHex(i.ChainId),
new Address(i.Address),
ParseFromHex(i.Nonce),
ParseFromHex(i.V),
Bytes.FromHexString(i.R),
Bytes.FromHexString(i.S))).ToArray();
if (transaction.AuthorizationList.Any())
{
transaction.Type = TxType.SetCode;
}
}

return transaction;

static ulong ParseFromHex(string i)
{
Span<byte> bytes = stackalloc byte[8];
var bytes1 = Bytes.FromHexString(i).AsSpan();
if (bytes1.Length <= 8)
{
bytes1.Reverse();
bytes1.CopyTo(bytes);
}
else
{
throw new InvalidDataException("Transaction json contains an invalid value for uint64.");
}

var result = BitConverter.ToUInt64(bytes);
return result;
}
}

private static void ProcessAccessList(AccessListItemJson[]? accessList, AccessList.Builder builder)
Expand Down Expand Up @@ -208,6 +244,7 @@ public static IEnumerable<GeneralStateTest> Convert(string name, GeneralStateTes
}

List<GeneralStateTest> blockchainTests = new();
Console.WriteLine($"Loaded {testJson}");
foreach (KeyValuePair<string, PostStateJson[]> postStateBySpec in testJson.Post)
{
int iterationNumber = 0;
Expand Down Expand Up @@ -287,9 +324,11 @@ public static IEnumerable<GeneralStateTest> Convert(string json)
{
Dictionary<string, GeneralStateTestJson> testsInFile =
_serializer.Deserialize<Dictionary<string, GeneralStateTestJson>>(json);

List<GeneralStateTest> tests = new();
foreach (KeyValuePair<string, GeneralStateTestJson> namedTest in testsInFile)
{
Console.WriteLine($"Loading {namedTest.Key}\n {namedTest.Value.Post}");
tests.AddRange(Convert(namedTest.Key, namedTest.Value));
}

Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Ethereum.Test.Base/LegacyTransactionJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class LegacyTransactionJson
public UInt256 Nonce { get; set; }
public Address To { get; set; }
public UInt256 Value { get; set; }
public string Sender { get; set; }
public byte[] R { get; set; }
public byte[] S { get; set; }
public ulong V { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions src/Nethermind/Ethereum.Test.Base/TransactionJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace Ethereum.Test.Base
{
public class TransactionJson
{
public string Type { get; set; }
public string Sender { get; set; }
public byte[][]? Data { get; set; }
public long[]? GasLimit { get; set; }
public UInt256? GasPrice { get; set; }
Expand All @@ -19,6 +21,7 @@ public class TransactionJson
public byte[]? SecretKey { get; set; }
public AccessListItemJson[]?[]? AccessLists { get; set; }
public AccessListItemJson[]? AccessList { get; set; }
public AuthorizationListJson[]? AuthorizationList { get; set; }
public byte[]?[]? BlobVersionedHashes { get; set; }
public UInt256? MaxFeePerBlobGas { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ void Process(AuRaBlockProcessor auRaBlockProcessor, int blockNumber, Hash256 sta
LimboLogs.Instance,
Substitute.For<IBlockTree>(),
new WithdrawalProcessor(stateProvider, LimboLogs.Instance),
txFilter: txFilter,
transactionProcessor,
null,
txFilter,
contractRewriter: contractRewriter);

return (processor, stateProvider);
Expand Down
Loading
Loading